Documentation ¶
Overview ¶
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
Index ¶
Constants ¶
View Source
const EOFRUNE = -1
Variables ¶
View Source
var BinaryOperators = []boe{ boe{tokenTypeEllipsis, sourceshape.NodeDefineRangeExpression}, boe{tokenTypeExclusiveEllipsis, sourceshape.NodeDefineExclusiveRangeExpression}, boe{tokenTypeBooleanOr, sourceshape.NodeBooleanOrExpression}, boe{tokenTypeBooleanAnd, sourceshape.NodeBooleanAndExpression}, boe{tokenTypeEqualsEquals, sourceshape.NodeComparisonEqualsExpression}, boe{tokenTypeNotEquals, sourceshape.NodeComparisonNotEqualsExpression}, boe{tokenTypeLTE, sourceshape.NodeComparisonLTEExpression}, boe{tokenTypeGTE, sourceshape.NodeComparisonGTEExpression}, boe{tokenTypeLessThan, sourceshape.NodeComparisonLTExpression}, boe{tokenTypeGreaterThan, sourceshape.NodeComparisonGTExpression}, boe{tokenTypeNullOrValueOperator, sourceshape.NodeNullComparisonExpression}, boe{tokenTypePipe, sourceshape.NodeBitwiseOrExpression}, boe{tokenTypeAnd, sourceshape.NodeBitwiseAndExpression}, boe{tokenTypeXor, sourceshape.NodeBitwiseXorExpression}, boe{tokenTypeBitwiseShiftLeft, sourceshape.NodeBitwiseShiftLeftExpression}, boe{tokenTypePlus, sourceshape.NodeBinaryAddExpression}, boe{tokenTypeMinus, sourceshape.NodeBinarySubtractExpression}, boe{tokenTypeModulo, sourceshape.NodeBinaryModuloExpression}, boe{tokenTypeTimes, sourceshape.NodeBinaryMultiplyExpression}, boe{tokenTypeDiv, sourceshape.NodeBinaryDivideExpression}, boe{tokenTypeIsOperator, sourceshape.NodeIsComparisonExpression}, boe{tokenTypeInOperator, sourceshape.NodeInCollectionExpression}, }
BinaryOperators defines the binary operators in precedence order.
Functions ¶
func Parse ¶
func Parse(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, source compilercommon.InputSource, input string) (shared.AstNode, bool)
Parse performs parsing of the given input string and returns the root AST node.
func ParseExpression ¶
func ParseExpression(builder shared.NodeBuilder, source compilercommon.InputSource, startIndex int, input string) (shared.AstNode, bool)
ParseExpression parses the given string as an expression.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.