summaryrefslogtreecommitdiffstats
path: root/src/antlr/com/jogamp/gluegen/cgram/StdCParser.g
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-10 10:39:47 +0200
committerSven Gothel <[email protected]>2023-08-10 10:39:47 +0200
commitb5ec911572aa0c07228fcb02976a8e848cc90391 (patch)
treea692955ec9fa91605dd710aa82f6b26d7c156fb1 /src/antlr/com/jogamp/gluegen/cgram/StdCParser.g
parent07c57a0d36c375f55e93f0caf7dd57e7c0afe271 (diff)
ANTLR Syntax: Add debugging facility for GnuCParser.g and StdCParser.g
Diffstat (limited to 'src/antlr/com/jogamp/gluegen/cgram/StdCParser.g')
-rw-r--r--src/antlr/com/jogamp/gluegen/cgram/StdCParser.g18
1 files changed, 14 insertions, 4 deletions
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 {