3 package com.jogamp.gluegen.cgram;
8 import antlr.CommonAST;
9 import antlr.DumpASTVisitor;
11import antlr.TreeParser;
13import antlr.collections.AST;
14import antlr.RecognitionException;
15import antlr.ANTLRException;
16import antlr.NoViableAltException;
17import antlr.MismatchedTokenException;
18import antlr.SemanticException;
19import antlr.collections.impl.BitSet;
21import antlr.collections.impl.ASTArray;
30PrintStream currentOutput = System.out;
32String currentSource =
"";
33LineObject trueSourceFile;
34final int lineDirectiveThreshold = Integer.MAX_VALUE;
36Stack sourceFiles =
new Stack();
40 preprocessorInfoChannel = preprocChannel;
43void initializePrinting()
46 printPreprocs(preprocs);
55void finalizePrinting() {
62 currentOutput.println();
65void printPreprocs( Vector preprocs )
69 if ( preprocs.size() > 0 ) {
70 if ( trueSourceFile !=
null ) {
71 currentOutput.println();
74 Enumeration e = preprocs.elements();
75 while (e.hasMoreElements())
77 Object o = e.nextElement();
78 if ( o.getClass().getName().equals(
"LineObject") ) {
79 LineObject l = (LineObject) o;
83 if (( trueSourceFile !=
null )
84 && ( !currentSource.equals(trueSourceFile.getSource()) )
85 && ( trueSourceFile.getSource().equals(l.getSource()) ) ) {
86 l.setEnteringFile(
false );
87 l.setReturningToFile(
true );
92 currentOutput.println(l);
93 lineNum = l.getLine();
94 currentSource = l.getSource();
98 if ( trueSourceFile ==
null ) {
99 trueSourceFile =
new LineObject(currentSource);
100 sourceFiles.push(trueSourceFile);
104 if ( l.getEnteringFile() ) {
109 if ( l.getReturningToFile() ) {
110 LineObject top = (LineObject) sourceFiles.peek();
111 while (( top != trueSourceFile ) && (! l.getSource().equals(top.getSource()) )) {
113 top = (LineObject) sourceFiles.peek();
118 currentOutput.println(o);
126void print( TNode t ) {
127 int tLineNum = t.getLocalLineNum();
128 if ( tLineNum == 0 ) tLineNum = lineNum;
131 printPreprocs(preprocs);
133 if ( (lineNum != tLineNum) ) {
137 currentOutput.println();
142 if ( lineNum == tLineNum ){
146 int diff = tLineNum - lineNum;
147 if ( lineNum < tLineNum ) {
149 for ( ; lineNum < tLineNum ; lineNum++ ) {
150 currentOutput.println();
158 currentOutput.print( t.getText() +
" " );
166void printAddingLineDirectives( TNode t ) {
167 int tLineNum = t.getLocalLineNum();
168 String tSource = (String) t.getAttribute(
"source");
170 if ( tSource ==
null ) tSource = currentSource;
171 if ( tLineNum == 0 ) tLineNum = lineNum;
174 printPreprocs(preprocs);
176 if ( (lineNum != tLineNum) || !currentSource.equals(tSource) ) {
180 currentOutput.println();
185 if ( ( lineNum == tLineNum ) && ( currentSource.equals(tSource) ) ){
188 else if ( currentSource.equals(tSource) ) {
189 int diff = tLineNum - lineNum;
190 if (diff > 0 && diff < lineDirectiveThreshold) {
192 for ( ; lineNum < tLineNum ; lineNum++ ) {
193 currentOutput.println();
198 if ( ! sourceFiles.empty() ) {
199 LineObject l = (LineObject) sourceFiles.peek();
200 StringBuilder tFlags =
new StringBuilder(
"");
201 if (l.getSystemHeader()) {
204 if (l.getTreatAsC()) {
207 currentOutput.println(
"# " + tLineNum +
" \"" + tSource +
"\"" + tFlags.toString());
215 Enumeration sources = sourceFiles.elements();
217 boolean returningToEarlierFile =
false;
218 while (sources.hasMoreElements()) {
219 LineObject l = (LineObject) sources.nextElement();
220 if (l.getSource().equals(tSource)) {
221 returningToEarlierFile =
true;
225 if (returningToEarlierFile) {
227 LineObject l = (LineObject) sourceFiles.peek();
228 while ( ( l != trueSourceFile ) &&(! l.getSource().equals(tSource) ) ) {
230 l = (LineObject) sourceFiles.peek();
234 StringBuilder tFlags =
new StringBuilder(
" 2");
235 if (l.getSystemHeader()) {
238 if (l.getTreatAsC()) {
242 currentOutput.println(
"# " + tLineNum +
" \"" + tSource +
"\"" + tFlags);
244 currentSource = tSource;
249 currentOutput.println(
"# " + tLineNum +
" \"" + tSource +
"\"" +
" 1");
251 currentSource = tSource;
255 currentOutput.print( t.getText() +
" " );
260void print( String s ) {
261 currentOutput.print( s +
" " );
265 for (
int i = 0; i< tabs; i++ ) {
266 currentOutput.print(
"\t" );
270void commaSep( TNode t ) {
272 if ( t.getNextSibling() !=
null ) {
280 System.err.println(
"ANTLR Tree Parsing RecognitionException Error: " + ex.getClass().getName() +
" " + ex );
281 ex.printStackTrace(System.err);
285 System.err.println(
"ANTLR Tree Parsing NoViableAltException Error: " + ex.toString());
287 ex.printStackTrace(System.err);
292 System.err.println(
"ANTLR Tree Parsing MismatchedTokenException Error: " + ex );
293 ex.printStackTrace(System.err);
297 System.err.println(
"ANTLR Error from String: " + s);
300 System.err.println(
"ANTLR Warning from String: " + s);
302 protected void match(AST t,
int ttype)
throws MismatchedTokenException {
304 super.match(t, ttype);
306 public void match(AST t, BitSet b)
throws MismatchedTokenException {
310 protected void matchNot(AST t,
int ttype)
throws MismatchedTokenException {
312 super.matchNot(t, ttype);
316 for (
int x=0; x<traceDepth; x++) System.out.print(
" ");
317 super.traceIn(rname, t);
320 for (
int x=0; x<traceDepth; x++) System.out.print(
" ");
321 super.traceOut(rname, t);
333 TNode translationUnit_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
335 if ( inputState.guessing==0 ) {
336 initializePrinting();
339 if (_t==
null) _t=ASTNULL;
340 switch ( _t.getType()) {
357 throw new NoViableAltException(_t);
361 if ( inputState.guessing==0 ) {
369 TNode externalList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
376 if (_t==
null) _t=ASTNULL;
382 if ( _cnt5>=1 ) {
break _loop5; }
else {
throw new NoViableAltException(_t);}
389 catch (RecognitionException ex) {
390 if (inputState.guessing==0) {
392 if (_t!=
null) {_t = _t.getNextSibling();}
400 public final void externalDef(AST _t)
throws RecognitionException {
402 TNode externalDef_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
406 if (_t==
null) _t=ASTNULL;
407 switch ( _t.getType()) {
436 _t = _t.getNextSibling();
437 if ( inputState.guessing==0 ) {
444 throw new NoViableAltException(_t);
448 catch (RecognitionException ex) {
449 if (inputState.guessing==0) {
451 if (_t!=
null) {_t = _t.getNextSibling();}
459 public final void declaration(AST _t)
throws RecognitionException {
461 TNode declaration_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
468 _t = _t.getFirstChild();
472 if (_t==
null) _t=ASTNULL;
473 switch ( _t.getType()) {
486 throw new NoViableAltException(_t);
494 if (_t==
null) _t=ASTNULL;
495 if ((_t.getType()==
SEMI)) {
498 _t = _t.getNextSibling();
499 if ( inputState.guessing==0 ) {
504 if ( _cnt16>=1 ) {
break _loop16; }
else {
throw new NoViableAltException(_t);}
511 _t = _t.getNextSibling();
513 catch (RecognitionException ex) {
514 if (inputState.guessing==0) {
516 if (_t!=
null) {_t = _t.getNextSibling();}
524 public final void functionDef(AST _t)
throws RecognitionException {
526 TNode functionDef_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
533 _t = _t.getFirstChild();
535 if (_t==
null) _t=ASTNULL;
536 switch ( _t.getType()) {
568 throw new NoViableAltException(_t);
577 if (_t==
null) _t=ASTNULL;
578 switch ( _t.getType()) {
589 _t = _t.getNextSibling();
590 if ( inputState.guessing==0 ) {
605 _t = _t.getNextSibling();
607 catch (RecognitionException ex) {
608 if (inputState.guessing==0) {
610 if (_t!=
null) {_t = _t.getNextSibling();}
618 public final void asm_expr(AST _t)
throws RecognitionException {
620 TNode asm_expr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
629 a = _t==ASTNULL ? null :(
TNode)_t;
631 _t = _t.getFirstChild();
632 if ( inputState.guessing==0 ) {
636 if (_t==
null) _t=ASTNULL;
637 switch ( _t.getType()) {
642 _t = _t.getNextSibling();
643 if ( inputState.guessing==0 ) {
654 throw new NoViableAltException(_t);
660 _t = _t.getNextSibling();
661 if ( inputState.guessing==0 ) {
668 _t = _t.getNextSibling();
669 if ( inputState.guessing==0 ) {
674 _t = _t.getNextSibling();
675 if ( inputState.guessing==0 ) {
679 _t = _t.getNextSibling();
681 catch (RecognitionException ex) {
682 if (inputState.guessing==0) {
684 if (_t!=
null) {_t = _t.getNextSibling();}
694 TNode typelessDeclaration_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
701 _t = _t.getFirstChild();
706 _t = _t.getNextSibling();
708 _t = _t.getNextSibling();
709 if ( inputState.guessing==0 ) {
713 catch (RecognitionException ex) {
714 if (inputState.guessing==0) {
716 if (_t!=
null) {_t = _t.getNextSibling();}
726 TNode initDeclList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
734 if (_t==
null) _t=ASTNULL;
736 if ( inputState.guessing==0 ) {
749 catch (RecognitionException ex) {
750 if (inputState.guessing==0) {
752 if (_t!=
null) {_t = _t.getNextSibling();}
760 public final void expr(AST _t)
throws RecognitionException {
762 TNode expr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
765 if (_t==
null) _t=ASTNULL;
766 switch ( _t.getType()) {
873 throw new NoViableAltException(_t);
877 catch (RecognitionException ex) {
878 if (inputState.guessing==0) {
880 if (_t!=
null) {_t = _t.getNextSibling();}
890 TNode declSpecifiers_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
897 if (_t==
null) _t=ASTNULL;
898 switch ( _t.getType()) {
939 if ( _cnt19>=1 ) {
break _loop19; }
else {
throw new NoViableAltException(_t);}
946 catch (RecognitionException ex) {
947 if (inputState.guessing==0) {
949 if (_t!=
null) {_t = _t.getNextSibling();}
959 TNode storageClassSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
965 if (_t==
null) _t=ASTNULL;
966 switch ( _t.getType()) {
971 _t = _t.getNextSibling();
972 if ( inputState.guessing==0 ) {
981 _t = _t.getNextSibling();
982 if ( inputState.guessing==0 ) {
991 _t = _t.getNextSibling();
992 if ( inputState.guessing==0 ) {
1007 throw new NoViableAltException(_t);
1011 catch (RecognitionException ex) {
1012 if (inputState.guessing==0) {
1014 if (_t!=
null) {_t = _t.getNextSibling();}
1024 TNode typeQualifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1029 if (_t==
null) _t=ASTNULL;
1030 switch ( _t.getType()) {
1035 _t = _t.getNextSibling();
1036 if ( inputState.guessing==0 ) {
1045 _t = _t.getNextSibling();
1046 if ( inputState.guessing==0 ) {
1053 throw new NoViableAltException(_t);
1057 catch (RecognitionException ex) {
1058 if (inputState.guessing==0) {
1060 if (_t!=
null) {_t = _t.getNextSibling();}
1070 TNode typeSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1086 if (_t==
null) _t=ASTNULL;
1087 switch ( _t.getType()) {
1092 _t = _t.getNextSibling();
1093 if ( inputState.guessing==0 ) {
1102 _t = _t.getNextSibling();
1103 if ( inputState.guessing==0 ) {
1112 _t = _t.getNextSibling();
1113 if ( inputState.guessing==0 ) {
1122 _t = _t.getNextSibling();
1123 if ( inputState.guessing==0 ) {
1132 _t = _t.getNextSibling();
1133 if ( inputState.guessing==0 ) {
1142 _t = _t.getNextSibling();
1143 if ( inputState.guessing==0 ) {
1152 _t = _t.getNextSibling();
1153 if ( inputState.guessing==0 ) {
1162 _t = _t.getNextSibling();
1163 if ( inputState.guessing==0 ) {
1172 _t = _t.getNextSibling();
1173 if ( inputState.guessing==0 ) {
1185 if (_t==
null) _t=ASTNULL;
1205 if (_t==
null) _t=ASTNULL;
1233 n = _t==ASTNULL ? null :(
TNode)_t;
1235 _t = _t.getFirstChild();
1238 _t = _t.getNextSibling();
1239 if ( inputState.guessing==0 ) {
1240 print( n ); print( lp );
1243 if (_t==
null) _t=ASTNULL;
1244 switch ( _t.getType()) {
1323 throw new NoViableAltException(_t);
1329 _t = _t.getNextSibling();
1330 if ( inputState.guessing==0 ) {
1334 _t = _t.getNextSibling();
1341 _t = _t.getNextSibling();
1342 if ( inputState.guessing==0 ) {
1349 throw new NoViableAltException(_t);
1353 catch (RecognitionException ex) {
1354 if (inputState.guessing==0) {
1356 if (_t!=
null) {_t = _t.getNextSibling();}
1366 TNode functionStorageClassSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1372 if (_t==
null) _t=ASTNULL;
1373 switch ( _t.getType()) {
1378 _t = _t.getNextSibling();
1379 if ( inputState.guessing==0 ) {
1388 _t = _t.getNextSibling();
1389 if ( inputState.guessing==0 ) {
1398 _t = _t.getNextSibling();
1399 if ( inputState.guessing==0 ) {
1406 throw new NoViableAltException(_t);
1410 catch (RecognitionException ex) {
1411 if (inputState.guessing==0) {
1413 if (_t!=
null) {_t = _t.getNextSibling();}
1423 TNode structSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1428 a = _t==ASTNULL ? null :(
TNode)_t;
1430 _t = _t.getFirstChild();
1431 if ( inputState.guessing==0 ) {
1437 _t = _t.getNextSibling();
1439 catch (RecognitionException ex) {
1440 if (inputState.guessing==0) {
1442 if (_t!=
null) {_t = _t.getNextSibling();}
1452 TNode attributeDecl_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1460 if (_t==
null) _t=ASTNULL;
1461 switch ( _t.getType()) {
1465 a = _t==ASTNULL ? null :(
TNode)_t;
1467 _t = _t.getFirstChild();
1468 if ( inputState.guessing==0 ) {
1474 if (_t==
null) _t=ASTNULL;
1477 if ( _t==
null )
throw new MismatchedTokenException();
1478 _t = _t.getNextSibling();
1479 if ( inputState.guessing==0 ) {
1490 _t = _t.getNextSibling();
1496 n = _t==ASTNULL ? null :(
TNode)_t;
1498 _t = _t.getFirstChild();
1499 if ( inputState.guessing==0 ) {
1504 _t = _t.getNextSibling();
1505 if ( inputState.guessing==0 ) {
1510 if ( inputState.guessing==0 ) {
1515 _t = _t.getNextSibling();
1516 if ( inputState.guessing==0 ) {
1520 _t = _t.getNextSibling();
1525 throw new NoViableAltException(_t);
1529 catch (RecognitionException ex) {
1530 if (inputState.guessing==0) {
1532 if (_t!=
null) {_t = _t.getNextSibling();}
1542 TNode unionSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1547 a = _t==ASTNULL ? null :(
TNode)_t;
1549 _t = _t.getFirstChild();
1550 if ( inputState.guessing==0 ) {
1556 _t = _t.getNextSibling();
1558 catch (RecognitionException ex) {
1559 if (inputState.guessing==0) {
1561 if (_t!=
null) {_t = _t.getNextSibling();}
1571 TNode enumSpecifier_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1579 a = _t==ASTNULL ? null :(
TNode)_t;
1581 _t = _t.getFirstChild();
1582 if ( inputState.guessing==0 ) {
1586 if (_t==
null) _t=ASTNULL;
1587 switch ( _t.getType()) {
1592 _t = _t.getNextSibling();
1593 if ( inputState.guessing==0 ) {
1605 throw new NoViableAltException(_t);
1610 if (_t==
null) _t=ASTNULL;
1611 switch ( _t.getType()) {
1616 _t = _t.getNextSibling();
1617 if ( inputState.guessing==0 ) {
1618 print( lc ); tabs++;
1624 _t = _t.getNextSibling();
1625 if ( inputState.guessing==0 ) {
1626 tabs--; print( rc );
1636 throw new NoViableAltException(_t);
1641 _t = _t.getNextSibling();
1643 catch (RecognitionException ex) {
1644 if (inputState.guessing==0) {
1646 if (_t!=
null) {_t = _t.getNextSibling();}
1656 TNode typedefName_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1663 _t = _t.getFirstChild();
1666 _t = _t.getNextSibling();
1667 if ( inputState.guessing==0 ) {
1671 _t = _t.getNextSibling();
1673 catch (RecognitionException ex) {
1674 if (inputState.guessing==0) {
1676 if (_t!=
null) {_t = _t.getNextSibling();}
1684 public final void typeName(AST _t)
throws RecognitionException {
1686 TNode typeName_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1692 if (_t==
null) _t=ASTNULL;
1693 switch ( _t.getType()) {
1706 throw new NoViableAltException(_t);
1711 catch (RecognitionException ex) {
1712 if (inputState.guessing==0) {
1714 if (_t!=
null) {_t = _t.getNextSibling();}
1724 TNode structOrUnionBody_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1734 boolean synPredMatched41 =
false;
1735 if (_t==
null) _t=ASTNULL;
1736 if (((_t.getType()==
ID))) {
1738 synPredMatched41 =
true;
1739 inputState.guessing++;
1744 _t = _t.getNextSibling();
1747 _t = _t.getNextSibling();
1750 catch (RecognitionException pe) {
1751 synPredMatched41 =
false;
1754inputState.guessing--;
1756 if ( synPredMatched41 ) {
1759 _t = _t.getNextSibling();
1762 _t = _t.getNextSibling();
1763 if ( inputState.guessing==0 ) {
1764 print( i1 ); print (
"{" ); tabs++;
1767 if (_t==
null) _t=ASTNULL;
1768 switch ( _t.getType()) {
1797 throw new NoViableAltException(_t);
1803 _t = _t.getNextSibling();
1804 if ( inputState.guessing==0 ) {
1805 tabs--; print( rc1 );
1808 else if ((_t.getType()==
LCURLY)) {
1811 _t = _t.getNextSibling();
1812 if ( inputState.guessing==0 ) {
1813 print( lc2 ); tabs++;
1816 if (_t==
null) _t=ASTNULL;
1817 switch ( _t.getType()) {
1846 throw new NoViableAltException(_t);
1852 _t = _t.getNextSibling();
1853 if ( inputState.guessing==0 ) {
1854 tabs--; print( rc2 );
1857 else if ((_t.getType()==
ID)) {
1860 _t = _t.getNextSibling();
1861 if ( inputState.guessing==0 ) {
1866 throw new NoViableAltException(_t);
1871 catch (RecognitionException ex) {
1872 if (inputState.guessing==0) {
1874 if (_t!=
null) {_t = _t.getNextSibling();}
1884 TNode structDeclarationList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1891 if (_t==
null) _t=ASTNULL;
1895 if ( inputState.guessing==0 ) {
1900 if ( _cnt46>=1 ) {
break _loop46; }
else {
throw new NoViableAltException(_t);}
1907 catch (RecognitionException ex) {
1908 if (inputState.guessing==0) {
1910 if (_t!=
null) {_t = _t.getNextSibling();}
1920 TNode structDeclaration_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1928 catch (RecognitionException ex) {
1929 if (inputState.guessing==0) {
1931 if (_t!=
null) {_t = _t.getNextSibling();}
1941 TNode specifierQualifierList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
1948 if (_t==
null) _t=ASTNULL;
1949 switch ( _t.getType()) {
1979 if ( _cnt50>=1 ) {
break _loop50; }
else {
throw new NoViableAltException(_t);}
1986 catch (RecognitionException ex) {
1987 if (inputState.guessing==0) {
1989 if (_t!=
null) {_t = _t.getNextSibling();}
1999 TNode structDeclaratorList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2007 if (_t==
null) _t=ASTNULL;
2009 if ( inputState.guessing==0 ) {
2022 catch (RecognitionException ex) {
2023 if (inputState.guessing==0) {
2025 if (_t!=
null) {_t = _t.getNextSibling();}
2035 TNode structDeclarator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2042 _t = _t.getFirstChild();
2044 if (_t==
null) _t=ASTNULL;
2045 switch ( _t.getType()) {
2061 throw new NoViableAltException(_t);
2066 if (_t==
null) _t=ASTNULL;
2067 switch ( _t.getType()) {
2072 _t = _t.getNextSibling();
2073 if ( inputState.guessing==0 ) {
2088 throw new NoViableAltException(_t);
2095 if (_t==
null) _t=ASTNULL;
2107 _t = _t.getNextSibling();
2109 catch (RecognitionException ex) {
2110 if (inputState.guessing==0) {
2112 if (_t!=
null) {_t = _t.getNextSibling();}
2120 public final void declarator(AST _t)
throws RecognitionException {
2122 TNode declarator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2135 _t = _t.getFirstChild();
2137 if (_t==
null) _t=ASTNULL;
2138 switch ( _t.getType()) {
2152 throw new NoViableAltException(_t);
2157 if (_t==
null) _t=ASTNULL;
2158 switch ( _t.getType()) {
2163 _t = _t.getNextSibling();
2164 if ( inputState.guessing==0 ) {
2173 _t = _t.getNextSibling();
2174 if ( inputState.guessing==0 ) {
2181 _t = _t.getNextSibling();
2182 if ( inputState.guessing==0 ) {
2189 throw new NoViableAltException(_t);
2196 if (_t==
null) _t=ASTNULL;
2197 switch ( _t.getType()) {
2201 n = _t==ASTNULL ? null :(
TNode)_t;
2203 _t = _t.getFirstChild();
2204 if ( inputState.guessing==0 ) {
2208 if (_t==
null) _t=ASTNULL;
2209 switch ( _t.getType()) {
2220 if (_t==
null) _t=ASTNULL;
2221 switch ( _t.getType()) {
2234 throw new NoViableAltException(_t);
2242 throw new NoViableAltException(_t);
2248 _t = _t.getNextSibling();
2249 if ( inputState.guessing==0 ) {
2253 _t = _t.getNextSibling();
2260 _t = _t.getNextSibling();
2261 if ( inputState.guessing==0 ) {
2265 if (_t==
null) _t=ASTNULL;
2266 switch ( _t.getType()) {
2327 throw new NoViableAltException(_t);
2333 _t = _t.getNextSibling();
2334 if ( inputState.guessing==0 ) {
2347 _t = _t.getNextSibling();
2349 catch (RecognitionException ex) {
2350 if (inputState.guessing==0) {
2352 if (_t!=
null) {_t = _t.getNextSibling();}
2360 public final void enumList(AST _t)
throws RecognitionException {
2362 TNode enumList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2370 if (_t==
null) _t=ASTNULL;
2371 if ((_t.getType()==
ID)) {
2372 if ( inputState.guessing==0 ) {
2385 catch (RecognitionException ex) {
2386 if (inputState.guessing==0) {
2388 if (_t!=
null) {_t = _t.getNextSibling();}
2396 public final void enumerator(AST _t)
throws RecognitionException {
2398 TNode enumerator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2405 _t = _t.getNextSibling();
2406 if ( inputState.guessing==0 ) {
2410 if (_t==
null) _t=ASTNULL;
2411 switch ( _t.getType()) {
2416 _t = _t.getNextSibling();
2417 if ( inputState.guessing==0 ) {
2431 throw new NoViableAltException(_t);
2436 catch (RecognitionException ex) {
2437 if (inputState.guessing==0) {
2439 if (_t!=
null) {_t = _t.getNextSibling();}
2447 public final void initDecl(AST _t)
throws RecognitionException {
2449 TNode initDecl_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2452 String declName =
"";
2458 _t = _t.getFirstChild();
2464 if (_t==
null) _t=ASTNULL;
2476 if (_t==
null) _t=ASTNULL;
2477 switch ( _t.getType()) {
2482 _t = _t.getNextSibling();
2483 if ( inputState.guessing==0 ) {
2494 _t = _t.getNextSibling();
2495 if ( inputState.guessing==0 ) {
2508 throw new NoViableAltException(_t);
2513 _t = _t.getNextSibling();
2515 catch (RecognitionException ex) {
2516 if (inputState.guessing==0) {
2518 if (_t!=
null) {_t = _t.getNextSibling();}
2528 TNode initializer_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2531 if (_t==
null) _t=ASTNULL;
2532 switch ( _t.getType()) {
2538 _t = _t.getFirstChild();
2540 if (_t==
null) _t=ASTNULL;
2541 switch ( _t.getType()) {
2602 throw new NoViableAltException(_t);
2609 _t = _t.getNextSibling();
2620 throw new NoViableAltException(_t);
2624 catch (RecognitionException ex) {
2625 if (inputState.guessing==0) {
2627 if (_t!=
null) {_t = _t.getNextSibling();}
2637 TNode pointerGroup_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2644 _t = _t.getFirstChild();
2649 if (_t==
null) _t=ASTNULL;
2650 if ((_t.getType()==
STAR)) {
2653 _t = _t.getNextSibling();
2654 if ( inputState.guessing==0 ) {
2660 if (_t==
null) _t=ASTNULL;
2673 if ( _cnt87>=1 ) {
break _loop87; }
else {
throw new NoViableAltException(_t);}
2680 _t = _t.getNextSibling();
2682 catch (RecognitionException ex) {
2683 if (inputState.guessing==0) {
2685 if (_t!=
null) {_t = _t.getNextSibling();}
2693 public final void idList(AST _t)
throws RecognitionException {
2695 TNode idList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2703 _t = _t.getNextSibling();
2704 if ( inputState.guessing==0 ) {
2710 if (_t==
null) _t=ASTNULL;
2711 if ((_t.getType()==
COMMA)) {
2714 _t = _t.getNextSibling();
2715 if ( inputState.guessing==0 ) {
2720 _t = _t.getNextSibling();
2721 if ( inputState.guessing==0 ) {
2732 catch (RecognitionException ex) {
2733 if (inputState.guessing==0) {
2735 if (_t!=
null) {_t = _t.getNextSibling();}
2745 TNode initializerElementLabel_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2759 _t = _t.getFirstChild();
2761 if (_t==
null) _t=ASTNULL;
2762 switch ( _t.getType()) {
2768 _t = _t.getNextSibling();
2769 if ( inputState.guessing==0 ) {
2776 _t = _t.getNextSibling();
2777 if ( inputState.guessing==0 ) {
2781 if (_t==
null) _t=ASTNULL;
2782 switch ( _t.getType()) {
2787 _t = _t.getNextSibling();
2788 if ( inputState.guessing==0 ) {
2799 throw new NoViableAltException(_t);
2810 _t = _t.getNextSibling();
2813 _t = _t.getNextSibling();
2814 if ( inputState.guessing==0 ) {
2815 print( i1 ); print( c );
2823 _t = _t.getNextSibling();
2826 _t = _t.getNextSibling();
2829 _t = _t.getNextSibling();
2830 if ( inputState.guessing==0 ) {
2831 print( d ); print( i2 ); print( a2 );
2837 throw new NoViableAltException(_t);
2842 _t = _t.getNextSibling();
2844 catch (RecognitionException ex) {
2845 if (inputState.guessing==0) {
2847 if (_t!=
null) {_t = _t.getNextSibling();}
2857 TNode lcurlyInitializer_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2863 n = _t==ASTNULL ? null :(
TNode)_t;
2865 _t = _t.getFirstChild();
2866 if ( inputState.guessing==0 ) {
2873 _t = _t.getNextSibling();
2874 if ( inputState.guessing==0 ) {
2875 tabs--; print( rc );
2878 _t = _t.getNextSibling();
2880 catch (RecognitionException ex) {
2881 if (inputState.guessing==0) {
2883 if (_t!=
null) {_t = _t.getNextSibling();}
2893 TNode initializerList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2900 if (_t==
null) _t=ASTNULL;
2902 i = _t==ASTNULL ? null : (
TNode)_t;
2905 if ( inputState.guessing==0 ) {
2916 catch (RecognitionException ex) {
2917 if (inputState.guessing==0) {
2919 if (_t!=
null) {_t = _t.getNextSibling();}
2929 TNode parameterTypeList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
2939 if (_t==
null) _t=ASTNULL;
2944 if (_t==
null) _t=ASTNULL;
2945 switch ( _t.getType()) {
2950 _t = _t.getNextSibling();
2951 if ( inputState.guessing==0 ) {
2960 _t = _t.getNextSibling();
2961 if ( inputState.guessing==0 ) {
2974 throw new NoViableAltException(_t);
2980 if ( _cnt117>=1 ) {
break _loop117; }
else {
throw new NoViableAltException(_t);}
2987 if (_t==
null) _t=ASTNULL;
2988 switch ( _t.getType()) {
2993 _t = _t.getNextSibling();
2994 if ( inputState.guessing==0 ) {
3005 throw new NoViableAltException(_t);
3010 catch (RecognitionException ex) {
3011 if (inputState.guessing==0) {
3013 if (_t!=
null) {_t = _t.getNextSibling();}
3023 TNode parameterDeclaration_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3029 _t = _t.getFirstChild();
3033 if (_t==
null) _t=ASTNULL;
3034 switch ( _t.getType()) {
3053 throw new NoViableAltException(_t);
3058 _t = _t.getNextSibling();
3060 catch (RecognitionException ex) {
3061 if (inputState.guessing==0) {
3063 if (_t!=
null) {_t = _t.getNextSibling();}
3073 TNode nonemptyAbstractDeclarator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3087 _t = _t.getFirstChild();
3089 if (_t==
null) _t=ASTNULL;
3090 switch ( _t.getType()) {
3098 if (_t==
null) _t=ASTNULL;
3099 switch ( _t.getType()) {
3105 _t = _t.getNextSibling();
3106 if ( inputState.guessing==0 ) {
3110 if (_t==
null) _t=ASTNULL;
3111 switch ( _t.getType()) {
3130 throw new NoViableAltException(_t);
3136 _t = _t.getNextSibling();
3137 if ( inputState.guessing==0 ) {
3148 _t = _t.getNextSibling();
3149 if ( inputState.guessing==0 ) {
3153 if (_t==
null) _t=ASTNULL;
3154 switch ( _t.getType()) {
3215 throw new NoViableAltException(_t);
3221 _t = _t.getNextSibling();
3222 if ( inputState.guessing==0 ) {
3244 if (_t==
null) _t=ASTNULL;
3245 switch ( _t.getType()) {
3251 _t = _t.getNextSibling();
3252 if ( inputState.guessing==0 ) {
3256 if (_t==
null) _t=ASTNULL;
3257 switch ( _t.getType()) {
3276 throw new NoViableAltException(_t);
3282 _t = _t.getNextSibling();
3283 if ( inputState.guessing==0 ) {
3294 _t = _t.getNextSibling();
3295 if ( inputState.guessing==0 ) {
3299 if (_t==
null) _t=ASTNULL;
3300 switch ( _t.getType()) {
3361 throw new NoViableAltException(_t);
3367 _t = _t.getNextSibling();
3368 if ( inputState.guessing==0 ) {
3376 if ( _cnt208>=1 ) {
break _loop208; }
else {
throw new NoViableAltException(_t);}
3386 throw new NoViableAltException(_t);
3391 _t = _t.getNextSibling();
3393 catch (RecognitionException ex) {
3394 if (inputState.guessing==0) {
3396 if (_t!=
null) {_t = _t.getNextSibling();}
3406 TNode functionDeclSpecifiers_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3413 if (_t==
null) _t=ASTNULL;
3414 switch ( _t.getType()) {
3452 if ( _cnt129>=1 ) {
break _loop129; }
else {
throw new NoViableAltException(_t);}
3459 catch (RecognitionException ex) {
3460 if (inputState.guessing==0) {
3462 if (_t!=
null) {_t = _t.getNextSibling();}
3472 TNode compoundStatement_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3478 cs = _t==ASTNULL ? null :(
TNode)_t;
3480 _t = _t.getFirstChild();
3481 if ( inputState.guessing==0 ) {
3482 print( cs ); tabs++;
3487 if (_t==
null) _t=ASTNULL;
3488 switch ( _t.getType()) {
3510 if (_t==
null) _t=ASTNULL;
3511 switch ( _t.getType()) {
3538 throw new NoViableAltException(_t);
3544 _t = _t.getNextSibling();
3545 if ( inputState.guessing==0 ) {
3546 tabs--; print( rc );
3549 _t = _t.getNextSibling();
3551 catch (RecognitionException ex) {
3552 if (inputState.guessing==0) {
3554 if (_t!=
null) {_t = _t.getNextSibling();}
3564 TNode declarationList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3571 if (_t==
null) _t=ASTNULL;
3581 if ( _cnt132>=1 ) {
break _loop132; }
else {
throw new NoViableAltException(_t);}
3588 catch (RecognitionException ex) {
3589 if (inputState.guessing==0) {
3591 if (_t!=
null) {_t = _t.getNextSibling();}
3601 TNode localLabelDecl_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3607 a = _t==ASTNULL ? null :(
TNode)_t;
3609 _t = _t.getFirstChild();
3610 if ( inputState.guessing==0 ) {
3617 if (_t==
null) _t=ASTNULL;
3618 if ((_t.getType()==
ID)) {
3621 _t = _t.getNextSibling();
3622 if ( inputState.guessing==0 ) {
3627 if ( _cnt136>=1 ) {
break _loop136; }
else {
throw new NoViableAltException(_t);}
3633 if ( inputState.guessing==0 ) {
3637 _t = _t.getNextSibling();
3639 catch (RecognitionException ex) {
3640 if (inputState.guessing==0) {
3642 if (_t!=
null) {_t = _t.getNextSibling();}
3652 TNode statementList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3659 if (_t==
null) _t=ASTNULL;
3665 if ( _cnt144>=1 ) {
break _loop144; }
else {
throw new NoViableAltException(_t);}
3672 catch (RecognitionException ex) {
3673 if (inputState.guessing==0) {
3675 if (_t!=
null) {_t = _t.getNextSibling();}
3683 public final void statement(AST _t)
throws RecognitionException {
3685 TNode statement_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3691 catch (RecognitionException ex) {
3692 if (inputState.guessing==0) {
3694 if (_t!=
null) {_t = _t.getNextSibling();}
3704 TNode statementBody_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
3721 if (_t==
null) _t=ASTNULL;
3722 switch ( _t.getType()) {
3727 _t = _t.getNextSibling();
3728 if ( inputState.guessing==0 ) {
3744 _t = _t.getFirstChild();
3747 if ( inputState.guessing==0 ) {
3751 _t = _t.getNextSibling();
3757 w = _t==ASTNULL ? null :(
TNode)_t;
3759 _t = _t.getFirstChild();
3760 if ( inputState.guessing==0 ) {
3761 print( w ); print(
"(" );
3765 if ( inputState.guessing==0 ) {
3771 _t = _t.getNextSibling();
3777 d = _t==ASTNULL ? null :(
TNode)_t;
3779 _t = _t.getFirstChild();
3780 if ( inputState.guessing==0 ) {
3785 if ( inputState.guessing==0 ) {
3786 print(
" while ( " );
3790 if ( inputState.guessing==0 ) {
3794 _t = _t.getNextSibling();
3800 f = _t==ASTNULL ? null :(
TNode)_t;
3802 _t = _t.getFirstChild();
3803 if ( inputState.guessing==0 ) {
3804 print( f ); print(
"(" );
3808 if ( inputState.guessing==0 ) {
3813 if ( inputState.guessing==0 ) {
3818 if ( inputState.guessing==0 ) {
3824 _t = _t.getNextSibling();
3830 g = _t==ASTNULL ? null :(
TNode)_t;
3832 _t = _t.getFirstChild();
3833 if ( inputState.guessing==0 ) {
3838 if ( inputState.guessing==0 ) {
3842 _t = _t.getNextSibling();
3849 _t = _t.getNextSibling();
3850 if ( inputState.guessing==0 ) {
3851 print( c ); print(
";" );
3859 _t = _t.getNextSibling();
3860 if ( inputState.guessing==0 ) {
3861 print( b ); print(
";" );
3868 r = _t==ASTNULL ? null :(
TNode)_t;
3870 _t = _t.getFirstChild();
3871 if ( inputState.guessing==0 ) {
3875 if (_t==
null) _t=ASTNULL;
3876 switch ( _t.getType()) {
3937 throw new NoViableAltException(_t);
3941 if ( inputState.guessing==0 ) {
3945 _t = _t.getNextSibling();
3953 _t = _t.getFirstChild();
3956 _t = _t.getNextSibling();
3957 if ( inputState.guessing==0 ) {
3958 print( ni ); print(
":" );
3961 if (_t==
null) _t=ASTNULL;
3962 switch ( _t.getType()) {
3989 throw new NoViableAltException(_t);
3994 _t = _t.getNextSibling();
4000 ca = _t==ASTNULL ? null :(
TNode)_t;
4002 _t = _t.getFirstChild();
4003 if ( inputState.guessing==0 ) {
4008 if ( inputState.guessing==0 ) {
4012 if (_t==
null) _t=ASTNULL;
4013 switch ( _t.getType()) {
4040 throw new NoViableAltException(_t);
4045 _t = _t.getNextSibling();
4051 de = _t==ASTNULL ? null :(
TNode)_t;
4053 _t = _t.getFirstChild();
4054 if ( inputState.guessing==0 ) {
4055 print( de ); print(
":" );
4058 if (_t==
null) _t=ASTNULL;
4059 switch ( _t.getType()) {
4086 throw new NoViableAltException(_t);
4091 _t = _t.getNextSibling();
4097 i = _t==ASTNULL ? null :(
TNode)_t;
4099 _t = _t.getFirstChild();
4100 if ( inputState.guessing==0 ) {
4101 print( i ); print(
"(" );
4105 if ( inputState.guessing==0 ) {
4111 if (_t==
null) _t=ASTNULL;
4112 switch ( _t.getType()) {
4117 _t = _t.getNextSibling();
4118 if ( inputState.guessing==0 ) {
4131 throw new NoViableAltException(_t);
4136 _t = _t.getNextSibling();
4142 sw = _t==ASTNULL ? null :(
TNode)_t;
4144 _t = _t.getFirstChild();
4145 if ( inputState.guessing==0 ) {
4146 print( sw ); print(
"(" );
4150 if ( inputState.guessing==0 ) {
4156 _t = _t.getNextSibling();
4161 throw new NoViableAltException(_t);
4165 catch (RecognitionException ex) {
4166 if (inputState.guessing==0) {
4168 if (_t!=
null) {_t = _t.getNextSibling();}
4176 public final void binaryExpr(AST _t)
throws RecognitionException {
4178 TNode binaryExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4182 b = _t==ASTNULL ? null : (
TNode)_t;
4185 if ( inputState.guessing==0 ) {
4187 e1 = (
TNode) b.getFirstChild();
4188 e2 = (
TNode) e1.getNextSibling();
4195 catch (RecognitionException ex) {
4196 if (inputState.guessing==0) {
4198 if (_t!=
null) {_t = _t.getNextSibling();}
4208 TNode conditionalExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4214 q = _t==ASTNULL ? null :(
TNode)_t;
4216 _t = _t.getFirstChild();
4219 if ( inputState.guessing==0 ) {
4223 if (_t==
null) _t=ASTNULL;
4224 switch ( _t.getType()) {
4285 throw new NoViableAltException(_t);
4291 _t = _t.getNextSibling();
4292 if ( inputState.guessing==0 ) {
4298 _t = _t.getNextSibling();
4300 catch (RecognitionException ex) {
4301 if (inputState.guessing==0) {
4303 if (_t!=
null) {_t = _t.getNextSibling();}
4311 public final void castExpr(AST _t)
throws RecognitionException {
4313 TNode castExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4319 c = _t==ASTNULL ? null :(
TNode)_t;
4321 _t = _t.getFirstChild();
4322 if ( inputState.guessing==0 ) {
4329 _t = _t.getNextSibling();
4330 if ( inputState.guessing==0 ) {
4336 _t = _t.getNextSibling();
4338 catch (RecognitionException ex) {
4339 if (inputState.guessing==0) {
4341 if (_t!=
null) {_t = _t.getNextSibling();}
4349 public final void unaryExpr(AST _t)
throws RecognitionException {
4351 TNode unaryExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4363 if (_t==
null) _t=ASTNULL;
4364 switch ( _t.getType()) {
4368 i = _t==ASTNULL ? null :(
TNode)_t;
4370 _t = _t.getFirstChild();
4371 if ( inputState.guessing==0 ) {
4377 _t = _t.getNextSibling();
4383 d = _t==ASTNULL ? null :(
TNode)_t;
4385 _t = _t.getFirstChild();
4386 if ( inputState.guessing==0 ) {
4392 _t = _t.getNextSibling();
4400 _t = _t.getFirstChild();
4401 u = _t==ASTNULL ? null : (
TNode)_t;
4404 if ( inputState.guessing==0 ) {
4410 _t = _t.getNextSibling();
4416 s = _t==ASTNULL ? null :(
TNode)_t;
4418 _t = _t.getFirstChild();
4419 if ( inputState.guessing==0 ) {
4423 boolean synPredMatched216 =
false;
4424 if (_t==
null) _t=ASTNULL;
4425 if (((_t.getType()==
LPAREN))) {
4427 synPredMatched216 =
true;
4428 inputState.guessing++;
4433 _t = _t.getNextSibling();
4438 catch (RecognitionException pe) {
4439 synPredMatched216 =
false;
4442inputState.guessing--;
4444 if ( synPredMatched216 ) {
4447 _t = _t.getNextSibling();
4448 if ( inputState.guessing==0 ) {
4455 _t = _t.getNextSibling();
4456 if ( inputState.guessing==0 ) {
4465 throw new NoViableAltException(_t);
4470 _t = _t.getNextSibling();
4476 a = _t==ASTNULL ? null :(
TNode)_t;
4478 _t = _t.getFirstChild();
4479 if ( inputState.guessing==0 ) {
4483 boolean synPredMatched220 =
false;
4484 if (_t==
null) _t=ASTNULL;
4485 if (((_t.getType()==
LPAREN))) {
4487 synPredMatched220 =
true;
4488 inputState.guessing++;
4493 _t = _t.getNextSibling();
4498 catch (RecognitionException pe) {
4499 synPredMatched220 =
false;
4502inputState.guessing--;
4504 if ( synPredMatched220 ) {
4507 _t = _t.getNextSibling();
4508 if ( inputState.guessing==0 ) {
4515 _t = _t.getNextSibling();
4516 if ( inputState.guessing==0 ) {
4525 throw new NoViableAltException(_t);
4530 _t = _t.getNextSibling();
4535 throw new NoViableAltException(_t);
4539 catch (RecognitionException ex) {
4540 if (inputState.guessing==0) {
4542 if (_t!=
null) {_t = _t.getNextSibling();}
4552 TNode postfixExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4568 _t = _t.getFirstChild();
4575 if (_t==
null) _t=ASTNULL;
4576 switch ( _t.getType()) {
4581 _t = _t.getNextSibling();
4584 _t = _t.getNextSibling();
4585 if ( inputState.guessing==0 ) {
4586 print( a ); print( b );
4594 _t = _t.getNextSibling();
4597 _t = _t.getNextSibling();
4598 if ( inputState.guessing==0 ) {
4599 print( c ); print( d );
4606 n = _t==ASTNULL ? null :(
TNode)_t;
4608 _t = _t.getFirstChild();
4609 if ( inputState.guessing==0 ) {
4613 if (_t==
null) _t=ASTNULL;
4614 switch ( _t.getType()) {
4675 throw new NoViableAltException(_t);
4681 _t = _t.getNextSibling();
4682 if ( inputState.guessing==0 ) {
4686 _t = _t.getNextSibling();
4693 _t = _t.getNextSibling();
4694 if ( inputState.guessing==0 ) {
4701 _t = _t.getNextSibling();
4702 if ( inputState.guessing==0 ) {
4711 _t = _t.getNextSibling();
4712 if ( inputState.guessing==0 ) {
4721 _t = _t.getNextSibling();
4722 if ( inputState.guessing==0 ) {
4729 if ( _cnt227>=1 ) {
break _loop227; }
else {
throw new NoViableAltException(_t);}
4736 _t = _t.getNextSibling();
4738 catch (RecognitionException ex) {
4739 if (inputState.guessing==0) {
4741 if (_t!=
null) {_t = _t.getNextSibling();}
4751 TNode primaryExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4757 if (_t==
null) _t=ASTNULL;
4758 switch ( _t.getType()) {
4763 _t = _t.getNextSibling();
4764 if ( inputState.guessing==0 ) {
4773 _t = _t.getNextSibling();
4774 if ( inputState.guessing==0 ) {
4794 eg = _t==ASTNULL ? null :(
TNode)_t;
4796 _t = _t.getFirstChild();
4797 if ( inputState.guessing==0 ) {
4802 if ( inputState.guessing==0 ) {
4806 _t = _t.getNextSibling();
4811 throw new NoViableAltException(_t);
4815 catch (RecognitionException ex) {
4816 if (inputState.guessing==0) {
4818 if (_t!=
null) {_t = _t.getNextSibling();}
4826 public final void emptyExpr(AST _t)
throws RecognitionException {
4828 TNode emptyExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4833 _t = _t.getNextSibling();
4835 catch (RecognitionException ex) {
4836 if (inputState.guessing==0) {
4838 if (_t!=
null) {_t = _t.getNextSibling();}
4848 TNode compoundStatementExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4854 l = _t==ASTNULL ? null :(
TNode)_t;
4856 _t = _t.getFirstChild();
4857 if ( inputState.guessing==0 ) {
4864 _t = _t.getNextSibling();
4865 if ( inputState.guessing==0 ) {
4869 _t = _t.getNextSibling();
4871 catch (RecognitionException ex) {
4872 if (inputState.guessing==0) {
4874 if (_t!=
null) {_t = _t.getNextSibling();}
4882 public final void rangeExpr(AST _t)
throws RecognitionException {
4884 TNode rangeExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4891 _t = _t.getFirstChild();
4896 _t = _t.getNextSibling();
4897 if ( inputState.guessing==0 ) {
4903 _t = _t.getNextSibling();
4905 catch (RecognitionException ex) {
4906 if (inputState.guessing==0) {
4908 if (_t!=
null) {_t = _t.getNextSibling();}
4916 public final void gnuAsmExpr(AST _t)
throws RecognitionException {
4918 TNode gnuAsmExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
4932 n = _t==ASTNULL ? null :(
TNode)_t;
4934 _t = _t.getFirstChild();
4935 if ( inputState.guessing==0 ) {
4939 if (_t==
null) _t=ASTNULL;
4940 switch ( _t.getType()) {
4945 _t = _t.getNextSibling();
4946 if ( inputState.guessing==0 ) {
4957 throw new NoViableAltException(_t);
4963 _t = _t.getNextSibling();
4964 if ( inputState.guessing==0 ) {
4970 if (_t==
null) _t=ASTNULL;
4971 if ((_t.getType()==
COLON)) {
4974 _t = _t.getNextSibling();
4975 if ( inputState.guessing==0 ) {
4979 if (_t==
null) _t=ASTNULL;
4980 switch ( _t.getType()) {
4988 if (_t==
null) _t=ASTNULL;
4989 if ((_t.getType()==
COMMA)) {
4992 _t = _t.getNextSibling();
4993 if ( inputState.guessing==0 ) {
5014 throw new NoViableAltException(_t);
5019 if (_t==
null) _t=ASTNULL;
5020 if ((_t.getType()==
COLON)) {
5023 _t = _t.getNextSibling();
5024 if ( inputState.guessing==0 ) {
5028 if (_t==
null) _t=ASTNULL;
5029 switch ( _t.getType()) {
5037 if (_t==
null) _t=ASTNULL;
5038 if ((_t.getType()==
COMMA)) {
5041 _t = _t.getNextSibling();
5042 if ( inputState.guessing==0 ) {
5063 throw new NoViableAltException(_t);
5068 else if ((_t.getType()==
COLON||_t.getType()==
RPAREN)) {
5071 throw new NoViableAltException(_t);
5076 else if ((_t.getType()==
COLON||_t.getType()==
RPAREN)) {
5079 throw new NoViableAltException(_t);
5084 if (_t==
null) _t=ASTNULL;
5085 switch ( _t.getType()) {
5090 _t = _t.getNextSibling();
5091 if ( inputState.guessing==0 ) {
5099 if (_t==
null) _t=ASTNULL;
5100 if ((_t.getType()==
COMMA)) {
5103 _t = _t.getNextSibling();
5104 if ( inputState.guessing==0 ) {
5124 throw new NoViableAltException(_t);
5130 _t = _t.getNextSibling();
5131 if ( inputState.guessing==0 ) {
5135 _t = _t.getNextSibling();
5137 catch (RecognitionException ex) {
5138 if (inputState.guessing==0) {
5140 if (_t!=
null) {_t = _t.getNextSibling();}
5148 protected final void stringConst(AST _t)
throws RecognitionException {
5150 TNode stringConst_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5157 _t = _t.getFirstChild();
5162 if (_t==
null) _t=ASTNULL;
5166 _t = _t.getNextSibling();
5167 if ( inputState.guessing==0 ) {
5172 if ( _cnt237>=1 ) {
break _loop237; }
else {
throw new NoViableAltException(_t);}
5179 _t = _t.getNextSibling();
5181 catch (RecognitionException ex) {
5182 if (inputState.guessing==0) {
5184 if (_t!=
null) {_t = _t.getNextSibling();}
5194 TNode strOptExprPair_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5202 if (_t==
null) _t=ASTNULL;
5203 switch ( _t.getType()) {
5208 _t = _t.getNextSibling();
5209 if ( inputState.guessing==0 ) {
5216 _t = _t.getNextSibling();
5217 if ( inputState.guessing==0 ) {
5230 throw new NoViableAltException(_t);
5235 catch (RecognitionException ex) {
5236 if (inputState.guessing==0) {
5238 if (_t!=
null) {_t = _t.getNextSibling();}
5248 TNode binaryOperator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5251 if (_t==
null) _t=ASTNULL;
5252 switch ( _t.getType()) {
5257 _t = _t.getNextSibling();
5264 _t = _t.getNextSibling();
5271 _t = _t.getNextSibling();
5278 _t = _t.getNextSibling();
5285 _t = _t.getNextSibling();
5292 _t = _t.getNextSibling();
5299 _t = _t.getNextSibling();
5306 _t = _t.getNextSibling();
5313 _t = _t.getNextSibling();
5320 _t = _t.getNextSibling();
5327 _t = _t.getNextSibling();
5334 _t = _t.getNextSibling();
5341 _t = _t.getNextSibling();
5348 _t = _t.getNextSibling();
5355 _t = _t.getNextSibling();
5362 _t = _t.getNextSibling();
5369 _t = _t.getNextSibling();
5376 _t = _t.getNextSibling();
5383 _t = _t.getNextSibling();
5390 _t = _t.getNextSibling();
5397 _t = _t.getNextSibling();
5404 _t = _t.getNextSibling();
5411 _t = _t.getNextSibling();
5418 _t = _t.getNextSibling();
5425 _t = _t.getNextSibling();
5432 _t = _t.getNextSibling();
5439 _t = _t.getNextSibling();
5446 _t = _t.getNextSibling();
5453 _t = _t.getNextSibling();
5460 _t = _t.getNextSibling();
5465 throw new NoViableAltException(_t);
5469 catch (RecognitionException ex) {
5470 if (inputState.guessing==0) {
5472 if (_t!=
null) {_t = _t.getNextSibling();}
5482 TNode unaryOperator_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5485 if (_t==
null) _t=ASTNULL;
5486 switch ( _t.getType()) {
5491 _t = _t.getNextSibling();
5498 _t = _t.getNextSibling();
5505 _t = _t.getNextSibling();
5512 _t = _t.getNextSibling();
5519 _t = _t.getNextSibling();
5526 _t = _t.getNextSibling();
5533 _t = _t.getNextSibling();
5540 _t = _t.getNextSibling();
5547 _t = _t.getNextSibling();
5552 throw new NoViableAltException(_t);
5556 catch (RecognitionException ex) {
5557 if (inputState.guessing==0) {
5559 if (_t!=
null) {_t = _t.getNextSibling();}
5569 TNode argExprList_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5577 if (_t==
null) _t=ASTNULL;
5579 if ( inputState.guessing==0 ) {
5592 catch (RecognitionException ex) {
5593 if (inputState.guessing==0) {
5595 if (_t!=
null) {_t = _t.getNextSibling();}
5603 protected final void charConst(AST _t)
throws RecognitionException {
5605 TNode charConst_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5611 _t = _t.getNextSibling();
5612 if ( inputState.guessing==0 ) {
5616 catch (RecognitionException ex) {
5617 if (inputState.guessing==0) {
5619 if (_t!=
null) {_t = _t.getNextSibling();}
5627 protected final void intConst(AST _t)
throws RecognitionException {
5629 TNode intConst_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5632 if (_t==
null) _t=ASTNULL;
5633 switch ( _t.getType()) {
5638 _t = _t.getNextSibling();
5645 _t = _t.getNextSibling();
5652 _t = _t.getNextSibling();
5659 _t = _t.getNextSibling();
5666 _t = _t.getNextSibling();
5673 _t = _t.getNextSibling();
5680 _t = _t.getNextSibling();
5687 _t = _t.getNextSibling();
5694 _t = _t.getNextSibling();
5699 throw new NoViableAltException(_t);
5703 catch (RecognitionException ex) {
5704 if (inputState.guessing==0) {
5706 if (_t!=
null) {_t = _t.getNextSibling();}
5714 protected final void floatConst(AST _t)
throws RecognitionException {
5716 TNode floatConst_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5719 if (_t==
null) _t=ASTNULL;
5720 switch ( _t.getType()) {
5725 _t = _t.getNextSibling();
5732 _t = _t.getNextSibling();
5739 _t = _t.getNextSibling();
5744 throw new NoViableAltException(_t);
5748 catch (RecognitionException ex) {
5749 if (inputState.guessing==0) {
5751 if (_t!=
null) {_t = _t.getNextSibling();}
5759 public final void commaExpr(AST _t)
throws RecognitionException {
5761 TNode commaExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5767 _t = _t.getFirstChild();
5773 _t = _t.getNextSibling();
5775 catch (RecognitionException ex) {
5776 if (inputState.guessing==0) {
5778 if (_t!=
null) {_t = _t.getNextSibling();}
5786 public final void assignExpr(AST _t)
throws RecognitionException {
5788 TNode assignExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5791 if (_t==
null) _t=ASTNULL;
5792 switch ( _t.getType()) {
5798 _t = _t.getFirstChild();
5804 _t = _t.getNextSibling();
5812 _t = _t.getFirstChild();
5818 _t = _t.getNextSibling();
5826 _t = _t.getFirstChild();
5832 _t = _t.getNextSibling();
5840 _t = _t.getFirstChild();
5846 _t = _t.getNextSibling();
5854 _t = _t.getFirstChild();
5860 _t = _t.getNextSibling();
5868 _t = _t.getFirstChild();
5874 _t = _t.getNextSibling();
5882 _t = _t.getFirstChild();
5888 _t = _t.getNextSibling();
5896 _t = _t.getFirstChild();
5902 _t = _t.getNextSibling();
5910 _t = _t.getFirstChild();
5916 _t = _t.getNextSibling();
5924 _t = _t.getFirstChild();
5930 _t = _t.getNextSibling();
5938 _t = _t.getFirstChild();
5944 _t = _t.getNextSibling();
5949 throw new NoViableAltException(_t);
5953 catch (RecognitionException ex) {
5954 if (inputState.guessing==0) {
5956 if (_t!=
null) {_t = _t.getNextSibling();}
5966 TNode logicalOrExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5972 _t = _t.getFirstChild();
5978 _t = _t.getNextSibling();
5980 catch (RecognitionException ex) {
5981 if (inputState.guessing==0) {
5983 if (_t!=
null) {_t = _t.getNextSibling();}
5993 TNode logicalAndExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
5999 _t = _t.getFirstChild();
6005 _t = _t.getNextSibling();
6007 catch (RecognitionException ex) {
6008 if (inputState.guessing==0) {
6010 if (_t!=
null) {_t = _t.getNextSibling();}
6020 TNode inclusiveOrExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6026 _t = _t.getFirstChild();
6032 _t = _t.getNextSibling();
6034 catch (RecognitionException ex) {
6035 if (inputState.guessing==0) {
6037 if (_t!=
null) {_t = _t.getNextSibling();}
6047 TNode exclusiveOrExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6053 _t = _t.getFirstChild();
6059 _t = _t.getNextSibling();
6061 catch (RecognitionException ex) {
6062 if (inputState.guessing==0) {
6064 if (_t!=
null) {_t = _t.getNextSibling();}
6072 public final void bitAndExpr(AST _t)
throws RecognitionException {
6074 TNode bitAndExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6080 _t = _t.getFirstChild();
6086 _t = _t.getNextSibling();
6088 catch (RecognitionException ex) {
6089 if (inputState.guessing==0) {
6091 if (_t!=
null) {_t = _t.getNextSibling();}
6101 TNode equalityExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6104 if (_t==
null) _t=ASTNULL;
6105 switch ( _t.getType()) {
6111 _t = _t.getFirstChild();
6117 _t = _t.getNextSibling();
6125 _t = _t.getFirstChild();
6131 _t = _t.getNextSibling();
6136 throw new NoViableAltException(_t);
6140 catch (RecognitionException ex) {
6141 if (inputState.guessing==0) {
6143 if (_t!=
null) {_t = _t.getNextSibling();}
6153 TNode relationalExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6156 if (_t==
null) _t=ASTNULL;
6157 switch ( _t.getType()) {
6163 _t = _t.getFirstChild();
6169 _t = _t.getNextSibling();
6177 _t = _t.getFirstChild();
6183 _t = _t.getNextSibling();
6191 _t = _t.getFirstChild();
6197 _t = _t.getNextSibling();
6205 _t = _t.getFirstChild();
6211 _t = _t.getNextSibling();
6216 throw new NoViableAltException(_t);
6220 catch (RecognitionException ex) {
6221 if (inputState.guessing==0) {
6223 if (_t!=
null) {_t = _t.getNextSibling();}
6231 public final void shiftExpr(AST _t)
throws RecognitionException {
6233 TNode shiftExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6236 if (_t==
null) _t=ASTNULL;
6237 switch ( _t.getType()) {
6243 _t = _t.getFirstChild();
6249 _t = _t.getNextSibling();
6257 _t = _t.getFirstChild();
6263 _t = _t.getNextSibling();
6268 throw new NoViableAltException(_t);
6272 catch (RecognitionException ex) {
6273 if (inputState.guessing==0) {
6275 if (_t!=
null) {_t = _t.getNextSibling();}
6285 TNode additiveExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6288 if (_t==
null) _t=ASTNULL;
6289 switch ( _t.getType()) {
6295 _t = _t.getFirstChild();
6301 _t = _t.getNextSibling();
6309 _t = _t.getFirstChild();
6315 _t = _t.getNextSibling();
6320 throw new NoViableAltException(_t);
6324 catch (RecognitionException ex) {
6325 if (inputState.guessing==0) {
6327 if (_t!=
null) {_t = _t.getNextSibling();}
6335 public final void multExpr(AST _t)
throws RecognitionException {
6337 TNode multExpr_AST_in = (_t == ASTNULL) ?
null : (
TNode)_t;
6340 if (_t==
null) _t=ASTNULL;
6341 switch ( _t.getType()) {
6347 _t = _t.getFirstChild();
6353 _t = _t.getNextSibling();
6361 _t = _t.getFirstChild();
6367 _t = _t.getNextSibling();
6375 _t = _t.getFirstChild();
6381 _t = _t.getNextSibling();
6386 throw new NoViableAltException(_t);
6390 catch (RecognitionException ex) {
6391 if (inputState.guessing==0) {
6393 if (_t!=
null) {_t = _t.getNextSibling();}
6406 "NULL_TREE_LOOKAHEAD",
6506 "UnsignedOctalConst",
6514 "DoubleDoubleConst",
6519 "NStructDeclarator",
6524 "NFunctionCallArgs",
6525 "NNonemptyAbstractDeclarator",
6529 "NParameterTypeList",
6531 "NCompoundStatement",
6532 "NParameterDeclaration",
6539 "NInitializerElementLabel",
6540 "NLcurlyInitializer",
6572 private static final long[] mk_tokenSet_0() {
6573 long[] data = { 544L, -9214364837600034816L, 4096L, 0L, 0L, 0L};
6577 private static final long[] mk_tokenSet_1() {
6578 long[] data = { 134093888L, 562949953421312L, 25769803776L, 0L, 0L, 0L};
6582 private static final long[] mk_tokenSet_2() {
6583 long[] data = { -4616189618054757888L, 1152921504606846976L, 17L, 0L, 0L, 0L};
6587 private static final long[] mk_tokenSet_3() {
6588 long[] data = { 250688651132928L, 2972375790571749375L, 69793221356L, 0L, 0L, 0L};
final void initDecl(AST _t)
final void translationUnit(AST _t)
final void nonemptyAbstractDeclarator(AST _t)
final void additiveExpr(AST _t)
final void structDeclarationList(AST _t)
final void declSpecifiers(AST _t)
final void initializerElementLabel(AST _t)
final void statement(AST _t)
static final BitSet _tokenSet_0
void matchNot(AST t, int ttype)
static final BitSet _tokenSet_2
GnuCEmitter(PreprocessorInfoChannel preprocChannel)
final void localLabelDecl(AST _t)
final void charConst(AST _t)
final void storageClassSpecifier(AST _t)
final void floatConst(AST _t)
final void lcurlyInitializer(AST _t)
final void attributeDecl(AST _t)
final void logicalOrExpr(AST _t)
final void typelessDeclaration(AST _t)
final void functionDeclSpecifiers(AST _t)
void match(AST t, int ttype)
final void enumList(AST _t)
final void specifierQualifierList(AST _t)
void reportError(MismatchedTokenException ex)
final void idList(AST _t)
final void structDeclaration(AST _t)
void reportWarning(String s)
void reportError(String s)
final void functionStorageClassSpecifier(AST _t)
final void relationalExpr(AST _t)
final void assignExpr(AST _t)
static final String[] _tokenNames
final void statementBody(AST _t)
final void rangeExpr(AST _t)
final void enumerator(AST _t)
final void initializer(AST _t)
final void intConst(AST _t)
final void primaryExpr(AST _t)
final void structSpecifier(AST _t)
void traceIn(String rname, AST t)
final void statementList(AST _t)
final void declaration(AST _t)
final void stringConst(AST _t)
final void structOrUnionBody(AST _t)
final void typeQualifier(AST _t)
final void bitAndExpr(AST _t)
final void shiftExpr(AST _t)
final void strOptExprPair(AST _t)
final void compoundStatement(AST _t)
void reportError(NoViableAltException ex)
void traceOut(String rname, AST t)
final void functionDef(AST _t)
final void initializerList(AST _t)
final void argExprList(AST _t)
final void commaExpr(AST _t)
final void unaryExpr(AST _t)
final void unaryOperator(AST _t)
final void pointerGroup(AST _t)
final void externalList(AST _t)
final void enumSpecifier(AST _t)
final void asm_expr(AST _t)
final void typedefName(AST _t)
final void initDeclList(AST _t)
final void typeName(AST _t)
void reportError(RecognitionException ex)
final void equalityExpr(AST _t)
static final BitSet _tokenSet_1
final void structDeclaratorList(AST _t)
final void structDeclarator(AST _t)
final void multExpr(AST _t)
final void emptyExpr(AST _t)
final void typeSpecifier(AST _t)
final void castExpr(AST _t)
final void gnuAsmExpr(AST _t)
final void externalDef(AST _t)
final void binaryOperator(AST _t)
void match(AST t, BitSet b)
final void logicalAndExpr(AST _t)
final void exclusiveOrExpr(AST _t)
final void unionSpecifier(AST _t)
final void inclusiveOrExpr(AST _t)
final void binaryExpr(AST _t)
final void declarationList(AST _t)
final void postfixExpr(AST _t)
final void declarator(AST _t)
final void compoundStatementExpr(AST _t)
final void parameterDeclaration(AST _t)
static final BitSet _tokenSet_3
final void parameterTypeList(AST _t)
final void conditionalExpr(AST _t)
Vector< Object > extractLinesPrecedingTokenNumber(final Integer toknum)
Class TNode is an implementation of the AST interface and adds many useful features:
static void printTree(final AST t)
print given tree to System.out
int NInitializerElementLabel
int NNonemptyAbstractDeclarator
int NParameterDeclaration