Brain  1.0.0
A fast esoteric language!
ShiftExpr.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 SHIFT_EXPR_H
9 #define SHIFT_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 ShiftExpr : public Expr
22 {
23 protected:
25  int _step;
26 public:
27  ShiftExpr(int step) : _step(step) {}
28  ~ShiftExpr() {}
36  void code_gen(llvm::Module *M, llvm::IRBuilder<> &B,
37  llvm::BasicBlock *BreakBB);
44  void debug_description(int level);
49  void ast_code_gen();
54  bool update_expression(char update);
55 };
56 
57 #endif // SHIFT_EXPR_H
Abstract class in which all expressions in Brain implement from.
Definition: Expr.h:62
void ast_code_gen()
Method for the reverse code generation from the AST. It prints out to the stdout the token itself...
Definition: ShiftExpr.cpp:43
void debug_description(int level)
Prints debug information when Brain&#39;s compiler has the active flags: -v | -emit-ast.
Definition: ShiftExpr.cpp:24
Class that represents the shift operator in Brain.
Definition: ShiftExpr.h:21
bool update_expression(char update)
Virtual method for updating the AST exprs.
Definition: ShiftExpr.cpp: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: ShiftExpr.cpp:10