Parser
Constants
outputs some debug information on current token
parser
Kind: global class Properties
Name | Type | Description |
lexer |
| current lexer instance |
ast |
| the AST factory instance |
token |
| current token |
extractDoc |
| should extract documentation as AST node |
extractTokens |
| should extract each token |
suppressErrors |
| should ignore parsing errors and continue |
debug |
| should output debug informations |
parser.getTokenName()
helper : gets a token name
Kind: instance method of parser
parser.parse()
main entry point : converts a source code to AST
Kind: instance method of parser
parser.raiseError()
Raise an error
Kind: instance method of parser
parser.error()
handling errors
Kind: instance method of parser
parser.node()
Creates a new AST node
Kind: instance method of parser
parser.expectEndOfStatement() ⇒ boolean
boolean
expects an end of statement or end of file
Kind: instance method of parser
parser.expect(token) ⇒ boolean
boolean
Force the parser to check the current token.
If the current token does not match to expected token, the an error will be raised.
If the suppressError mode is activated, then the error will be added to the program error stack and this function will return false
.
Kind: instance method of parser
Throws:
Error
Param | Type |
token |
|
parser.text() ⇒ String
String
Returns the current token contents
Kind: instance method of parser
parser.next()
consume the next token
Kind: instance method of parser
parser.lex()
Eating a token
Kind: instance method of parser
parser.is()
Check if token is of specified type
Constants
stance method of parser
oreStack"></a>
outputs some debug information on current tokenck debug information on current token </dl> Kind: global constant
API
Last updated