11 #include <llvm/IR/IRBuilder.h> 12 #include <llvm/IR/Module.h> 17 #include "../ast/general/ASTInfo.h" 18 #include "../ast/expr/Expr.h" 19 #include "../utils/ArgsOptions.h" 43 void parse(std::vector<Expr *> &exprs,
int level);
51 explicit Parser(std::string source) :
52 _data(source), _index(0) {
parse(_exprs, 0); }
59 void code_gen(llvm::Module *M, llvm::IRBuilder<> &B);
std::string _data
The content of the source file passed to Brain.
Definition: Parser.h:29
void ast_code_gen()
Method for the reverse code generation from the AST. It prints out to the stdout the token itself...
Definition: Parser.cpp:176
void code_gen(llvm::Module *M, llvm::IRBuilder<> &B)
Generates the IR (Intermediate Representation) code to be executed by llvm.
Definition: Parser.cpp:159
void parse(std::vector< Expr * > &exprs, int level)
It parses the Brain code.
Definition: Parser.cpp:23
The parser of the Brain language, it interpretes *.b, *.br or *.brain files.
Definition: Parser.h:25
Parser(std::string source)
Calls parse to create all expressions found in the source code.
Definition: Parser.h:51
std::vector< Expr * > _exprs
Definition: Parser.h:36
void debug_description(int level)
Prints debug information when Brain's compiler has the active flags: -v | -emit-ast.
Definition: Parser.cpp:168
int _index
Variable that holds the current index read by the parser.
Definition: Parser.h:31