package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

# Functions

DoTypesContradict returns true if two types cannot both be assigned to same expression.
IsBuiltinType returns true if the data type is one of List, String, or Int64.
IsTypeMoreRestrictive returns true if the first data type gives more complete and detailed information than the second.
NewCompiler constructs a new instance of the Optgen compiler, with the specified list of file paths as its input files.
NewParser constructs a new instance of the Optgen parser, with the specified list of file paths as its input files.
NewScanner constructs a new scanner that will tokenize the given input.

# Constants

AMPERSAND is the ampersand rune: &.
ARROW is an equals sign followed by a greater than sign: =>.
ASTERISK is the asterisk rune: *.
CARET is the caret rune: ^.
COLON is the colon rune: :.
COMMA is the comma rune: ,.
COMMENT is a code comment that extends to end of line: # .* EOL.
DOLLAR is the dollar sign rune: $.
DOT is the dot rune: .
ELLIPSES is three periods in succession: ...
EOF indicates the scanner has reached the end of the input.
EQUALS is the equals sign rune: =.
ERROR indicates that the scanner encountered an error while reading from the input files.
IDENT is an identifier composed of Unicode letter and number runes: UnicodeLetter (UnicodeLetter | UnicodeNumber)*.
ILLEGAL is the invalid token that indicates the scanner has encountered an invalid lexical pattern.
LBRACE is the open curly brace rune: {.
LBRACKET is the open square bracket rune: [.
LPAREN is the open parentheses rune: (.
NUMBER is an numeric literal composed of Unicode numeric digits: UnicodeDigit+.
PIPE is the vertical line rune: |.
RBRACE is the close curly brace rune: }.
RBRACKET is the close square bracket rune: ].
RPAREN is the close parentheses rune: ).
STRING is a literal string delimited by double quotes that cannot extend past the end of a line: " [^"\n]* ".
WHITESPACE is any sequence of Unicode whitespace characters.

# Variables

AnyDataType is a data type about which nothing is known, and so could be any data type.
Int64DataType is a singleton instance of the "int64" external data type.
ListDataType indicates that a pattern matches or constructs a list of expressions.
StringDataType is a singleton instance of the "string" external data type.

# Structs

CompiledExpr is the result of Optgen scanning, parsing, and semantic analysis.
Compiler compiles Optgen language input files and builds a CompiledExpr result from them.
DefineSetDataType indicates that a pattern matches or constructs one of several possible defined operators.
ExternalDataType indicates that a pattern matches or constructs a non- operator type referenced in a Define.
Parser parses Optgen language input files and builds an abstract syntax tree (AST) from them.
Scanner breaks a sequence of characters into a sequence of lexical tokens that are consumed by the parser in order to construct an Optgen AST.
SourceLoc provides the original source location of an expression, including file name and line number and column position within that file.

# Interfaces

DataType is a marker interface implemented by structs that describe the kind of data that will be returned by an expression in a match or replace pattern.
Expr is implemented by all Optgen AST expressions, exposing its properties, children, and string representation.

# Type aliases

FileResolver is used by the parser to abstract the opening and reading of input files.
Token is the kind of lexical token returned by the scanner (string, parentheses, comment, etc).
VisitFunc is called by the Visit method of an expression for each child of that expression.