annotate dmd/statement.h @ 1:c53b6e3fe49a trunk

[svn r5] Initial commit. Most things are very rough.
author lindquist
date Sat, 01 Sep 2007 21:43:27 +0200
parents
children 77cdca8c210f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
2 // Compiler implementation of the D programming language
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
3 // Copyright (c) 1999-2007 by Digital Mars
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
4 // All Rights Reserved
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
5 // written by Walter Bright
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
6 // http://www.digitalmars.com
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
7 // License for redistribution is by either the Artistic License
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
9 // See the included readme.txt for details.
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
10
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
11 #ifndef DMD_STATEMENT_H
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
12 #define DMD_STATEMENT_H
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
13
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
14 #ifdef __DMC__
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
15 #pragma once
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
16 #endif /* __DMC__ */
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
17
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
18 #include "root.h"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
19
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
20 #include "arraytypes.h"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
21 #include "dsymbol.h"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
22 #include "lexer.h"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
23
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
24 struct OutBuffer;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
25 struct Scope;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
26 struct Expression;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
27 struct LabelDsymbol;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
28 struct Identifier;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
29 struct IfStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
30 struct DeclarationStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
31 struct DefaultStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
32 struct VarDeclaration;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
33 struct Condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
34 struct Module;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
35 struct Token;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
36 struct InlineCostState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
37 struct InlineDoState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
38 struct InlineScanState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
39 struct ReturnStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
40 struct CompoundStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
41 struct Argument;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
42 struct StaticAssert;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
43 struct AsmStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
44 struct GotoStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
45 struct ScopeStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
46 struct TryCatchStatement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
47 struct HdrGenState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
48 struct InterState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
49
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
50 enum TOK;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
51
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
52 namespace llvm
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
53 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
54 class Value;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
55 }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
56
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
57 // Back end
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
58 struct IRState;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
59 struct Blockx;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
60 #if IN_GCC
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
61 union tree_node; typedef union tree_node block;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
62 union tree_node; typedef union tree_node elem;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
63 #else
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
64 struct block;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
65 struct elem;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
66 #endif
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
67 struct code;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
68
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
69 struct Statement : Object
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
70 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
71 Loc loc;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
72
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
73 Statement(Loc loc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
74 virtual Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
75
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
76 void print();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
77 char *toChars();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
78
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
79 void error(const char *format, ...);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
80 virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
81 virtual TryCatchStatement *isTryCatchStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
82 virtual GotoStatement *isGotoStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
83 virtual AsmStatement *isAsmStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
84 #ifdef _DH
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
85 int incontract;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
86 #endif
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
87 virtual ScopeStatement *isScopeStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
88 virtual Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
89 Statement *semanticScope(Scope *sc, Statement *sbreak, Statement *scontinue);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
90 virtual int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
91 virtual int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
92 virtual int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
93 virtual int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
94 virtual int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
95 virtual void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
96 virtual Statements *flatten(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
97 virtual Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
98
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
99 virtual int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
100 virtual Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
101 virtual Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
102
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
103 // Back end
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
104 virtual void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
105
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
106 // Avoid dynamic_cast
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
107 virtual DeclarationStatement *isDeclarationStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
108 virtual CompoundStatement *isCompoundStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
109 virtual ReturnStatement *isReturnStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
110 virtual IfStatement *isIfStatement() { return NULL; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
111 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
112
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
113 struct ExpStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
114 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
115 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
116
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
117 ExpStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
118 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
119 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
120 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
121 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
122 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
123
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
124 int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
125 Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
126 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
127
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
128 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
129 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
130
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
131 struct CompileStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
132 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
133 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
134
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
135 CompileStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
136 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
137 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
138 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
139 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
140
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
141 struct DeclarationStatement : ExpStatement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
142 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
143 // Doing declarations as an expression, rather than a statement,
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
144 // makes inlining functions much easier.
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
145
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
146 DeclarationStatement(Loc loc, Dsymbol *s);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
147 DeclarationStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
148 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
149 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
150 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
151
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
152 DeclarationStatement *isDeclarationStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
153 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
154
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
155 struct CompoundStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
156 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
157 Statements *statements;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
158
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
159 CompoundStatement(Loc loc, Statements *s);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
160 CompoundStatement(Loc loc, Statement *s1, Statement *s2);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
161 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
162 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
163 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
164 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
165 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
166 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
167 Statements *flatten(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
168 ReturnStatement *isReturnStatement();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
169 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
170
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
171 int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
172 Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
173 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
174
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
175 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
176
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
177 CompoundStatement *isCompoundStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
178 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
179
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
180 /* The purpose of this is so that continue will go to the next
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
181 * of the statements, and break will go to the end of the statements.
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
182 */
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
183 struct UnrolledLoopStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
184 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
185 Statements *statements;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
186
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
187 UnrolledLoopStatement(Loc loc, Statements *statements);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
188 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
189 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
190 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
191 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
192 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
193 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
194 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
195 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
196 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
197
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
198 int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
199 Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
200 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
201
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
202 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
203 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
204
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
205 struct ScopeStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
206 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
207 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
208
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
209 ScopeStatement(Loc loc, Statement *s);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
210 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
211 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
212 ScopeStatement *isScopeStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
213 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
214 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
215 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
216 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
217 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
218 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
219 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
220
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
221 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
222
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
223 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
224 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
225
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
226 struct WhileStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
227 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
228 Expression *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
229 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
230
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
231 WhileStatement(Loc loc, Expression *c, Statement *b);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
232 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
233 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
234 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
235 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
236 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
237 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
238 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
239 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
240 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
241
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
242 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
243
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
244 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
245 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
246
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
247 struct DoStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
248 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
249 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
250 Expression *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
251
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
252 DoStatement(Loc loc, Statement *b, Expression *c);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
253 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
254 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
255 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
256 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
257 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
258 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
259 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
260 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
261 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
262
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
263 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
264
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
265 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
266 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
267
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
268 struct ForStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
269 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
270 Statement *init;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
271 Expression *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
272 Expression *increment;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
273 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
274
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
275 ForStatement(Loc loc, Statement *init, Expression *condition, Expression *increment, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
276 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
277 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
278 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
279 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
280 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
281 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
282 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
283 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
284 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
285 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
286
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
287 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
288
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
289 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
290 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
291
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
292 struct ForeachStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
293 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
294 enum TOK op; // TOKforeach or TOKforeach_reverse
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
295 Arguments *arguments; // array of Argument*'s
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
296 Expression *aggr;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
297 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
298
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
299 VarDeclaration *key;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
300 VarDeclaration *value;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
301
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
302 FuncDeclaration *func; // function we're lexically in
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
303
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
304 Array cases; // put breaks, continues, gotos and returns here
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
305 Array gotos; // forward referenced goto's go here
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
306
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
307 ForeachStatement(Loc loc, enum TOK op, Arguments *arguments, Expression *aggr, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
308 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
309 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
310 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
311 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
312 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
313 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
314 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
315 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
316 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
317
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
318 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
319
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
320 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
321 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
322
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
323 struct IfStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
324 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
325 Argument *arg;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
326 Expression *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
327 Statement *ifbody;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
328 Statement *elsebody;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
329
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
330 VarDeclaration *match; // for MatchExpression results
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
331
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
332 IfStatement(Loc loc, Argument *arg, Expression *condition, Statement *ifbody, Statement *elsebody);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
333 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
334 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
335 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
336 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
337 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
338 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
339 IfStatement *isIfStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
340
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
341 int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
342 Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
343 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
344
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
345 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
346 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
347
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
348 struct ConditionalStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
349 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
350 Condition *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
351 Statement *ifbody;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
352 Statement *elsebody;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
353
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
354 ConditionalStatement(Loc loc, Condition *condition, Statement *ifbody, Statement *elsebody);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
355 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
356 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
357 Statements *flatten(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
358 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
359
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
360 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
361 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
362
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
363 struct PragmaStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
364 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
365 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
366 Expressions *args; // array of Expression's
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
367 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
368
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
369 PragmaStatement(Loc loc, Identifier *ident, Expressions *args, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
370 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
371 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
372 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
373 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
374
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
375 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
376 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
377
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
378 struct StaticAssertStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
379 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
380 StaticAssert *sa;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
381
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
382 StaticAssertStatement(StaticAssert *sa);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
383 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
384 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
385
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
386 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
387 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
388
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
389 struct SwitchStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
390 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
391 Expression *condition;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
392 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
393 DefaultStatement *sdefault;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
394
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
395 Array gotoCases; // array of unresolved GotoCaseStatement's
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
396 Array *cases; // array of CaseStatement's
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
397 int hasNoDefault; // !=0 if no default statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
398
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
399 SwitchStatement(Loc loc, Expression *c, Statement *b);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
400 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
401 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
402 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
403 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
404 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
405 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
406 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
407
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
408 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
409
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
410 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
411 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
412
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
413 struct CaseStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
414 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
415 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
416 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
417 int index; // which case it is (since we sort this)
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
418 block *cblock; // back end: label for the block
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
419
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
420 CaseStatement(Loc loc, Expression *exp, Statement *s);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
421 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
422 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
423 int compare(Object *obj);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
424 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
425 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
426 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
427 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
428 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
429
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
430 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
431
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
432 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
433 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
434
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
435 struct DefaultStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
436 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
437 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
438 #if IN_GCC
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
439 block *cblock; // back end: label for the block
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
440 #endif
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
441
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
442 DefaultStatement(Loc loc, Statement *s);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
443 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
444 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
445 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
446 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
447 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
448 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
449 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
450
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
451 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
452
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
453 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
454 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
455
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
456 struct GotoDefaultStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
457 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
458 SwitchStatement *sw;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
459
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
460 GotoDefaultStatement(Loc loc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
461 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
462 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
463 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
464 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
465 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
466
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
467 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
468 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
469
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
470 struct GotoCaseStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
471 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
472 Expression *exp; // NULL, or which case to goto
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
473 CaseStatement *cs; // case statement it resolves to
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
474
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
475 GotoCaseStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
476 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
477 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
478 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
479 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
480 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
481
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
482 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
483 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
484
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
485 struct SwitchErrorStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
486 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
487 SwitchErrorStatement(Loc loc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
488 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
489 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
490
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
491 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
492 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
493
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
494 struct ReturnStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
495 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
496 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
497
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
498 ReturnStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
499 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
500 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
501 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
502 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
503 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
504
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
505 int inlineCost(InlineCostState *ics);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
506 Expression *doInline(InlineDoState *ids);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
507 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
508
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
509 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
510
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
511 ReturnStatement *isReturnStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
512 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
513
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
514 struct BreakStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
515 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
516 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
517
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
518 BreakStatement(Loc loc, Identifier *ident);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
519 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
520 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
521 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
522 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
523 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
524
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
525 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
526 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
527
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
528 struct ContinueStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
529 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
530 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
531
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
532 ContinueStatement(Loc loc, Identifier *ident);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
533 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
534 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
535 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
536 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
537 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
538
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
539 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
540 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
541
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
542 struct SynchronizedStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
543 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
544 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
545 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
546
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
547 SynchronizedStatement(Loc loc, Expression *exp, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
548 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
549 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
550 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
551 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
552 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
553 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
554 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
555
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
556 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
557
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
558 // Back end
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
559 elem *esync;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
560 SynchronizedStatement(Loc loc, elem *esync, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
561 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
562 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
563
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
564 struct WithStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
565 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
566 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
567 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
568 VarDeclaration *wthis;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
569
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
570 WithStatement(Loc loc, Expression *exp, Statement *body);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
571 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
572 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
573 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
574 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
575 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
576
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
577 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
578
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
579 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
580 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
581
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
582 struct TryCatchStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
583 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
584 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
585 Array *catches;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
586
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
587 TryCatchStatement(Loc loc, Statement *body, Array *catches);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
588 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
589 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
590 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
591 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
592 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
593
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
594 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
595
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
596 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
597 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
598 TryCatchStatement *isTryCatchStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
599 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
600
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
601 struct Catch : Object
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
602 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
603 Loc loc;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
604 Type *type;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
605 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
606 VarDeclaration *var;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
607 Statement *handler;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
608
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
609 Catch(Loc loc, Type *t, Identifier *id, Statement *handler);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
610 Catch *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
611 void semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
612 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
613 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
614
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
615 struct TryFinallyStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
616 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
617 Statement *body;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
618 Statement *finalbody;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
619
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
620 TryFinallyStatement(Loc loc, Statement *body, Statement *finalbody);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
621 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
622 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
623 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
624 int hasBreak();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
625 int hasContinue();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
626 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
627 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
628
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
629 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
630
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
631 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
632 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
633
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
634 struct OnScopeStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
635 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
636 TOK tok;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
637 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
638
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
639 OnScopeStatement(Loc loc, TOK tok, Statement *statement);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
640 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
641 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
642 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
643 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
644 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
645
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
646 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
647 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
648
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
649 struct ThrowStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
650 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
651 Expression *exp;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
652
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
653 ThrowStatement(Loc loc, Expression *exp);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
654 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
655 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
656 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
657 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
658
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
659 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
660
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
661 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
662 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
663
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
664 struct VolatileStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
665 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
666 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
667
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
668 VolatileStatement(Loc loc, Statement *statement);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
669 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
670 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
671 Statements *flatten(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
672 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
673 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
674
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
675 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
676
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
677 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
678 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
679
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
680 struct GotoStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
681 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
682 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
683 LabelDsymbol *label;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
684 TryFinallyStatement *tf;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
685
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
686 GotoStatement(Loc loc, Identifier *ident);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
687 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
688 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
689 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
690 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
691
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
692 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
693 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
694 GotoStatement *isGotoStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
695 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
696
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
697 struct LabelStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
698 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
699 Identifier *ident;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
700 Statement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
701 TryFinallyStatement *tf;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
702 block *lblock; // back end
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
703 int isReturnLabel;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
704
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
705 LabelStatement(Loc loc, Identifier *ident, Statement *statement);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
706 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
707 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
708 Statements *flatten(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
709 int usesEH();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
710 int fallOffEnd();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
711 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
712 Expression *interpret(InterState *istate);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
713 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
714
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
715 Statement *inlineScan(InlineScanState *iss);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
716
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
717 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
718 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
719
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
720 struct LabelDsymbol : Dsymbol
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
721 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
722 LabelStatement *statement;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
723 #if IN_GCC
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
724 unsigned asmLabelNum; // GCC-specific
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
725 #endif
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
726
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
727 LabelDsymbol(Identifier *ident);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
728 LabelDsymbol *isLabel();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
729 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
730
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
731 struct AsmStatement : Statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
732 {
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
733 Token *tokens;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
734 code *asmcode;
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
735 unsigned asmalign; // alignment of this statement
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
736 unsigned refparam; // !=0 if function parameter is referenced
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
737 unsigned naked; // !=0 if function is to be naked
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
738 unsigned regs; // mask of registers modified
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
739
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
740 AsmStatement(Loc loc, Token *tokens);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
741 Statement *syntaxCopy();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
742 Statement *semantic(Scope *sc);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
743 int comeFrom();
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
744
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
745 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
746 virtual AsmStatement *isAsmStatement() { return this; }
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
747
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
748 void toIR(IRState *irs);
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
749 };
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
750
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
751 #endif /* DMD_STATEMENT_H */