Brain  1.0.0
A fast esoteric language!
IncrementExpr.h
1 /* This is the source code of Brain Programming Language.
2  * It is licensed under GNU GPL v. 3 or later.
3  * You should have received a copy of the license in this archive (see LICENSE).
4  *
5  * Copyright Brain, 2016.
6  */
7 
8 #ifndef INCREMENT_EXPR_H
9 #define INCREMENT_EXPR_H
10 
11 #include <llvm/IR/IRBuilder.h>
12 #include <llvm/IR/Module.h>
13 
14 #include <iostream>
15 
16 #include "Expr.h"
17 
21 class IncrementExpr : public Expr
22 {
23 protected:
24  int _increment;
25 public:
26  explicit IncrementExpr(int increment) : _increment(increment) { }
27  ~IncrementExpr() { }
35  void code_gen(llvm::Module *M, llvm::IRBuilder<> &B,
36  llvm::BasicBlock *BreakBB);
43  void debug_description(int level);
48  void ast_code_gen();
53  bool update_expression(char update);
54 };
55 
56 #endif // INCREMENT_EXPR_H
Abstract class in which all expressions in Brain implement from.
Definition: Expr.h:62
void code_gen(llvm::Module *M, llvm::IRBuilder<> &B, llvm::BasicBlock *BreakBB)
Generates the IR (Intermediate Representation) code to be executed by llvm.
Definition: IncrementExpr.cpp:10
Class that represent the increment operator in Brain.
Definition: IncrementExpr.h:21
void debug_description(int level)
Prints debug information when Brain&#39;s compiler has the active flags: -v | -emit-ast.
Definition: IncrementExpr.cpp:27
void ast_code_gen()
Method for the reverse code generation from the AST. It prints out to the stdout the token itself...
Definition: IncrementExpr.cpp:46
bool update_expression(char update)
Virtual method for updating the AST exprs.
Definition: IncrementExpr.cpp:65