Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathcompiler.py
More file actions
Latest commit
84 lines (63 loc) · 2.56 KB
/
Copy pathcompiler.py
File metadata and controls
84 lines (63 loc) · 2.56 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
importast
fromastimport*
fromutilsimport*
fromx86_astimport*
importos
fromtypingimportList, Tuple, Set, Dict
Binding=Tuple[Name, expr]
Temporaries=List[Binding]
classCompiler:
############################################################################
# Remove Complex Operands
############################################################################
defrco_exp(self, e: expr, need_atomic : bool) ->Tuple[expr, Temporaries]:
# YOUR CODE HERE
pass
defrco_stmt(self, s: stmt) ->List[stmt]:
# YOUR CODE HERE
pass
defremove_complex_operands(self, p: Module) ->Module:
# YOUR CODE HERE
pass
############################################################################
# Select Instructions
############################################################################
# The expression e passed to select_arg should furthermore be an atom.
# (But there is no type for atoms, so the type of e is given as expr.)
defselect_arg(self, e: expr) ->arg:
# YOUR CODE HERE
pass
defselect_stmt(self, s: stmt) ->List[instr]:
# YOUR CODE HERE
pass
defselect_instructions(self, p: Module) ->X86Program:
# YOUR CODE HERE
pass
############################################################################
# Assign Homes
############################################################################
defassign_homes_arg(self, a: arg, home: Dict[Variable, arg]) ->arg:
# YOUR CODE HERE
pass
defassign_homes_instr(self, i: instr,
home: Dict[Variable, arg]) ->instr:
# YOUR CODE HERE
pass
defassign_homes(self, p: X86Program) ->X86Program:
# YOUR CODE HERE
pass
############################################################################
# Patch Instructions
############################################################################
defpatch_instr(self, i: instr) ->List[instr]:
# YOUR CODE HERE
pass
defpatch_instructions(self, p: X86Program) ->X86Program:
# YOUR CODE HERE
pass
############################################################################
# Prelude & Conclusion
############################################################################
defprelude_and_conclusion(self, p: X86Program) ->X86Program:
# YOUR CODE HERE
pass