|
picceler
|
The Parser class that converts tokens into an AST. More...
#include <parser.h>
Public Member Functions | |
| Parser () | |
| Constructs a Parser. | |
| Result< void > | setSource (const std::string &source) |
| Sets the source file for the parser. | |
| Result< std::vector< Token > > | getTokens () |
| Retrieves all tokens from the lexer. | |
| Result< std::unique_ptr< ModuleNode > > | parse () |
| Parses the tokens into an AST. | |
| void | printAST (const std::unique_ptr< ModuleNode > &node, int indent=0) |
| Prints the AST in a human-readable format. | |
The Parser class that converts tokens into an AST.
| Parser::Parser | ( | ) |
Constructs a Parser.
Retrieves all tokens from the lexer.
| Result< std::unique_ptr< ModuleNode > > Parser::parse | ( | ) |
Parses the tokens into an AST.
| void Parser::printAST | ( | const std::unique_ptr< ModuleNode > & | node, |
| int | indent = 0 ) |
Prints the AST in a human-readable format.
| node | The root of the AST. |
| indent | The current indentation level (used for formatting) (not working currently). |
| Result< void > Parser::setSource | ( | const std::string & | source | ) |
Sets the source file for the parser.
| source | The source file to read from. |