22 #ifndef DIRECTOR_LINGO_LINGO_CODEGEN_H 23 #define DIRECTOR_LINGO_LINGO_CODEGEN_H 25 #include "director/lingo/lingo.h" 26 #include "director/lingo/lingo-ast.h" 39 int code1(inst code) { _currentAssembly->
push_back(code);
return _currentAssembly->
size() - 1; }
40 int code2(inst code_1, inst code_2) {
int o = code1(code_1); code1(code_2);
return o; }
41 int code3(inst code_1, inst code_2, inst code_3) {
int o = code1(code_1); code1(code_2); code1(code_3);
return o; }
42 int code4(inst code_1, inst code_2, inst code_3, inst code_4) {
int o = code1(code_1); code1(code_2); code1(code_3); code1(code_4);
return o; }
44 int codeFloat(
double f);
47 int codeString(
const char *s);
51 int getTheFieldID(
int entity,
const Common::String &field,
bool silent =
false);
53 void registerMethodVar(
const Common::String &name, VarType type = kVarGeneric);
54 void updateLoopJumps(uint nextTargetPos, uint exitTargetPos);
65 const char *_lines[3];
75 virtual bool visitScriptNode(
ScriptNode *node);
78 virtual bool visitCmdNode(
CmdNode *node);
82 virtual bool visitSetNode(
SetNode *node);
83 virtual bool visitGlobalNode(
GlobalNode *node);
86 virtual bool visitIfStmtNode(
IfStmtNode *node);
93 virtual bool visitExitNode(
ExitNode *node);
94 virtual bool visitReturnNode(
ReturnNode *node);
95 virtual bool visitTellNode(
TellNode *node);
96 virtual bool visitWhenNode(
WhenNode *node);
97 virtual bool visitDeleteNode(
DeleteNode *node);
98 virtual bool visitHiliteNode(
HiliteNode *node);
100 virtual bool visitIntNode(
IntNode *node);
101 virtual bool visitFloatNode(
FloatNode *node);
102 virtual bool visitSymbolNode(
SymbolNode *node);
103 virtual bool visitStringNode(
StringNode *node);
104 virtual bool visitListNode(
ListNode *node);
107 virtual bool visitFuncNode(
FuncNode *node);
108 virtual bool visitVarNode(
VarNode *node);
109 virtual bool visitParensNode(
ParensNode *node);
112 virtual bool visitFrameNode(
FrameNode *node);
113 virtual bool visitMovieNode(
MovieNode *node);
115 virtual bool visitWithinNode(
WithinNode *node);
116 virtual bool visitTheNode(
TheNode *node);
117 virtual bool visitTheOfNode(
TheOfNode *node);
121 virtual bool visitMenuNode(
MenuNode *node);
123 virtual bool visitSoundNode(
SoundNode *node);
124 virtual bool visitSpriteNode(
SpriteNode *node);
128 int parse(
const char *code);
Definition: lingo-ast.h:755
Definition: lingo-ast.h:800
Definition: lingo-ast.h:710
Definition: lingo-ast.h:815
Definition: lingo-ast.h:567
Definition: lingo-ast.h:518
Definition: lingo-ast.h:443
Definition: lingo-ast.h:460
Definition: lingo-ast.h:738
Definition: lingo-ast.h:941
Definition: lingo-ast.h:925
Definition: lingo-ast.h:786
Definition: lingo-ast.h:1016
Definition: lingo-ast.h:315
Definition: lingo-ast.h:160
Definition: lingo-ast.h:296
Definition: lingo-ast.h:1002
Definition: lingo-ast.h:644
Definition: lingo-ast.h:724
Definition: lingo-ast.h:279
Definition: lingo-ast.h:547
Definition: lingo-ast.h:333
Definition: lingo-ast.h:894
void push_back(const T &element)
Definition: array.h:180
Definition: lingo-ast.h:682
Definition: lingo-ast.h:860
Definition: lingo-ast.h:401
Definition: lingo-ast.h:670
Definition: lingo-ast.h:696
Definition: lingo-ast.h:350
Definition: lingo-ast.h:1030
Definition: lingo-codegen.h:30
Definition: lingo-ast.h:496
Definition: lingo-ast.h:265
Definition: lingo-ast.h:832
size_type size() const
Definition: array.h:315
Definition: lingo-ast.h:582
Definition: lingo-ast.h:616
Definition: lingo-ast.h:772
Definition: lingo-ast.h:557
Definition: lingo-ast.h:957
Definition: lingo-ast.h:877
Definition: lingo-ast.h:908
Definition: lingo-ast.h:479
Definition: lingo-ast.h:846
Definition: lingo-ast.h:367
Definition: lingo-ast.h:658
Definition: lingo-ast.h:253
Definition: lingo-ast.h:630
Definition: lingo-ast.h:537
Definition: lingo-ast.h:384
Definition: lingo-object.h:213
Definition: lingo-ast.h:429
Definition: lingo-ast.h:599
Definition: lingo-ast.h:415