,
who has given permission for it to be distributed under the GPL.
ExtendedCommonASTWithHiddenTokens.java: this adds a necessary
initialize() method, as well as a number of methods to allow for XML
serialization of the parse tree in a such a way that the hidden tokens
are visible. Much of the code is taken from the original
CommonASTWithHiddenTokens class. I hope to convince the ANTLR folks
to fold these changes back into that class so that this file will be
unnecessary.
TokenStreamCopyingHiddenTokenFilter.java: this class provides
TokenStreamHiddenTokenFilters with the concept of tokens which can be
copied so that they are seen by both the hidden token stream as well
as the parser itself. This is useful when one wants to use an
existing parser (like the Java parser included with ANTLR) that throws
away some tokens to create a parse tree which can be used to spit out
a copy of the code with only minor modifications. Partially derived
from ANTLR code. I hope to convince the ANTLR folks to fold this
functionality back into ANTLR proper as well.
whitespace_test.pde: a torture test to ensure that the
preprocessor is correctly preserving whitespace, comments, and other
hidden tokens correctly. See the comments in the code for details about
how to run the test.
All other files in this directory are generated at build time by ANTLR
itself. The ANTLR manual goes into a fair amount of detail about the
what each type of file is for.
Method Summary |
java.util.ArrayList<java.lang.String> |
getExtraImports()
|
java.lang.String |
write()
preprocesses a pde file and write out a java file |
int |
writePrefix(java.lang.String program,
java.lang.String buildPath,
java.lang.String name,
java.lang.String[] codeFolderPackages)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STATIC
public static final int STATIC
- See Also:
- Constant Field Values
ACTIVE
public static final int ACTIVE
- See Also:
- Constant Field Values
JAVA
public static final int JAVA
- See Also:
- Constant Field Values
programType
public static int programType
foundMain
public static boolean foundMain
filter
public static TokenStreamCopyingHiddenTokenFilter filter
- Used by PdeEmitter.dumpHiddenTokens()
PdePreprocessor
public PdePreprocessor()
- Setup a new preprocessor.
writePrefix
public int writePrefix(java.lang.String program,
java.lang.String buildPath,
java.lang.String name,
java.lang.String[] codeFolderPackages)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
write
public java.lang.String write()
throws java.lang.Exception
- preprocesses a pde file and write out a java file
- Returns:
- the classname of the exported Java
- Throws:
java.lang.Exception
getExtraImports
public java.util.ArrayList<java.lang.String> getExtraImports()