Documentation
¶
Index ¶
Constants ¶
View Source
const ( LOWEST int EQUALS // == LESSGREATER // > or < SUM // + PRODUCT // * PREFIX // -X or !X CALL // myFunction(X) INDEX // array[index] )
Define precedences. Using iota to give constants incrementing numbers as values. The higher the value, the higher precedence it has.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser constructs the abstract syntax-tree for a program by analyzing the tokens produced by a Lexer. It holds information on the Lexer that is producing tokens, the current token being parsed (curToken), the next token (peekToken), the errors that were encountered during parsing and maps of its tokens with their parsing functions.
func (*Parser) ParseProgram ¶
ParseProgram constructs the root node of a AST an *ast.Program. It then iterates over every token from the lexer until it encounters an token.EOF token.
Click to show internal directories.
Click to hide internal directories.