Revision 7
Added by Willibald K. over 8 years ago
ooaParser.java | ||
---|---|---|
1 |
// $ANTLR 3.4 C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g 2015-03-30 18:21:32 |
|
2 |
|
|
3 |
/* |
|
4 |
Ulysses OO-Action System Parser |
|
5 |
|
|
6 |
Copyright Graz University of Technology 2009 |
|
7 |
Copyright AIT Austrian Institute of Technology 2013 |
|
8 |
*/ |
|
9 |
package org.momut.ooas.parser; |
|
10 |
|
|
11 |
import org.momut.ooas.ast.expressions.*; |
|
12 |
import org.momut.ooas.ast.statements.*; |
|
13 |
import org.momut.ooas.ast.identifiers.*; |
|
14 |
import org.momut.ooas.ast.types.*; |
|
15 |
import org.momut.ooas.ast.types.FunctionType.FunctionTypeEnum; |
|
16 |
|
|
17 |
|
|
18 |
import org.antlr.runtime.*; |
|
19 |
import java.util.Stack; |
|
20 |
import java.util.List; |
|
21 |
import java.util.ArrayList; |
|
22 |
|
|
23 |
@SuppressWarnings({"all", "warnings", "unchecked"}) |
|
24 |
public class ooaParser extends ooaCustomParser { |
|
25 |
public static final String[] tokenNames = new String[] { |
|
26 |
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "FLOAT_OR_INT_OR_RANGE", "LINE_COMMENT", "T_ABORT", "T_ABS", "T_ACTIONS", "T_AND", "T_ASSIGNMENT", "T_AUTOCONS", "T_BAR", "T_BIIMPLIES", "T_BOOL", "T_BREAK", "T_CARD", "T_CBRL", "T_CBRR", "T_CHAR", "T_COLON", "T_COMMA", "T_COMMENT", "T_CONC", "T_CONSTS", "T_CONT", "T_CTRL", "T_DCONC", "T_DERIV", "T_DIFF", "T_DIGIT", "T_DINTER", "T_DIV", "T_DO", "T_DOM", "T_DOMRESBY", "T_DOMRESTO", "T_DUNION", "T_ELEMS", "T_ELSE", "T_END", "T_EQUAL", "T_EXISTS", "T_FALSE", "T_FLOAT", "T_FLOATNUMBER", "T_FOLDLR", "T_FOLDRL", "T_FORALL", "T_GREATER", "T_GREATEREQUAL", "T_HEAD", "T_IDENTIFIER", "T_IDIV", "T_IF", "T_IMPLIES", "T_IN", "T_INDS", "T_INFTY", "T_INT", "T_INTER", "T_INTNUMBER", "T_KILL", "T_LEN", "T_LESS", "T_LESSEQUAL", "T_LETTER", "T_LIST", "T_LPAREN", "T_LSQPAREN", "T_MAP", "T_MAPS", "T_MERGE", "T_METHODS", "T_MINUS", "T_MOD", "T_MUNION", "T_NEW", "T_NIL", "T_NONDET", "T_NOT", "T_NOTEQUAL", "T_OBS", "T_OD", "T_OF", "T_OR", "T_POINT", "T_POW", "T_PRIMED", "T_PRIO", "T_PROD", "T_QUANTITY", "T_RANGETO", "T_REQUIRES", "T_RNG", "T_RNGRESBY", "T_RNGRESTO", "T_RPAREN", "T_RSQPAREN", "T_SELF", "T_SEMICOLON", "T_SEQMOD_MAPOVERRIDE", "T_SET", "T_SKIP", "T_STATIC", "T_STRINGLITERAL", "T_SUBSET", "T_SUM", "T_SYSTEM", "T_TAIL", "T_THEN", "T_TO", "T_TRUE", "T_TYPES", "T_UNION", "T_VAR", "T_WITH", "T_WS", "'&'", "'::'", "']|'", "'as'", "'begin'", "'dec'", "'inc'", "'qval'", "'steady'", "'|['" |
|
27 |
}; |
|
28 |
|
|
29 |
public static final int EOF=-1; |
|
30 |
public static final int T__118=118; |
|
31 |
public static final int T__119=119; |
|
32 |
public static final int T__120=120; |
|
33 |
public static final int T__121=121; |
|
34 |
public static final int T__122=122; |
|
35 |
public static final int T__123=123; |
|
36 |
public static final int T__124=124; |
|
37 |
public static final int T__125=125; |
|
38 |
public static final int T__126=126; |
|
39 |
public static final int T__127=127; |
|
40 |
public static final int FLOAT_OR_INT_OR_RANGE=4; |
|
41 |
public static final int LINE_COMMENT=5; |
|
42 |
public static final int T_ABORT=6; |
|
43 |
public static final int T_ABS=7; |
|
44 |
public static final int T_ACTIONS=8; |
|
45 |
public static final int T_AND=9; |
|
46 |
public static final int T_ASSIGNMENT=10; |
|
47 |
public static final int T_AUTOCONS=11; |
|
48 |
public static final int T_BAR=12; |
|
49 |
public static final int T_BIIMPLIES=13; |
|
50 |
public static final int T_BOOL=14; |
|
51 |
public static final int T_BREAK=15; |
|
52 |
public static final int T_CARD=16; |
|
53 |
public static final int T_CBRL=17; |
|
54 |
public static final int T_CBRR=18; |
|
55 |
public static final int T_CHAR=19; |
|
56 |
public static final int T_COLON=20; |
|
57 |
public static final int T_COMMA=21; |
|
58 |
public static final int T_COMMENT=22; |
|
59 |
public static final int T_CONC=23; |
|
60 |
public static final int T_CONSTS=24; |
|
61 |
public static final int T_CONT=25; |
|
62 |
public static final int T_CTRL=26; |
|
63 |
public static final int T_DCONC=27; |
|
64 |
public static final int T_DERIV=28; |
|
65 |
public static final int T_DIFF=29; |
|
66 |
public static final int T_DIGIT=30; |
|
67 |
public static final int T_DINTER=31; |
|
68 |
public static final int T_DIV=32; |
|
69 |
public static final int T_DO=33; |
|
70 |
public static final int T_DOM=34; |
|
71 |
public static final int T_DOMRESBY=35; |
|
72 |
public static final int T_DOMRESTO=36; |
|
73 |
public static final int T_DUNION=37; |
|
74 |
public static final int T_ELEMS=38; |
|
75 |
public static final int T_ELSE=39; |
|
76 |
public static final int T_END=40; |
|
77 |
public static final int T_EQUAL=41; |
|
78 |
public static final int T_EXISTS=42; |
|
79 |
public static final int T_FALSE=43; |
|
80 |
public static final int T_FLOAT=44; |
|
81 |
public static final int T_FLOATNUMBER=45; |
|
82 |
public static final int T_FOLDLR=46; |
|
83 |
public static final int T_FOLDRL=47; |
|
84 |
public static final int T_FORALL=48; |
|
85 |
public static final int T_GREATER=49; |
|
86 |
public static final int T_GREATEREQUAL=50; |
|
87 |
public static final int T_HEAD=51; |
|
88 |
public static final int T_IDENTIFIER=52; |
|
89 |
public static final int T_IDIV=53; |
|
90 |
public static final int T_IF=54; |
|
91 |
public static final int T_IMPLIES=55; |
|
92 |
public static final int T_IN=56; |
|
93 |
public static final int T_INDS=57; |
|
94 |
public static final int T_INFTY=58; |
|
95 |
public static final int T_INT=59; |
|
96 |
public static final int T_INTER=60; |
|
97 |
public static final int T_INTNUMBER=61; |
|
98 |
public static final int T_KILL=62; |
|
99 |
public static final int T_LEN=63; |
|
100 |
public static final int T_LESS=64; |
|
101 |
public static final int T_LESSEQUAL=65; |
|
102 |
public static final int T_LETTER=66; |
|
103 |
public static final int T_LIST=67; |
|
104 |
public static final int T_LPAREN=68; |
|
105 |
public static final int T_LSQPAREN=69; |
|
106 |
public static final int T_MAP=70; |
|
107 |
public static final int T_MAPS=71; |
|
108 |
public static final int T_MERGE=72; |
|
109 |
public static final int T_METHODS=73; |
|
110 |
public static final int T_MINUS=74; |
|
111 |
public static final int T_MOD=75; |
|
112 |
public static final int T_MUNION=76; |
|
113 |
public static final int T_NEW=77; |
|
114 |
public static final int T_NIL=78; |
|
115 |
public static final int T_NONDET=79; |
|
116 |
public static final int T_NOT=80; |
|
117 |
public static final int T_NOTEQUAL=81; |
|
118 |
public static final int T_OBS=82; |
|
119 |
public static final int T_OD=83; |
|
120 |
public static final int T_OF=84; |
|
121 |
public static final int T_OR=85; |
|
122 |
public static final int T_POINT=86; |
|
123 |
public static final int T_POW=87; |
|
124 |
public static final int T_PRIMED=88; |
|
125 |
public static final int T_PRIO=89; |
|
126 |
public static final int T_PROD=90; |
|
127 |
public static final int T_QUANTITY=91; |
|
128 |
public static final int T_RANGETO=92; |
|
129 |
public static final int T_REQUIRES=93; |
|
130 |
public static final int T_RNG=94; |
|
131 |
public static final int T_RNGRESBY=95; |
|
132 |
public static final int T_RNGRESTO=96; |
|
133 |
public static final int T_RPAREN=97; |
|
134 |
public static final int T_RSQPAREN=98; |
|
135 |
public static final int T_SELF=99; |
|
136 |
public static final int T_SEMICOLON=100; |
|
137 |
public static final int T_SEQMOD_MAPOVERRIDE=101; |
|
138 |
public static final int T_SET=102; |
|
139 |
public static final int T_SKIP=103; |
|
140 |
public static final int T_STATIC=104; |
|
141 |
public static final int T_STRINGLITERAL=105; |
|
142 |
public static final int T_SUBSET=106; |
|
143 |
public static final int T_SUM=107; |
|
144 |
public static final int T_SYSTEM=108; |
|
145 |
public static final int T_TAIL=109; |
|
146 |
public static final int T_THEN=110; |
|
147 |
public static final int T_TO=111; |
|
148 |
public static final int T_TRUE=112; |
|
149 |
public static final int T_TYPES=113; |
|
150 |
public static final int T_UNION=114; |
|
151 |
public static final int T_VAR=115; |
|
152 |
public static final int T_WITH=116; |
|
153 |
public static final int T_WS=117; |
|
154 |
|
|
155 |
// delegates |
|
156 |
public ooaCustomParser[] getDelegates() { |
|
157 |
return new ooaCustomParser[] {}; |
|
158 |
} |
|
159 |
|
|
160 |
// delegators |
|
161 |
|
|
162 |
|
|
163 |
public ooaParser(TokenStream input) { |
|
164 |
this(input, new RecognizerSharedState()); |
|
165 |
} |
|
166 |
public ooaParser(TokenStream input, RecognizerSharedState state) { |
|
167 |
super(input, state); |
|
168 |
} |
|
169 |
|
|
170 |
public String[] getTokenNames() { return ooaParser.tokenNames; } |
|
171 |
public String getGrammarFileName() { return "C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g"; } |
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
// $ANTLR start "ooActionSystems" |
|
176 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:152:1: ooActionSystems : ( T_CONSTS namedConstList )? T_TYPES namedTypeList T_SYSTEM comp= asTypeComposition[null] ; |
|
177 |
public final void ooActionSystems() { |
|
178 |
IdentifierList comp =null; |
|
179 |
|
|
180 |
|
|
181 |
try { |
|
182 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:153:2: ( ( T_CONSTS namedConstList )? T_TYPES namedTypeList T_SYSTEM comp= asTypeComposition[null] ) |
|
183 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:153:4: ( T_CONSTS namedConstList )? T_TYPES namedTypeList T_SYSTEM comp= asTypeComposition[null] |
|
184 |
{ |
|
185 |
initializeTopLevelParserState(); |
|
186 |
|
|
187 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:155:11: ( T_CONSTS namedConstList )? |
|
188 |
int alt1=2; |
|
189 |
int LA1_0 = input.LA(1); |
|
190 |
|
|
191 |
if ( (LA1_0==T_CONSTS) ) { |
|
192 |
alt1=1; |
|
193 |
} |
|
194 |
switch (alt1) { |
|
195 |
case 1 : |
|
196 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:155:12: T_CONSTS namedConstList |
|
197 |
{ |
|
198 |
match(input,T_CONSTS,FOLLOW_T_CONSTS_in_ooActionSystems74); |
|
199 |
|
|
200 |
pushFollow(FOLLOW_namedConstList_in_ooActionSystems76); |
|
201 |
namedConstList(); |
|
202 |
|
|
203 |
state._fsp--; |
|
204 |
|
|
205 |
|
|
206 |
} |
|
207 |
break; |
|
208 |
|
|
209 |
} |
|
210 |
|
|
211 |
|
|
212 |
match(input,T_TYPES,FOLLOW_T_TYPES_in_ooActionSystems86); |
|
213 |
|
|
214 |
pushFollow(FOLLOW_namedTypeList_in_ooActionSystems94); |
|
215 |
namedTypeList(); |
|
216 |
|
|
217 |
state._fsp--; |
|
218 |
|
|
219 |
|
|
220 |
match(input,T_SYSTEM,FOLLOW_T_SYSTEM_in_ooActionSystems99); |
|
221 |
|
|
222 |
pushFollow(FOLLOW_asTypeComposition_in_ooActionSystems106); |
|
223 |
comp=asTypeComposition(null); |
|
224 |
|
|
225 |
state._fsp--; |
|
226 |
|
|
227 |
|
|
228 |
fixUpRun(comp); |
|
229 |
|
|
230 |
} |
|
231 |
|
|
232 |
} |
|
233 |
catch (RecognitionException re) { |
|
234 |
reportError(re); |
|
235 |
recover(input,re); |
|
236 |
} |
|
237 |
|
|
238 |
finally { |
|
239 |
// do for sure before leaving |
|
240 |
} |
|
241 |
return ; |
|
242 |
} |
|
243 |
// $ANTLR end "ooActionSystems" |
|
244 |
|
|
245 |
|
|
246 |
|
|
247 |
// $ANTLR start "namedConstList" |
|
248 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:170:1: namedConstList : namedConst ( T_SEMICOLON namedConst )* ; |
|
249 |
public final void namedConstList() throws RecognitionException { |
|
250 |
try { |
|
251 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:171:2: ( namedConst ( T_SEMICOLON namedConst )* ) |
|
252 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:171:4: namedConst ( T_SEMICOLON namedConst )* |
|
253 |
{ |
|
254 |
pushFollow(FOLLOW_namedConst_in_namedConstList129); |
|
255 |
namedConst(); |
|
256 |
|
|
257 |
state._fsp--; |
|
258 |
|
|
259 |
|
|
260 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:171:15: ( T_SEMICOLON namedConst )* |
|
261 |
loop2: |
|
262 |
do { |
|
263 |
int alt2=2; |
|
264 |
int LA2_0 = input.LA(1); |
|
265 |
|
|
266 |
if ( (LA2_0==T_SEMICOLON) ) { |
|
267 |
alt2=1; |
|
268 |
} |
|
269 |
|
|
270 |
|
|
271 |
switch (alt2) { |
|
272 |
case 1 : |
|
273 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:171:16: T_SEMICOLON namedConst |
|
274 |
{ |
|
275 |
match(input,T_SEMICOLON,FOLLOW_T_SEMICOLON_in_namedConstList132); |
|
276 |
|
|
277 |
pushFollow(FOLLOW_namedConst_in_namedConstList134); |
|
278 |
namedConst(); |
|
279 |
|
|
280 |
state._fsp--; |
|
281 |
|
|
282 |
|
|
283 |
} |
|
284 |
break; |
|
285 |
|
|
286 |
default : |
|
287 |
break loop2; |
|
288 |
} |
|
289 |
} while (true); |
|
290 |
|
|
291 |
|
|
292 |
} |
|
293 |
|
|
294 |
} |
|
295 |
catch (RecognitionException re) { |
|
296 |
reportError(re); |
|
297 |
recover(input,re); |
|
298 |
} |
|
299 |
|
|
300 |
finally { |
|
301 |
// do for sure before leaving |
|
302 |
} |
|
303 |
return ; |
|
304 |
} |
|
305 |
// $ANTLR end "namedConstList" |
|
306 |
|
|
307 |
|
|
308 |
|
|
309 |
// $ANTLR start "namedConst" |
|
310 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:174:1: namedConst : aName= T_IDENTIFIER T_EQUAL anExpr= expression ; |
|
311 |
public final void namedConst() throws RecognitionException { |
|
312 |
Token aName=null; |
|
313 |
Expression anExpr =null; |
|
314 |
|
|
315 |
|
|
316 |
try { |
|
317 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:175:2: (aName= T_IDENTIFIER T_EQUAL anExpr= expression ) |
|
318 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:175:4: aName= T_IDENTIFIER T_EQUAL anExpr= expression |
|
319 |
{ |
|
320 |
aName=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_namedConst150); |
|
321 |
|
|
322 |
match(input,T_EQUAL,FOLLOW_T_EQUAL_in_namedConst154); |
|
323 |
|
|
324 |
pushFollow(FOLLOW_expression_in_namedConst160); |
|
325 |
anExpr=expression(); |
|
326 |
|
|
327 |
state._fsp--; |
|
328 |
|
|
329 |
|
|
330 |
addNamedConst(aName,anExpr); |
|
331 |
|
|
332 |
} |
|
333 |
|
|
334 |
} |
|
335 |
catch (RecognitionException re) { |
|
336 |
reportError(re); |
|
337 |
recover(input,re); |
|
338 |
} |
|
339 |
|
|
340 |
finally { |
|
341 |
// do for sure before leaving |
|
342 |
} |
|
343 |
return ; |
|
344 |
} |
|
345 |
// $ANTLR end "namedConst" |
|
346 |
|
|
347 |
|
|
348 |
|
|
349 |
// $ANTLR start "namedTypeList" |
|
350 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:185:1: namedTypeList : namedType ( T_SEMICOLON namedType )* ; |
|
351 |
public final void namedTypeList() throws RecognitionException { |
|
352 |
try { |
|
353 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:186:2: ( namedType ( T_SEMICOLON namedType )* ) |
|
354 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:186:4: namedType ( T_SEMICOLON namedType )* |
|
355 |
{ |
|
356 |
pushFollow(FOLLOW_namedType_in_namedTypeList180); |
|
357 |
namedType(); |
|
358 |
|
|
359 |
state._fsp--; |
|
360 |
|
|
361 |
|
|
362 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:186:14: ( T_SEMICOLON namedType )* |
|
363 |
loop3: |
|
364 |
do { |
|
365 |
int alt3=2; |
|
366 |
int LA3_0 = input.LA(1); |
|
367 |
|
|
368 |
if ( (LA3_0==T_SEMICOLON) ) { |
|
369 |
alt3=1; |
|
370 |
} |
|
371 |
|
|
372 |
|
|
373 |
switch (alt3) { |
|
374 |
case 1 : |
|
375 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:186:15: T_SEMICOLON namedType |
|
376 |
{ |
|
377 |
match(input,T_SEMICOLON,FOLLOW_T_SEMICOLON_in_namedTypeList183); |
|
378 |
|
|
379 |
pushFollow(FOLLOW_namedType_in_namedTypeList185); |
|
380 |
namedType(); |
|
381 |
|
|
382 |
state._fsp--; |
|
383 |
|
|
384 |
|
|
385 |
} |
|
386 |
break; |
|
387 |
|
|
388 |
default : |
|
389 |
break loop3; |
|
390 |
} |
|
391 |
} while (true); |
|
392 |
|
|
393 |
|
|
394 |
} |
|
395 |
|
|
396 |
} |
|
397 |
catch (RecognitionException re) { |
|
398 |
reportError(re); |
|
399 |
recover(input,re); |
|
400 |
} |
|
401 |
|
|
402 |
finally { |
|
403 |
// do for sure before leaving |
|
404 |
} |
|
405 |
return ; |
|
406 |
} |
|
407 |
// $ANTLR end "namedTypeList" |
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
// $ANTLR start "namedType" |
|
412 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:189:1: namedType : aName= T_IDENTIFIER T_EQUAL (aType= complexType |anOoaType= ooActionSystem ) ; |
|
413 |
public final void namedType() throws RecognitionException { |
|
414 |
Token aName=null; |
|
415 |
UlyssesType aType =null; |
|
416 |
|
|
417 |
OoActionSystemType anOoaType =null; |
|
418 |
|
|
419 |
|
|
420 |
try { |
|
421 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:190:2: (aName= T_IDENTIFIER T_EQUAL (aType= complexType |anOoaType= ooActionSystem ) ) |
|
422 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:190:4: aName= T_IDENTIFIER T_EQUAL (aType= complexType |anOoaType= ooActionSystem ) |
|
423 |
{ |
|
424 |
aName=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_namedType201); |
|
425 |
|
|
426 |
match(input,T_EQUAL,FOLLOW_T_EQUAL_in_namedType206); |
|
427 |
|
|
428 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:192:3: (aType= complexType |anOoaType= ooActionSystem ) |
|
429 |
int alt4=2; |
|
430 |
int LA4_0 = input.LA(1); |
|
431 |
|
|
432 |
if ( (LA4_0==T_BOOL||LA4_0==T_CBRL||LA4_0==T_CHAR||LA4_0==T_FLOAT||LA4_0==T_IDENTIFIER||LA4_0==T_INT||(LA4_0 >= T_LIST && LA4_0 <= T_MAP)||LA4_0==T_QUANTITY) ) { |
|
433 |
alt4=1; |
|
434 |
} |
|
435 |
else if ( (LA4_0==T_AUTOCONS||LA4_0==T_SYSTEM) ) { |
|
436 |
alt4=2; |
|
437 |
} |
|
438 |
else { |
|
439 |
NoViableAltException nvae = |
|
440 |
new NoViableAltException("", 4, 0, input); |
|
441 |
|
|
442 |
throw nvae; |
|
443 |
|
|
444 |
} |
|
445 |
switch (alt4) { |
|
446 |
case 1 : |
|
447 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:193:4: aType= complexType |
|
448 |
{ |
|
449 |
pushFollow(FOLLOW_complexType_in_namedType218); |
|
450 |
aType=complexType(); |
|
451 |
|
|
452 |
state._fsp--; |
|
453 |
|
|
454 |
|
|
455 |
createNamedType(aName,aType); |
|
456 |
|
|
457 |
} |
|
458 |
break; |
|
459 |
case 2 : |
|
460 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:194:5: anOoaType= ooActionSystem |
|
461 |
{ |
|
462 |
pushFollow(FOLLOW_ooActionSystem_in_namedType230); |
|
463 |
anOoaType=ooActionSystem(); |
|
464 |
|
|
465 |
state._fsp--; |
|
466 |
|
|
467 |
|
|
468 |
createNamedType(aName,anOoaType); |
|
469 |
|
|
470 |
} |
|
471 |
break; |
|
472 |
|
|
473 |
} |
|
474 |
|
|
475 |
|
|
476 |
} |
|
477 |
|
|
478 |
} |
|
479 |
catch (RecognitionException re) { |
|
480 |
reportError(re); |
|
481 |
recover(input,re); |
|
482 |
} |
|
483 |
|
|
484 |
finally { |
|
485 |
// do for sure before leaving |
|
486 |
} |
|
487 |
return ; |
|
488 |
} |
|
489 |
// $ANTLR end "namedType" |
|
490 |
|
|
491 |
|
|
492 |
|
|
493 |
// $ANTLR start "asTypeComposition" |
|
494 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:200:1: asTypeComposition[IdentifierList top] returns [IdentifierList prioList] : asTypeCompositionParallel[prioList] ( T_PRIO asTypeCompositionParallel[prioList] )* ; |
|
495 |
public final IdentifierList asTypeComposition(IdentifierList top) throws RecognitionException { |
|
496 |
IdentifierList prioList = null; |
|
497 |
|
|
498 |
|
|
499 |
try { |
|
500 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:202:2: ( asTypeCompositionParallel[prioList] ( T_PRIO asTypeCompositionParallel[prioList] )* ) |
|
501 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:202:6: asTypeCompositionParallel[prioList] ( T_PRIO asTypeCompositionParallel[prioList] )* |
|
502 |
{ |
|
503 |
prioList = new PrioIdentifierList(top); |
|
504 |
|
|
505 |
pushFollow(FOLLOW_asTypeCompositionParallel_in_asTypeComposition266); |
|
506 |
asTypeCompositionParallel(prioList); |
|
507 |
|
|
508 |
state._fsp--; |
|
509 |
|
|
510 |
|
|
511 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:203:40: ( T_PRIO asTypeCompositionParallel[prioList] )* |
|
512 |
loop5: |
|
513 |
do { |
|
514 |
int alt5=2; |
|
515 |
int LA5_0 = input.LA(1); |
|
516 |
|
|
517 |
if ( (LA5_0==T_PRIO) ) { |
|
518 |
alt5=1; |
|
519 |
} |
|
520 |
|
|
521 |
|
|
522 |
switch (alt5) { |
|
523 |
case 1 : |
|
524 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:203:41: T_PRIO asTypeCompositionParallel[prioList] |
|
525 |
{ |
|
526 |
match(input,T_PRIO,FOLLOW_T_PRIO_in_asTypeComposition271); |
|
527 |
|
|
528 |
pushFollow(FOLLOW_asTypeCompositionParallel_in_asTypeComposition273); |
|
529 |
asTypeCompositionParallel(prioList); |
|
530 |
|
|
531 |
state._fsp--; |
|
532 |
|
|
533 |
|
|
534 |
} |
|
535 |
break; |
|
536 |
|
|
537 |
default : |
|
538 |
break loop5; |
|
539 |
} |
|
540 |
} while (true); |
|
541 |
|
|
542 |
|
|
543 |
} |
|
544 |
|
|
545 |
} |
|
546 |
catch (RecognitionException re) { |
|
547 |
reportError(re); |
|
548 |
recover(input,re); |
|
549 |
} |
|
550 |
|
|
551 |
finally { |
|
552 |
// do for sure before leaving |
|
553 |
} |
|
554 |
return prioList; |
|
555 |
} |
|
556 |
// $ANTLR end "asTypeComposition" |
|
557 |
|
|
558 |
|
|
559 |
|
|
560 |
// $ANTLR start "asTypeCompositionParallel" |
|
561 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:206:1: asTypeCompositionParallel[IdentifierList top] : asTypeCompositionSequential[parList] ( T_NONDET asTypeCompositionSequential[parList] )* ; |
|
562 |
public final void asTypeCompositionParallel(IdentifierList top) throws RecognitionException { |
|
563 |
try { |
|
564 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:207:2: ( asTypeCompositionSequential[parList] ( T_NONDET asTypeCompositionSequential[parList] )* ) |
|
565 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:207:6: asTypeCompositionSequential[parList] ( T_NONDET asTypeCompositionSequential[parList] )* |
|
566 |
{ |
|
567 |
IdentifierList parList = new NondetIdentifierList(top); |
|
568 |
|
|
569 |
pushFollow(FOLLOW_asTypeCompositionSequential_in_asTypeCompositionParallel296); |
|
570 |
asTypeCompositionSequential(parList); |
|
571 |
|
|
572 |
state._fsp--; |
|
573 |
|
|
574 |
|
|
575 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:208:40: ( T_NONDET asTypeCompositionSequential[parList] )* |
|
576 |
loop6: |
|
577 |
do { |
|
578 |
int alt6=2; |
|
579 |
int LA6_0 = input.LA(1); |
|
580 |
|
|
581 |
if ( (LA6_0==T_NONDET) ) { |
|
582 |
alt6=1; |
|
583 |
} |
|
584 |
|
|
585 |
|
|
586 |
switch (alt6) { |
|
587 |
case 1 : |
|
588 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:208:41: T_NONDET asTypeCompositionSequential[parList] |
|
589 |
{ |
|
590 |
match(input,T_NONDET,FOLLOW_T_NONDET_in_asTypeCompositionParallel300); |
|
591 |
|
|
592 |
pushFollow(FOLLOW_asTypeCompositionSequential_in_asTypeCompositionParallel302); |
|
593 |
asTypeCompositionSequential(parList); |
|
594 |
|
|
595 |
state._fsp--; |
|
596 |
|
|
597 |
|
|
598 |
} |
|
599 |
break; |
|
600 |
|
|
601 |
default : |
|
602 |
break loop6; |
|
603 |
} |
|
604 |
} while (true); |
|
605 |
|
|
606 |
|
|
607 |
} |
|
608 |
|
|
609 |
} |
|
610 |
catch (RecognitionException re) { |
|
611 |
reportError(re); |
|
612 |
recover(input,re); |
|
613 |
} |
|
614 |
|
|
615 |
finally { |
|
616 |
// do for sure before leaving |
|
617 |
} |
|
618 |
return ; |
|
619 |
} |
|
620 |
// $ANTLR end "asTypeCompositionParallel" |
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
// $ANTLR start "asTypeCompositionSequential" |
|
625 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:211:1: asTypeCompositionSequential[IdentifierList top] : asTypeCompositionBlockParen[seqList] ; |
|
626 |
public final void asTypeCompositionSequential(IdentifierList top) throws RecognitionException { |
|
627 |
try { |
|
628 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:212:2: ( asTypeCompositionBlockParen[seqList] ) |
|
629 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:212:6: asTypeCompositionBlockParen[seqList] |
|
630 |
{ |
|
631 |
IdentifierList seqList = new SeqIdentifierList(top); |
|
632 |
|
|
633 |
pushFollow(FOLLOW_asTypeCompositionBlockParen_in_asTypeCompositionSequential324); |
|
634 |
asTypeCompositionBlockParen(seqList); |
|
635 |
|
|
636 |
state._fsp--; |
|
637 |
|
|
638 |
|
|
639 |
} |
|
640 |
|
|
641 |
} |
|
642 |
catch (RecognitionException re) { |
|
643 |
reportError(re); |
|
644 |
recover(input,re); |
|
645 |
} |
|
646 |
|
|
647 |
finally { |
|
648 |
// do for sure before leaving |
|
649 |
} |
|
650 |
return ; |
|
651 |
} |
|
652 |
// $ANTLR end "asTypeCompositionSequential" |
|
653 |
|
|
654 |
|
|
655 |
|
|
656 |
// $ANTLR start "asTypeCompositionBlockParen" |
|
657 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:216:1: asTypeCompositionBlockParen[IdentifierList top] : ( T_LPAREN asTypeComposition[top] T_RPAREN |aName= T_IDENTIFIER ); |
|
658 |
public final void asTypeCompositionBlockParen(IdentifierList top) throws RecognitionException { |
|
659 |
Token aName=null; |
|
660 |
|
|
661 |
try { |
|
662 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:217:2: ( T_LPAREN asTypeComposition[top] T_RPAREN |aName= T_IDENTIFIER ) |
|
663 |
int alt7=2; |
|
664 |
int LA7_0 = input.LA(1); |
|
665 |
|
|
666 |
if ( (LA7_0==T_LPAREN) ) { |
|
667 |
alt7=1; |
|
668 |
} |
|
669 |
else if ( (LA7_0==T_IDENTIFIER) ) { |
|
670 |
alt7=2; |
|
671 |
} |
|
672 |
else { |
|
673 |
NoViableAltException nvae = |
|
674 |
new NoViableAltException("", 7, 0, input); |
|
675 |
|
|
676 |
throw nvae; |
|
677 |
|
|
678 |
} |
|
679 |
switch (alt7) { |
|
680 |
case 1 : |
|
681 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:217:4: T_LPAREN asTypeComposition[top] T_RPAREN |
|
682 |
{ |
|
683 |
match(input,T_LPAREN,FOLLOW_T_LPAREN_in_asTypeCompositionBlockParen339); |
|
684 |
|
|
685 |
pushFollow(FOLLOW_asTypeComposition_in_asTypeCompositionBlockParen341); |
|
686 |
asTypeComposition(top); |
|
687 |
|
|
688 |
state._fsp--; |
|
689 |
|
|
690 |
|
|
691 |
match(input,T_RPAREN,FOLLOW_T_RPAREN_in_asTypeCompositionBlockParen344); |
|
692 |
|
|
693 |
} |
|
694 |
break; |
|
695 |
case 2 : |
|
696 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:218:4: aName= T_IDENTIFIER |
|
697 |
{ |
|
698 |
aName=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_asTypeCompositionBlockParen351); |
|
699 |
|
|
700 |
addToIdentifierList(top,aName); |
|
701 |
|
|
702 |
} |
|
703 |
break; |
|
704 |
|
|
705 |
} |
|
706 |
} |
|
707 |
catch (RecognitionException re) { |
|
708 |
reportError(re); |
|
709 |
recover(input,re); |
|
710 |
} |
|
711 |
|
|
712 |
finally { |
|
713 |
// do for sure before leaving |
|
714 |
} |
|
715 |
return ; |
|
716 |
} |
|
717 |
// $ANTLR end "asTypeCompositionBlockParen" |
|
718 |
|
|
719 |
|
|
720 |
|
|
721 |
// $ANTLR start "complexType" |
|
722 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:226:1: complexType returns [UlyssesType aTypeSymbol] : ( T_LIST T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN T_OF innertype= complexType | T_LSQPAREN alistelem= T_IDENTIFIER ( T_COMMA otherlistelem= T_IDENTIFIER )* T_RSQPAREN | T_MAP ( T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN )? mapfromtype= simpleType T_TO maptotype= complexType | T_QUANTITY T_OF T_LSQPAREN (alandmark= T_IDENTIFIER |alandmark= T_MINUS T_INFTY ) ( T_COMMA (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) )* T_RSQPAREN | T_LPAREN aType= complexType ( T_COMMA anotherType= complexType )* T_RPAREN |r= simpleType ); |
|
723 |
public final UlyssesType complexType() throws RecognitionException { |
|
724 |
UlyssesType aTypeSymbol = null; |
|
725 |
|
|
726 |
|
|
727 |
Token numOfElements=null; |
|
728 |
Token alistelem=null; |
|
729 |
Token otherlistelem=null; |
|
730 |
Token alandmark=null; |
|
731 |
Token otherlandmark=null; |
|
732 |
UlyssesType innertype =null; |
|
733 |
|
|
734 |
UlyssesType mapfromtype =null; |
|
735 |
|
|
736 |
UlyssesType maptotype =null; |
|
737 |
|
|
738 |
UlyssesType aType =null; |
|
739 |
|
|
740 |
UlyssesType anotherType =null; |
|
741 |
|
|
742 |
UlyssesType r =null; |
|
743 |
|
|
744 |
|
|
745 |
|
|
746 |
aTypeSymbol = null; |
|
747 |
alandmark = null; |
|
748 |
|
|
749 |
try { |
|
750 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:232:2: ( T_LIST T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN T_OF innertype= complexType | T_LSQPAREN alistelem= T_IDENTIFIER ( T_COMMA otherlistelem= T_IDENTIFIER )* T_RSQPAREN | T_MAP ( T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN )? mapfromtype= simpleType T_TO maptotype= complexType | T_QUANTITY T_OF T_LSQPAREN (alandmark= T_IDENTIFIER |alandmark= T_MINUS T_INFTY ) ( T_COMMA (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) )* T_RSQPAREN | T_LPAREN aType= complexType ( T_COMMA anotherType= complexType )* T_RPAREN |r= simpleType ) |
|
751 |
int alt14=6; |
|
752 |
switch ( input.LA(1) ) { |
|
753 |
case T_LIST: |
|
754 |
{ |
|
755 |
alt14=1; |
|
756 |
} |
|
757 |
break; |
|
758 |
case T_LSQPAREN: |
|
759 |
{ |
|
760 |
alt14=2; |
|
761 |
} |
|
762 |
break; |
|
763 |
case T_MAP: |
|
764 |
{ |
|
765 |
alt14=3; |
|
766 |
} |
|
767 |
break; |
|
768 |
case T_QUANTITY: |
|
769 |
{ |
|
770 |
alt14=4; |
|
771 |
} |
|
772 |
break; |
|
773 |
case T_LPAREN: |
|
774 |
{ |
|
775 |
alt14=5; |
|
776 |
} |
|
777 |
break; |
|
778 |
case T_BOOL: |
|
779 |
case T_CBRL: |
|
780 |
case T_CHAR: |
|
781 |
case T_FLOAT: |
|
782 |
case T_IDENTIFIER: |
|
783 |
case T_INT: |
|
784 |
{ |
|
785 |
alt14=6; |
|
786 |
} |
|
787 |
break; |
|
788 |
default: |
|
789 |
NoViableAltException nvae = |
|
790 |
new NoViableAltException("", 14, 0, input); |
|
791 |
|
|
792 |
throw nvae; |
|
793 |
|
|
794 |
} |
|
795 |
|
|
796 |
switch (alt14) { |
|
797 |
case 1 : |
|
798 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:232:4: T_LIST T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN T_OF innertype= complexType |
|
799 |
{ |
|
800 |
match(input,T_LIST,FOLLOW_T_LIST_in_complexType382); |
|
801 |
|
|
802 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_complexType385); |
|
803 |
|
|
804 |
numOfElements=(Token)input.LT(1); |
|
805 |
|
|
806 |
if ( input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INTNUMBER ) { |
|
807 |
input.consume(); |
|
808 |
state.errorRecovery=false; |
|
809 |
} |
|
810 |
else { |
|
811 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
812 |
throw mse; |
|
813 |
} |
|
814 |
|
|
815 |
|
|
816 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_complexType395); |
|
817 |
|
|
818 |
match(input,T_OF,FOLLOW_T_OF_in_complexType397); |
|
819 |
|
|
820 |
pushFollow(FOLLOW_complexType_in_complexType402); |
|
821 |
innertype=complexType(); |
|
822 |
|
|
823 |
state._fsp--; |
|
824 |
|
|
825 |
|
|
826 |
aTypeSymbol = createListType(numOfElements,innertype); |
|
827 |
|
|
828 |
} |
|
829 |
break; |
|
830 |
case 2 : |
|
831 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:236:4: T_LSQPAREN alistelem= T_IDENTIFIER ( T_COMMA otherlistelem= T_IDENTIFIER )* T_RSQPAREN |
|
832 |
{ |
|
833 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_complexType417); |
|
834 |
|
|
835 |
alistelem=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_complexType421); |
|
836 |
|
|
837 |
aTypeSymbol = createListEnumType(alistelem); |
|
838 |
|
|
839 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:237:4: ( T_COMMA otherlistelem= T_IDENTIFIER )* |
|
840 |
loop8: |
|
841 |
do { |
|
842 |
int alt8=2; |
|
843 |
int LA8_0 = input.LA(1); |
|
844 |
|
|
845 |
if ( (LA8_0==T_COMMA) ) { |
|
846 |
alt8=1; |
|
847 |
} |
|
848 |
|
|
849 |
|
|
850 |
switch (alt8) { |
|
851 |
case 1 : |
|
852 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:237:5: T_COMMA otherlistelem= T_IDENTIFIER |
|
853 |
{ |
|
854 |
match(input,T_COMMA,FOLLOW_T_COMMA_in_complexType430); |
|
855 |
|
|
856 |
otherlistelem=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_complexType434); |
|
857 |
|
|
858 |
addToListEnumType(aTypeSymbol,otherlistelem); |
|
859 |
|
|
860 |
} |
|
861 |
break; |
|
862 |
|
|
863 |
default : |
|
864 |
break loop8; |
|
865 |
} |
|
866 |
} while (true); |
|
867 |
|
|
868 |
|
|
869 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_complexType440); |
|
870 |
|
|
871 |
} |
|
872 |
break; |
|
873 |
case 3 : |
|
874 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:240:4: T_MAP ( T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN )? mapfromtype= simpleType T_TO maptotype= complexType |
|
875 |
{ |
|
876 |
match(input,T_MAP,FOLLOW_T_MAP_in_complexType450); |
|
877 |
|
|
878 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:240:12: ( T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN )? |
|
879 |
int alt9=2; |
|
880 |
int LA9_0 = input.LA(1); |
|
881 |
|
|
882 |
if ( (LA9_0==T_LSQPAREN) ) { |
|
883 |
alt9=1; |
|
884 |
} |
|
885 |
switch (alt9) { |
|
886 |
case 1 : |
|
887 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:240:13: T_LSQPAREN numOfElements= ( T_INTNUMBER | T_IDENTIFIER ) T_RSQPAREN |
|
888 |
{ |
|
889 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_complexType455); |
|
890 |
|
|
891 |
numOfElements=(Token)input.LT(1); |
|
892 |
|
|
893 |
if ( input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INTNUMBER ) { |
|
894 |
input.consume(); |
|
895 |
state.errorRecovery=false; |
|
896 |
} |
|
897 |
else { |
|
898 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
899 |
throw mse; |
|
900 |
} |
|
901 |
|
|
902 |
|
|
903 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_complexType465); |
|
904 |
|
|
905 |
} |
|
906 |
break; |
|
907 |
|
|
908 |
} |
|
909 |
|
|
910 |
|
|
911 |
pushFollow(FOLLOW_simpleType_in_complexType471); |
|
912 |
mapfromtype=simpleType(); |
|
913 |
|
|
914 |
state._fsp--; |
|
915 |
|
|
916 |
|
|
917 |
match(input,T_TO,FOLLOW_T_TO_in_complexType473); |
|
918 |
|
|
919 |
pushFollow(FOLLOW_complexType_in_complexType477); |
|
920 |
maptotype=complexType(); |
|
921 |
|
|
922 |
state._fsp--; |
|
923 |
|
|
924 |
|
|
925 |
aTypeSymbol = createMapType(numOfElements,mapfromtype,maptotype); |
|
926 |
|
|
927 |
} |
|
928 |
break; |
|
929 |
case 4 : |
|
930 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:243:4: T_QUANTITY T_OF T_LSQPAREN (alandmark= T_IDENTIFIER |alandmark= T_MINUS T_INFTY ) ( T_COMMA (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) )* T_RSQPAREN |
|
931 |
{ |
|
932 |
match(input,T_QUANTITY,FOLLOW_T_QUANTITY_in_complexType491); |
|
933 |
|
|
934 |
match(input,T_OF,FOLLOW_T_OF_in_complexType493); |
|
935 |
|
|
936 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_complexType495); |
|
937 |
|
|
938 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:243:31: (alandmark= T_IDENTIFIER |alandmark= T_MINUS T_INFTY ) |
|
939 |
int alt10=2; |
|
940 |
int LA10_0 = input.LA(1); |
|
941 |
|
|
942 |
if ( (LA10_0==T_IDENTIFIER) ) { |
|
943 |
alt10=1; |
|
944 |
} |
|
945 |
else if ( (LA10_0==T_MINUS) ) { |
|
946 |
alt10=2; |
|
947 |
} |
|
948 |
else { |
|
949 |
NoViableAltException nvae = |
|
950 |
new NoViableAltException("", 10, 0, input); |
|
951 |
|
|
952 |
throw nvae; |
|
953 |
|
|
954 |
} |
|
955 |
switch (alt10) { |
|
956 |
case 1 : |
|
957 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:243:32: alandmark= T_IDENTIFIER |
|
958 |
{ |
|
959 |
alandmark=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_complexType500); |
|
960 |
|
|
961 |
} |
|
962 |
break; |
|
963 |
case 2 : |
|
964 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:243:56: alandmark= T_MINUS T_INFTY |
|
965 |
{ |
|
966 |
alandmark=(Token)match(input,T_MINUS,FOLLOW_T_MINUS_in_complexType505); |
|
967 |
|
|
968 |
match(input,T_INFTY,FOLLOW_T_INFTY_in_complexType507); |
|
969 |
|
|
970 |
} |
|
971 |
break; |
|
972 |
|
|
973 |
} |
|
974 |
|
|
975 |
|
|
976 |
aTypeSymbol = createQrType(alandmark); |
|
977 |
|
|
978 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:244:4: ( T_COMMA (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) )* |
|
979 |
loop12: |
|
980 |
do { |
|
981 |
int alt12=2; |
|
982 |
int LA12_0 = input.LA(1); |
|
983 |
|
|
984 |
if ( (LA12_0==T_COMMA) ) { |
|
985 |
alt12=1; |
|
986 |
} |
|
987 |
|
|
988 |
|
|
989 |
switch (alt12) { |
|
990 |
case 1 : |
|
991 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:244:5: T_COMMA (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) |
|
992 |
{ |
|
993 |
match(input,T_COMMA,FOLLOW_T_COMMA_in_complexType517); |
|
994 |
|
|
995 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:244:13: (otherlandmark= T_IDENTIFIER |otherlandmark= T_INFTY ) |
|
996 |
int alt11=2; |
|
997 |
int LA11_0 = input.LA(1); |
|
998 |
|
|
999 |
if ( (LA11_0==T_IDENTIFIER) ) { |
|
1000 |
alt11=1; |
|
1001 |
} |
|
1002 |
else if ( (LA11_0==T_INFTY) ) { |
|
1003 |
alt11=2; |
|
1004 |
} |
|
1005 |
else { |
|
1006 |
NoViableAltException nvae = |
|
1007 |
new NoViableAltException("", 11, 0, input); |
|
1008 |
|
|
1009 |
throw nvae; |
|
1010 |
|
|
1011 |
} |
|
1012 |
switch (alt11) { |
|
1013 |
case 1 : |
|
1014 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:244:14: otherlandmark= T_IDENTIFIER |
|
1015 |
{ |
|
1016 |
otherlandmark=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_complexType522); |
|
1017 |
|
|
1018 |
} |
|
1019 |
break; |
|
1020 |
case 2 : |
|
1021 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:244:41: otherlandmark= T_INFTY |
|
1022 |
{ |
|
1023 |
otherlandmark=(Token)match(input,T_INFTY,FOLLOW_T_INFTY_in_complexType526); |
|
1024 |
|
|
1025 |
} |
|
1026 |
break; |
|
1027 |
|
|
1028 |
} |
|
1029 |
|
|
1030 |
|
|
1031 |
addToQrType(aTypeSymbol,otherlandmark); |
|
1032 |
|
|
1033 |
} |
|
1034 |
break; |
|
1035 |
|
|
1036 |
default : |
|
1037 |
break loop12; |
|
1038 |
} |
|
1039 |
} while (true); |
|
1040 |
|
|
1041 |
|
|
1042 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_complexType533); |
|
1043 |
|
|
1044 |
} |
|
1045 |
break; |
|
1046 |
case 5 : |
|
1047 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:246:5: T_LPAREN aType= complexType ( T_COMMA anotherType= complexType )* T_RPAREN |
|
1048 |
{ |
|
1049 |
match(input,T_LPAREN,FOLLOW_T_LPAREN_in_complexType543); |
|
1050 |
|
|
1051 |
pushFollow(FOLLOW_complexType_in_complexType547); |
|
1052 |
aType=complexType(); |
|
1053 |
|
|
1054 |
state._fsp--; |
|
1055 |
|
|
1056 |
|
|
1057 |
aTypeSymbol = createTupleType(aType); |
|
1058 |
|
|
1059 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:247:4: ( T_COMMA anotherType= complexType )* |
|
1060 |
loop13: |
|
1061 |
do { |
|
1062 |
int alt13=2; |
|
1063 |
int LA13_0 = input.LA(1); |
|
1064 |
|
|
1065 |
if ( (LA13_0==T_COMMA) ) { |
|
1066 |
alt13=1; |
|
1067 |
} |
|
1068 |
|
|
1069 |
|
|
1070 |
switch (alt13) { |
|
1071 |
case 1 : |
|
1072 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:247:5: T_COMMA anotherType= complexType |
|
1073 |
{ |
|
1074 |
match(input,T_COMMA,FOLLOW_T_COMMA_in_complexType556); |
|
1075 |
|
|
1076 |
pushFollow(FOLLOW_complexType_in_complexType560); |
|
1077 |
anotherType=complexType(); |
|
1078 |
|
|
1079 |
state._fsp--; |
|
1080 |
|
|
1081 |
|
|
1082 |
addToTupleType(aTypeSymbol,anotherType); |
|
1083 |
|
|
1084 |
} |
|
1085 |
break; |
|
1086 |
|
|
1087 |
default : |
|
1088 |
break loop13; |
|
1089 |
} |
|
1090 |
} while (true); |
|
1091 |
|
|
1092 |
|
|
1093 |
match(input,T_RPAREN,FOLLOW_T_RPAREN_in_complexType567); |
|
1094 |
|
|
1095 |
} |
|
1096 |
break; |
|
1097 |
case 6 : |
|
1098 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:250:4: r= simpleType |
|
1099 |
{ |
|
1100 |
pushFollow(FOLLOW_simpleType_in_complexType580); |
|
1101 |
r=simpleType(); |
|
1102 |
|
|
1103 |
state._fsp--; |
|
1104 |
|
|
1105 |
|
|
1106 |
aTypeSymbol = r; |
|
1107 |
|
|
1108 |
} |
|
1109 |
break; |
|
1110 |
|
|
1111 |
} |
|
1112 |
} |
|
1113 |
catch (RecognitionException re) { |
|
1114 |
reportError(re); |
|
1115 |
recover(input,re); |
|
1116 |
} |
|
1117 |
|
|
1118 |
finally { |
|
1119 |
// do for sure before leaving |
|
1120 |
fixupComplexType(aTypeSymbol); |
|
1121 |
} |
|
1122 |
return aTypeSymbol; |
|
1123 |
} |
|
1124 |
// $ANTLR end "complexType" |
|
1125 |
|
|
1126 |
|
|
1127 |
|
|
1128 |
// $ANTLR start "simpleType" |
|
1129 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:256:1: simpleType returns [UlyssesType aTypeSymbol] : ( T_BOOL | T_INT T_LSQPAREN rangeLow= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN | T_FLOAT T_LSQPAREN rangeLow= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN | T_CHAR | T_CBRL aRangeValue= T_IDENTIFIER ( T_EQUAL optVal= T_INTNUMBER )? ( T_COMMA otherRangeValue= T_IDENTIFIER ( T_EQUAL otherOptVal= T_INTNUMBER )? )* T_CBRR |aType= T_IDENTIFIER ); |
|
1130 |
public final UlyssesType simpleType() throws RecognitionException { |
|
1131 |
UlyssesType aTypeSymbol = null; |
|
1132 |
|
|
1133 |
|
|
1134 |
Token rangeLow=null; |
|
1135 |
Token rangeHigh=null; |
|
1136 |
Token aRangeValue=null; |
|
1137 |
Token optVal=null; |
|
1138 |
Token otherRangeValue=null; |
|
1139 |
Token otherOptVal=null; |
|
1140 |
Token aType=null; |
|
1141 |
|
|
1142 |
|
|
1143 |
aTypeSymbol = null; |
|
1144 |
|
|
1145 |
try { |
|
1146 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:261:2: ( T_BOOL | T_INT T_LSQPAREN rangeLow= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN | T_FLOAT T_LSQPAREN rangeLow= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN | T_CHAR | T_CBRL aRangeValue= T_IDENTIFIER ( T_EQUAL optVal= T_INTNUMBER )? ( T_COMMA otherRangeValue= T_IDENTIFIER ( T_EQUAL otherOptVal= T_INTNUMBER )? )* T_CBRR |aType= T_IDENTIFIER ) |
|
1147 |
int alt18=6; |
|
1148 |
switch ( input.LA(1) ) { |
|
1149 |
case T_BOOL: |
|
1150 |
{ |
|
1151 |
alt18=1; |
|
1152 |
} |
|
1153 |
break; |
|
1154 |
case T_INT: |
|
1155 |
{ |
|
1156 |
alt18=2; |
|
1157 |
} |
|
1158 |
break; |
|
1159 |
case T_FLOAT: |
|
1160 |
{ |
|
1161 |
alt18=3; |
|
1162 |
} |
|
1163 |
break; |
|
1164 |
case T_CHAR: |
|
1165 |
{ |
|
1166 |
alt18=4; |
|
1167 |
} |
|
1168 |
break; |
|
1169 |
case T_CBRL: |
|
1170 |
{ |
|
1171 |
alt18=5; |
|
1172 |
} |
|
1173 |
break; |
|
1174 |
case T_IDENTIFIER: |
|
1175 |
{ |
|
1176 |
alt18=6; |
|
1177 |
} |
|
1178 |
break; |
|
1179 |
default: |
|
1180 |
NoViableAltException nvae = |
|
1181 |
new NoViableAltException("", 18, 0, input); |
|
1182 |
|
|
1183 |
throw nvae; |
|
1184 |
|
|
1185 |
} |
|
1186 |
|
|
1187 |
switch (alt18) { |
|
1188 |
case 1 : |
|
1189 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:261:4: T_BOOL |
|
1190 |
{ |
|
1191 |
match(input,T_BOOL,FOLLOW_T_BOOL_in_simpleType613); |
|
1192 |
|
|
1193 |
aTypeSymbol = createBoolType(); |
|
1194 |
|
|
1195 |
} |
|
1196 |
break; |
|
1197 |
case 2 : |
|
1198 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:264:4: T_INT T_LSQPAREN rangeLow= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_INTNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN |
|
1199 |
{ |
|
1200 |
match(input,T_INT,FOLLOW_T_INT_in_simpleType626); |
|
1201 |
|
|
1202 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_simpleType628); |
|
1203 |
|
|
1204 |
rangeLow=(Token)input.LT(1); |
|
1205 |
|
|
1206 |
if ( input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INFTY||input.LA(1)==T_INTNUMBER ) { |
|
1207 |
input.consume(); |
|
1208 |
state.errorRecovery=false; |
|
1209 |
} |
|
1210 |
else { |
|
1211 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
1212 |
throw mse; |
|
1213 |
} |
|
1214 |
|
|
1215 |
|
|
1216 |
match(input,T_RANGETO,FOLLOW_T_RANGETO_in_simpleType640); |
|
1217 |
|
|
1218 |
rangeHigh=(Token)input.LT(1); |
|
1219 |
|
|
1220 |
if ( input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INFTY||input.LA(1)==T_INTNUMBER ) { |
|
1221 |
input.consume(); |
|
1222 |
state.errorRecovery=false; |
|
1223 |
} |
|
1224 |
else { |
|
1225 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
1226 |
throw mse; |
|
1227 |
} |
|
1228 |
|
|
1229 |
|
|
1230 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_simpleType652); |
|
1231 |
|
|
1232 |
aTypeSymbol = createIntType(rangeLow,rangeHigh); |
|
1233 |
|
|
1234 |
} |
|
1235 |
break; |
|
1236 |
case 3 : |
|
1237 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:268:4: T_FLOAT T_LSQPAREN rangeLow= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RANGETO rangeHigh= ( T_FLOATNUMBER | T_INFTY | T_IDENTIFIER ) T_RSQPAREN |
|
1238 |
{ |
|
1239 |
match(input,T_FLOAT,FOLLOW_T_FLOAT_in_simpleType671); |
|
1240 |
|
|
1241 |
match(input,T_LSQPAREN,FOLLOW_T_LSQPAREN_in_simpleType674); |
|
1242 |
|
|
1243 |
rangeLow=(Token)input.LT(1); |
|
1244 |
|
|
1245 |
if ( input.LA(1)==T_FLOATNUMBER||input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INFTY ) { |
|
1246 |
input.consume(); |
|
1247 |
state.errorRecovery=false; |
|
1248 |
} |
|
1249 |
else { |
|
1250 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
1251 |
throw mse; |
|
1252 |
} |
|
1253 |
|
|
1254 |
|
|
1255 |
match(input,T_RANGETO,FOLLOW_T_RANGETO_in_simpleType686); |
|
1256 |
|
|
1257 |
rangeHigh=(Token)input.LT(1); |
|
1258 |
|
|
1259 |
if ( input.LA(1)==T_FLOATNUMBER||input.LA(1)==T_IDENTIFIER||input.LA(1)==T_INFTY ) { |
|
1260 |
input.consume(); |
|
1261 |
state.errorRecovery=false; |
|
1262 |
} |
|
1263 |
else { |
|
1264 |
MismatchedSetException mse = new MismatchedSetException(null,input); |
|
1265 |
throw mse; |
|
1266 |
} |
|
1267 |
|
|
1268 |
|
|
1269 |
match(input,T_RSQPAREN,FOLLOW_T_RSQPAREN_in_simpleType698); |
|
1270 |
|
|
1271 |
aTypeSymbol = createFloatType(rangeLow,rangeHigh); |
|
1272 |
|
|
1273 |
} |
|
1274 |
break; |
|
1275 |
case 4 : |
|
1276 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:272:4: T_CHAR |
|
1277 |
{ |
|
1278 |
match(input,T_CHAR,FOLLOW_T_CHAR_in_simpleType716); |
|
1279 |
|
|
1280 |
aTypeSymbol = createCharType(); |
|
1281 |
|
|
1282 |
} |
|
1283 |
break; |
|
1284 |
case 5 : |
|
1285 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:276:4: T_CBRL aRangeValue= T_IDENTIFIER ( T_EQUAL optVal= T_INTNUMBER )? ( T_COMMA otherRangeValue= T_IDENTIFIER ( T_EQUAL otherOptVal= T_INTNUMBER )? )* T_CBRR |
|
1286 |
{ |
|
1287 |
match(input,T_CBRL,FOLLOW_T_CBRL_in_simpleType732); |
|
1288 |
|
|
1289 |
aRangeValue=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_simpleType736); |
|
1290 |
|
|
1291 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:276:36: ( T_EQUAL optVal= T_INTNUMBER )? |
|
1292 |
int alt15=2; |
|
1293 |
int LA15_0 = input.LA(1); |
|
1294 |
|
|
1295 |
if ( (LA15_0==T_EQUAL) ) { |
|
1296 |
alt15=1; |
|
1297 |
} |
|
1298 |
switch (alt15) { |
|
1299 |
case 1 : |
|
1300 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:276:37: T_EQUAL optVal= T_INTNUMBER |
|
1301 |
{ |
|
1302 |
match(input,T_EQUAL,FOLLOW_T_EQUAL_in_simpleType739); |
|
1303 |
|
|
1304 |
optVal=(Token)match(input,T_INTNUMBER,FOLLOW_T_INTNUMBER_in_simpleType743); |
|
1305 |
|
|
1306 |
} |
|
1307 |
break; |
|
1308 |
|
|
1309 |
} |
|
1310 |
|
|
1311 |
|
|
1312 |
aTypeSymbol = createEnumType(aRangeValue, optVal); |
|
1313 |
|
|
1314 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:277:4: ( T_COMMA otherRangeValue= T_IDENTIFIER ( T_EQUAL otherOptVal= T_INTNUMBER )? )* |
|
1315 |
loop17: |
|
1316 |
do { |
|
1317 |
int alt17=2; |
|
1318 |
int LA17_0 = input.LA(1); |
|
1319 |
|
|
1320 |
if ( (LA17_0==T_COMMA) ) { |
|
1321 |
alt17=1; |
|
1322 |
} |
|
1323 |
|
|
1324 |
|
|
1325 |
switch (alt17) { |
|
1326 |
case 1 : |
|
1327 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:277:5: T_COMMA otherRangeValue= T_IDENTIFIER ( T_EQUAL otherOptVal= T_INTNUMBER )? |
|
1328 |
{ |
|
1329 |
match(input,T_COMMA,FOLLOW_T_COMMA_in_simpleType754); |
|
1330 |
|
|
1331 |
otherRangeValue=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_simpleType758); |
|
1332 |
|
|
1333 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:277:42: ( T_EQUAL otherOptVal= T_INTNUMBER )? |
|
1334 |
int alt16=2; |
|
1335 |
int LA16_0 = input.LA(1); |
|
1336 |
|
|
1337 |
if ( (LA16_0==T_EQUAL) ) { |
|
1338 |
alt16=1; |
|
1339 |
} |
|
1340 |
switch (alt16) { |
|
1341 |
case 1 : |
|
1342 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:277:43: T_EQUAL otherOptVal= T_INTNUMBER |
|
1343 |
{ |
|
1344 |
match(input,T_EQUAL,FOLLOW_T_EQUAL_in_simpleType761); |
|
1345 |
|
|
1346 |
otherOptVal=(Token)match(input,T_INTNUMBER,FOLLOW_T_INTNUMBER_in_simpleType765); |
|
1347 |
|
|
1348 |
} |
|
1349 |
break; |
|
1350 |
|
|
1351 |
} |
|
1352 |
|
|
1353 |
|
|
1354 |
addToEnumType(aTypeSymbol,otherRangeValue,otherOptVal); otherOptVal=null; |
|
1355 |
|
|
1356 |
} |
|
1357 |
break; |
|
1358 |
|
|
1359 |
default : |
|
1360 |
break loop17; |
|
1361 |
} |
|
1362 |
} while (true); |
|
1363 |
|
|
1364 |
|
|
1365 |
match(input,T_CBRR,FOLLOW_T_CBRR_in_simpleType773); |
|
1366 |
|
|
1367 |
} |
|
1368 |
break; |
|
1369 |
case 6 : |
|
1370 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:279:4: aType= T_IDENTIFIER |
|
1371 |
{ |
|
1372 |
aType=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_simpleType784); |
|
1373 |
|
|
1374 |
aTypeSymbol = getNamedType(aType); |
|
1375 |
|
|
1376 |
} |
|
1377 |
break; |
|
1378 |
|
|
1379 |
} |
|
1380 |
} |
|
1381 |
catch (RecognitionException re) { |
|
1382 |
reportError(re); |
|
1383 |
recover(input,re); |
|
1384 |
} |
|
1385 |
|
|
1386 |
finally { |
|
1387 |
// do for sure before leaving |
|
1388 |
fixupSimpleType(aTypeSymbol); |
|
1389 |
} |
|
1390 |
return aTypeSymbol; |
|
1391 |
} |
|
1392 |
// $ANTLR end "simpleType" |
|
1393 |
|
|
1394 |
|
|
1395 |
|
|
1396 |
// $ANTLR start "ooActionSystem" |
|
1397 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:289:1: ooActionSystem returns [OoActionSystemType aTypeSymbol] : ( T_AUTOCONS )? T_SYSTEM ( T_LPAREN refinesSystemName= T_IDENTIFIER T_RPAREN )? '|[' ( T_VAR attrList )? ( T_METHODS methodList )? ( T_ACTIONS namedActionList )? ( T_DO (bl= actionBlock[null] )? T_OD )? ']|' ; |
|
1398 |
public final OoActionSystemType ooActionSystem() throws RecognitionException { |
|
1399 |
OoActionSystemType aTypeSymbol = null; |
|
1400 |
|
|
1401 |
|
|
1402 |
Token refinesSystemName=null; |
|
1403 |
Block bl =null; |
|
1404 |
|
|
1405 |
|
|
1406 |
|
|
1407 |
boolean autoCons = false; |
|
1408 |
aTypeSymbol = null; |
|
1409 |
refinesSystemName = null; |
|
1410 |
|
|
1411 |
try { |
|
1412 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:296:2: ( ( T_AUTOCONS )? T_SYSTEM ( T_LPAREN refinesSystemName= T_IDENTIFIER T_RPAREN )? '|[' ( T_VAR attrList )? ( T_METHODS methodList )? ( T_ACTIONS namedActionList )? ( T_DO (bl= actionBlock[null] )? T_OD )? ']|' ) |
|
1413 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:296:9: ( T_AUTOCONS )? T_SYSTEM ( T_LPAREN refinesSystemName= T_IDENTIFIER T_RPAREN )? '|[' ( T_VAR attrList )? ( T_METHODS methodList )? ( T_ACTIONS namedActionList )? ( T_DO (bl= actionBlock[null] )? T_OD )? ']|' |
|
1414 |
{ |
|
1415 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:296:9: ( T_AUTOCONS )? |
|
1416 |
int alt19=2; |
|
1417 |
int LA19_0 = input.LA(1); |
|
1418 |
|
|
1419 |
if ( (LA19_0==T_AUTOCONS) ) { |
|
1420 |
alt19=1; |
|
1421 |
} |
|
1422 |
switch (alt19) { |
|
1423 |
case 1 : |
|
1424 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:296:10: T_AUTOCONS |
|
1425 |
{ |
|
1426 |
match(input,T_AUTOCONS,FOLLOW_T_AUTOCONS_in_ooActionSystem827); |
|
1427 |
|
|
1428 |
autoCons = true; |
|
1429 |
|
|
1430 |
} |
|
1431 |
break; |
|
1432 |
|
|
1433 |
} |
|
1434 |
|
|
1435 |
|
|
1436 |
match(input,T_SYSTEM,FOLLOW_T_SYSTEM_in_ooActionSystem836); |
|
1437 |
|
|
1438 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:297:12: ( T_LPAREN refinesSystemName= T_IDENTIFIER T_RPAREN )? |
|
1439 |
int alt20=2; |
|
1440 |
int LA20_0 = input.LA(1); |
|
1441 |
|
|
1442 |
if ( (LA20_0==T_LPAREN) ) { |
|
1443 |
alt20=1; |
|
1444 |
} |
|
1445 |
switch (alt20) { |
|
1446 |
case 1 : |
|
1447 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:297:13: T_LPAREN refinesSystemName= T_IDENTIFIER T_RPAREN |
|
1448 |
{ |
|
1449 |
match(input,T_LPAREN,FOLLOW_T_LPAREN_in_ooActionSystem839); |
|
1450 |
|
|
1451 |
refinesSystemName=(Token)match(input,T_IDENTIFIER,FOLLOW_T_IDENTIFIER_in_ooActionSystem843); |
|
1452 |
|
|
1453 |
match(input,T_RPAREN,FOLLOW_T_RPAREN_in_ooActionSystem845); |
|
1454 |
|
|
1455 |
} |
|
1456 |
break; |
|
1457 |
|
|
1458 |
} |
|
1459 |
|
|
1460 |
|
|
1461 |
aTypeSymbol = createOoaType(refinesSystemName,autoCons); |
|
1462 |
|
|
1463 |
match(input,127,FOLLOW_127_in_ooActionSystem858); |
|
1464 |
|
|
1465 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:300:4: ( T_VAR attrList )? |
|
1466 |
int alt21=2; |
|
1467 |
int LA21_0 = input.LA(1); |
|
1468 |
|
|
1469 |
if ( (LA21_0==T_VAR) ) { |
|
1470 |
alt21=1; |
|
1471 |
} |
|
1472 |
switch (alt21) { |
|
1473 |
case 1 : |
|
1474 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:300:5: T_VAR attrList |
|
1475 |
{ |
|
1476 |
match(input,T_VAR,FOLLOW_T_VAR_in_ooActionSystem864); |
|
1477 |
|
|
1478 |
pushFollow(FOLLOW_attrList_in_ooActionSystem866); |
|
1479 |
attrList(); |
|
1480 |
|
|
1481 |
state._fsp--; |
|
1482 |
|
|
1483 |
|
|
1484 |
} |
|
1485 |
break; |
|
1486 |
|
|
1487 |
} |
|
1488 |
|
|
1489 |
|
|
1490 |
// C:\\Users\\KrennW\\Documents\\svn\\public\\tug_ist\\trunk\\momut\\uml_ooas\\ooas_compiler\\java\\src\\org\\momut\\ooas\\parser\\ooa.g:301:4: ( T_METHODS methodList )? |
|
1491 |
int alt22=2; |
|
1492 |
int LA22_0 = input.LA(1); |
|
1493 |
|
|
1494 |
if ( (LA22_0==T_METHODS) ) { |
|
1495 |
alt22=1; |
|
1496 |
} |
Also available in: Unified diff
changing java, cpp, hpp files to unix line endings