-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAstHandlerLinuxX86_64.hpp
More file actions
62 lines (53 loc) · 1.59 KB
/
Copy pathAstHandlerLinuxX86_64.hpp
File metadata and controls
62 lines (53 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <stdio.h>
#include <iostream>
#include "tree.hpp"
#include "compiler/registers/register_manager.hpp"
using namespace std;
namespace CODE_GENERATOR
{
namespace x86_64
{
void randomString(int size, char *output);
string *_to_reg_(int r, int offset);
string *_to_reg_(int r);
class AstHandlerLinuxX86_64 : public AstHandler
{
public:
AST CreatePrintNode(AST ex);
NODE *CreateStatementBlock();
void StatementBlockAdd(AST BS, AST S);
AST AssignmentNode(AST left, AST right);
NODE *FuncDeclNode(string *name);
AST FuncCall(AST f_node, bool);
AST ProcCall(AST f_node);
// void FuncCallAddArg(AST BS, AST S);
void SetValueAsReturnOfFunn(AST);
Obj *GetObjOfNode(NODE *n);
void SetObjOfNode(NODE *n, Obj *o);
//expre
AST BinOpNode(optypes op, AST left, AST right);
// Creates an AST for the binary operation "left op right"
AST VarNode(string *name);
// Creates an AST for a variable factor with specified name
AST DesfRefVarNode(AST name);
AST RefVarNode(AST name);
AST ConstNode(int value);
AST ConstFloatNode(float value);
AST ConstStringNode(string *value);
// Creates an AST for a constant factor with specified value
AST ReturnNode(AST toReturn);
AST ReturnNode();
AST EmptyNode();
// Creates an empty node
AST CreateIfNode(AST);
AST CreateIfElseNode(AST, AST);
/**
*
* Comienza la generacion de codigo a partir de el AST recolectado.
* FALTA ACOMODAR
*
*/
void GenerateCode(AST A, ExternSymbols *, StringLiterals *);
};
} // namespace x86_64
} // namespace CODE_GENERATOR