diff options
Diffstat (limited to 'src/antlr/com')
-rw-r--r-- | src/antlr/com/jogamp/gluegen/cgram/GnuCParser.g | 20 | ||||
-rw-r--r-- | src/antlr/com/jogamp/gluegen/cgram/StdCParser.g | 18 |
2 files changed, 29 insertions, 9 deletions
diff --git a/src/antlr/com/jogamp/gluegen/cgram/GnuCParser.g b/src/antlr/com/jogamp/gluegen/cgram/GnuCParser.g index bf01b12..88dbc1e 100644 --- a/src/antlr/com/jogamp/gluegen/cgram/GnuCParser.g +++ b/src/antlr/com/jogamp/gluegen/cgram/GnuCParser.g @@ -35,7 +35,9 @@ options exportVocab = GNUC; buildAST = true; ASTLabelType = "TNode"; - + + genHashLines = true; + // Copied following options from java grammar. codeGenMakeSwitchThreshold = 2; codeGenBitsetTestThreshold = 3; @@ -51,7 +53,7 @@ options // source for names to unnamed scopes protected int unnamedScopeCounter = 0; - + public boolean isTypedefName(String name) { boolean returnValue = false; TNode node = symbolTable.lookupNameInCurrentScope(name); @@ -77,6 +79,16 @@ options symbolTable.popScope(); } + protected boolean debugging = false; + + public boolean getDebug() { + return debugging; + } + + public void setDebug(boolean debug) { + this.debugging = debug; + } + int traceDepth = 0; public void reportError(RecognitionException ex) { try { @@ -94,9 +106,7 @@ options public void reportWarning(String s) { System.err.println("ANTLR Parsing Warning from String: " + s); } - public void match(int t) throws MismatchedTokenException { - boolean debugging = false; - + public void match(int t) throws MismatchedTokenException { if ( debugging ) { for (int x=0; x<traceDepth; x++) System.out.print(" "); try { diff --git a/src/antlr/com/jogamp/gluegen/cgram/StdCParser.g b/src/antlr/com/jogamp/gluegen/cgram/StdCParser.g index 26da996..3279826 100644 --- a/src/antlr/com/jogamp/gluegen/cgram/StdCParser.g +++ b/src/antlr/com/jogamp/gluegen/cgram/StdCParser.g @@ -64,10 +64,12 @@ options exportVocab = STDC; buildAST = true; ASTLabelType = "TNode"; + + genHashLines = true; // Copied following options from java grammar. codeGenMakeSwitchThreshold = 2; - codeGenBitsetTestThreshold = 3; + codeGenBitsetTestThreshold = 3; } @@ -80,7 +82,7 @@ options // source for names to unnamed scopes protected int unnamedScopeCounter = 0; - + public boolean isTypedefName(String name) { boolean returnValue = false; TNode node = symbolTable.lookupNameInCurrentScope(name); @@ -106,6 +108,16 @@ options symbolTable.popScope(); } + protected boolean debugging = false; + + public boolean getDebug() { + return debugging; + } + + public void setDebug(boolean debug) { + this.debugging = debug; + } + int traceDepth = 0; public void reportError(RecognitionException ex) { try { @@ -124,8 +136,6 @@ options System.err.println("ANTLR Parsing Warning from String: " + s); } public void match(int t) throws MismatchedTokenException { - boolean debugging = false; - if ( debugging ) { for (int x=0; x<traceDepth; x++) System.out.print(" "); try { |