22 #ifndef DIRECTOR_LINGO_LINGO_AST_H 23 #define DIRECTOR_LINGO_LINGO_AST_H 40 struct IfElseStmtNode;
41 struct RepeatWhileNode;
42 struct RepeatWithToNode;
43 struct RepeatWithInNode;
44 struct NextRepeatNode;
45 struct ExitRepeatNode;
52 struct AssertErrorNode;
67 struct IntersectsNode;
71 struct TheNumberOfNode;
73 struct TheDateTimeNode;
83 typedef void (*inst)(void);
87 for (uint i = 0; i < list->
size(); i++) {
165 virtual bool visitScriptNode(
ScriptNode *node) = 0;
166 virtual bool visitFactoryNode(
FactoryNode *node) = 0;
167 virtual bool visitHandlerNode(
HandlerNode *node) = 0;
168 virtual bool visitCmdNode(
CmdNode *node) = 0;
169 virtual bool visitPutIntoNode(
PutIntoNode *node) = 0;
172 virtual bool visitSetNode(
SetNode *node) = 0;
173 virtual bool visitGlobalNode(
GlobalNode *node) = 0;
176 virtual bool visitIfStmtNode(
IfStmtNode *node) = 0;
183 virtual bool visitExitNode(
ExitNode *node) = 0;
184 virtual bool visitReturnNode(
ReturnNode *node) = 0;
185 virtual bool visitTellNode(
TellNode *node) = 0;
186 virtual bool visitWhenNode(
WhenNode *node) = 0;
187 virtual bool visitDeleteNode(
DeleteNode *node) = 0;
188 virtual bool visitHiliteNode(
HiliteNode *node) = 0;
190 virtual bool visitIntNode(
IntNode *node) = 0;
191 virtual bool visitFloatNode(
FloatNode *node) = 0;
192 virtual bool visitSymbolNode(
SymbolNode *node) = 0;
193 virtual bool visitStringNode(
StringNode *node) = 0;
194 virtual bool visitListNode(
ListNode *node) = 0;
197 virtual bool visitFuncNode(
FuncNode *node) = 0;
198 virtual bool visitVarNode(
VarNode *node) = 0;
199 virtual bool visitParensNode(
ParensNode *node) = 0;
200 virtual bool visitUnaryOpNode(
UnaryOpNode *node) = 0;
202 virtual bool visitFrameNode(
FrameNode *node) = 0;
203 virtual bool visitMovieNode(
MovieNode *node) = 0;
205 virtual bool visitWithinNode(
WithinNode *node) = 0;
206 virtual bool visitTheNode(
TheNode *node) = 0;
207 virtual bool visitTheOfNode(
TheOfNode *node) = 0;
209 virtual bool visitTheLastNode(
TheLastNode *node) = 0;
211 virtual bool visitMenuNode(
MenuNode *node) = 0;
213 virtual bool visitSoundNode(
SoundNode *node) = 0;
214 virtual bool visitSpriteNode(
SpriteNode *node) = 0;
228 Node(NodeType t) : type(t), isExpression(
false), isStatement(
false), isLoop(
false), startOffset(0), endOffset(0) {}
268 ScriptNode(NodeList *childrenIn):
Node(kScriptNode), children(childrenIn) {}
270 deleteList(children);
273 return visitor->visitScriptNode(
this);
284 :
Node(kFactoryNode), name(nameIn), methods(methodsIn) {}
290 return visitor->visitFactoryNode(
this);
302 :
Node(kHandlerNode), name(nameIn), args(argsIn), stmts(stmtsIn) {}
309 return visitor->visitHandlerNode(
this);
321 :
StmtNode(kCmdNode), name(nameIn), args(argsIn), lineNumber(lineNumberIn) {}
327 return visitor->visitCmdNode(
this);
338 :
StmtNode(kPutIntoNode), val(valIn), var(varIn) {}
344 return visitor->visitPutIntoNode(
this);
355 :
StmtNode(kPutAfterNode), val(valIn), var(varIn) {}
361 return visitor->visitPutAfterNode(
this);
372 :
StmtNode(kPutBeforeNode), val(valIn), var(varIn) {}
378 return visitor->visitPutBeforeNode(
this);
389 :
StmtNode(kSetNode), var(varIn), val(valIn) {}
395 return visitor->visitSetNode(
this);
409 return visitor->visitGlobalNode(
this);
423 return visitor->visitPropertyNode(
this);
437 return visitor->visitInstanceNode(
this);
448 :
StmtNode(kIfStmtNode), cond(condIn), stmts(stmtsIn) {}
454 return visitor->visitIfStmtNode(
this);
466 :
StmtNode(kIfElseStmtNode), cond(condIn), stmts1(stmts1In), stmts2(stmts2In) {}
473 return visitor->visitIfElseStmtNode(
this);
484 :
LoopNode(kRepeatWhileNode), cond(condIn), stmts(stmtsIn) {}
490 return visitor->visitRepeatWhileNode(
this);
504 :
LoopNode(kRepeatWithToNode), var(varIn), start(startIn), down(downIn), end(endIn), stmts(stmtsIn) {}
512 return visitor->visitRepeatWithToNode(
this);
524 :
LoopNode(kRepeatWithInNode), var(varIn), list(listIn), stmts(stmtsIn) {}
531 return visitor->visitRepeatWithInNode(
this);
541 return visitor->visitNextRepeatNode(
this);
551 return visitor->visitExitRepeatNode(
this);
561 return visitor->visitExitNode(
this);
575 return visitor->visitReturnNode(
this);
587 :
StmtNode(kTellNode), target(targetIn), stmts(stmtsIn) {}
593 return visitor->visitTellNode(
this);
604 :
StmtNode(kWhenNode), event(eventIn), code(codeIn) {}
610 return visitor->visitWhenNode(
this);
624 return visitor->visitDeleteNode(
this);
638 return visitor->visitHiliteNode(
this);
652 return visitor->visitAssertErrorNode(
this);
664 return visitor->visitIntNode(
this);
676 return visitor->visitFloatNode(
this);
690 return visitor->visitSymbolNode(
this);
704 return visitor->visitStringNode(
this);
718 return visitor->visitListNode(
this);
732 return visitor->visitPropListNode(
this);
743 :
ExprNode(kPropPairNode), key(keyIn), val(valIn) {}
749 return visitor->visitPropPairNode(
this);
760 :
ExprNode(kFuncNode), name(nameIn), args(argsIn) {}
766 return visitor->visitFuncNode(
this);
780 return visitor->visitVarNode(
this);
794 return visitor->visitParensNode(
this);
809 return visitor->visitUnaryOpNode(
this);
826 return visitor->visitBinaryOpNode(
this);
840 return visitor->visitFrameNode(
this);
854 return visitor->visitMovieNode(
this);
865 :
ExprNode(kIntersectsNode), sprite1(sprite1In), sprite2(sprite2In) {}
871 return visitor->visitIntersectsNode(
this);
882 :
ExprNode(kWithinNode), sprite1(sprite1In), sprite2(sprite2In) {}
888 return visitor->visitWithinNode(
this);
902 return visitor->visitTheNode(
this);
913 :
ExprNode(kTheOfNode), prop(propIn), obj(objIn) {}
919 return visitor->visitTheOfNode(
this);
930 :
ExprNode(kTheNumberOfNode), type(typeIn), arg(argIn) {}
935 return visitor->visitTheNumberOfNode(
this);
946 :
ExprNode(kTheLastNode), type(typeIn), arg(argIn) {}
951 return visitor->visitTheLastNode(
this);
962 :
ExprNode(kTheDateTimeNode), field(fieldIn), entity(entityIn) {}
965 return visitor->visitTheDateTimeNode(
this);
979 return visitor->visitMenuNode(
this);
990 :
ExprNode(kMenuItemNode), arg1(arg1In), arg2(arg2In) {}
996 return visitor->visitMenuItemNode(
this);
1010 return visitor->visitSoundNode(
this);
1024 return visitor->visitSpriteNode(
this);
1037 :
ExprNode(kChunkExprNode), type(typeIn), start(startIn), end(endIn), src(srcIn) {}
1044 return visitor->visitChunkExprNode(
this);
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
Definition: lingo-ast.h:682
Definition: lingo-ast.h:860
Definition: lingo-ast.h:401
Definition: lingo-ast.h:235
Definition: lingo-ast.h:670
Definition: lingo-ast.h:696
Definition: lingo-ast.h:350
Definition: lingo-ast.h:1030
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:244
Definition: lingo-ast.h:557
Definition: lingo-ast.h:957
Definition: lingo-ast.h:220
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: lobject.h:332
Definition: lingo-ast.h:253
Definition: lingo-ast.h:630
Definition: lingo-ast.h:537
Definition: lingo-ast.h:384
Definition: lingo-ast.h:429
Definition: lingo-ast.h:599
Definition: lingo-ast.h:415