Documentation ¶
Index ¶
Constants ¶
View Source
const ( Lowest = iota + 1 Equals LessGreater Sum Product Prefix Call Index )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser repeatedly calls lexer's NextToken to apply logic onto it. We need the current and the next token for every evaluation, because future knowledge is crucial during evaluation. E.g: currentToken is 6 nextToken could be a semi-colon or the beginning of an arithmetic operation
func (*Parser) ParseProgram ¶
func (p *Parser) ParseProgram() *syntaxtree.Program
ParseProgram performs recursive descent parsing (aka Pratt parsing)
Click to show internal directories.
Click to hide internal directories.