public class ParserCompiler extends Object implements ClassCompiler, ParserConstants
ARG, COLUMNSTACK, CUR, CURTOK, CURTYPE, EOF, ERROR, GETEXPECTED, GETRULE, GETTOKEN, IN, INPUT, INPUTREADER, LAINPUT, LALENGTH, LASTATE, LATOKEN, LINESTACK, OFFSETSTACK, PARSEMETHODPREFIX, RULE, SOURCESTACK, SP, STATESTACK, THIS, THROWABLE, TOKEN, TYPESTACK, VALUESTACK| Constructor and Description |
|---|
ParserCompiler(Class<?> superClass)
Creates a parser using annotations in parserClass.
|
ParserCompiler(Class<?> superClass,
Grammar grammar)
Creates a parser using grammar.
|
ParserCompiler(ClassWrapper thisClass,
Grammar grammar)
Creates a parser using grammar.
|
| Modifier and Type | Method and Description |
|---|---|
void |
compile()
Compile classfile
|
void |
createSource(File dir)
Creates a byte code source file to dir.
|
File |
getClassDir() |
int |
getLrkLevel() |
File |
getSrcDir() |
Class<?> |
loadDynamic()
Compile the parser class dynamically.
|
Object |
parserInstance() |
void |
saveClass()
Saves Parser class in java classfile format in dir.
|
void |
setClassDir(File classDir)
Set the directory for class files
|
void |
setDebug(boolean debug)
Deprecated.
|
void |
setSrcDir(File srcDir)
Set the directory for source files and documents
|
public ParserCompiler(Class<?> superClass)
throws IOException,
ReflectiveOperationException
superClass - fullyQualifiedname - NoSuchMethodExceptionIOExceptionNoSuchFieldExceptionClassNotFoundExceptionReflectiveOperationExceptionpublic ParserCompiler(Class<?> superClass,
Grammar grammar)
throws IOException,
ReflectiveOperationException
superClass - Super class for parser. Possible parser annotations
are not processed.grammar - The grammarNoSuchMethodExceptionIOExceptionNoSuchFieldExceptionReflectiveOperationExceptionpublic ParserCompiler(ClassWrapper thisClass, Grammar grammar) throws IOException, ReflectiveOperationException
superClass - Super class for parser. Possible parser annotations
are not processed.fullyQualifiedname - Parser class name .grammar - NoSuchMethodExceptionIOExceptionNoSuchFieldExceptionClassNotFoundExceptionReflectiveOperationExceptionpublic void compile()
throws IOException,
ReflectiveOperationException
ClassCompilercompile in interface ClassCompilerIOExceptionReflectiveOperationExceptionpublic int getLrkLevel()
public void saveClass()
throws IOException
saveClass in interface ClassCompilerIOExceptionpublic void createSource(File dir)
throws IOException
dir - IOExceptionpublic Class<?> loadDynamic()
IOExceptionInstantiationExceptionIllegalAccessExceptionpublic Object parserInstance()
public void setDebug(boolean debug)
debug - public void setClassDir(File classDir)
ClassCompilersetClassDir in interface ClassCompilerpublic void setSrcDir(File srcDir)
ClassCompilersetSrcDir in interface ClassCompilerpublic File getClassDir()
public File getSrcDir()