The parser of the Brain language, it interpretes *.b, *.br or *.brain files.
More...
#include <Parser.h>
|
| Parser (std::string source) |
| Calls parse to create all expressions found in the source code. More...
|
|
void | code_gen (llvm::Module *M, llvm::IRBuilder<> &B) |
| Generates the IR (Intermediate Representation) code to be executed by llvm. More...
|
|
void | debug_description (int level) |
| Prints debug information when Brain's compiler has the active flags: -v | -emit-ast. More...
|
|
void | ast_code_gen () |
| Method for the reverse code generation from the AST. It prints out to the stdout the token itself.
|
|
|
void | parse (std::vector< Expr * > &exprs, int level) |
| It parses the Brain code. More...
|
|
|
std::string | _data |
| The content of the source file passed to Brain.
|
|
int | _index |
| Variable that holds the current index read by the parser.
|
|
std::vector< Expr * > | _exprs |
|
The parser of the Brain language, it interpretes *.b, *.br or *.brain files.
Parser::Parser |
( |
std::string |
source | ) |
|
|
inlineexplicit |
Calls parse to create all expressions found in the source code.
- Parameters
-
source | The source file as a string of characters. interpreter |
void Parser::code_gen |
( |
llvm::Module * |
M, |
|
|
llvm::IRBuilder<> & |
B |
|
) |
| |
Generates the IR (Intermediate Representation) code to be executed by llvm.
- Parameters
-
M | A pointer to the Brain's module. |
B | A reference to the Brain's IR builder. |
void Parser::debug_description |
( |
int |
level | ) |
|
Prints debug information when Brain's compiler has the active flags: -v | -emit-ast.
- Parameters
-
level | The width used to display the debug information (to mimic identation). |
void Parser::parse |
( |
std::vector< Expr * > & |
exprs, |
|
|
int |
level |
|
) |
| |
|
protected |
It parses the Brain code.
- Parameters
-
exprs | The vector of expressions read by the constructor |
level | |
std::vector<Expr *> Parser::_exprs |
|
protected |
Store pointers of expressions to later call code_gen on each one of them.
The documentation for this class was generated from the following files:
- src/parser/Parser.h
- src/parser/Parser.cpp