|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fri.patterns.interpreter.parsergenerator.builder.CompiledTables
This class is deprecated in favor of serialization.
CompiledTables buffers parser tables by generating source and compiling that source. This lasts very long at first time, but is faster than serialization for every subsequent call. The class will be posted in current directory (has no package). The source gets removed after successful compilation. The Sun compiler must be in package path, which is normally in $JAVA_HOME/lib/tools.jar.
Building compiled Java ParserTables takes 1600, building from scratch takes 6000 millis. CompiledTables seem to be slower than SerializedParser!
An alternative to compiled tables is generating the parser tables source with SourceGenerator and integrating that source into project sources. This avoids the dynamically created class in working directory and the neccessity to have javac in CLASSPATH at runtime.
ParserTables tables = new CompiledTables().get(syntaxInput, "MyParserTables");
Field Summary | |
static java.lang.String |
CLASSFILE_SUFFIX
Deprecated. The suffix for compiled ParserTables files. |
Constructor Summary | |
CompiledTables()
Deprecated. Creates a parser tables factory that uses compiled tables as buffer. |
|
CompiledTables(boolean development)
Deprecated. Creates a parser tables factory that uses compiled tables as buffer. |
Method Summary | |
protected int |
compile(java.lang.String javaFile)
Deprecated. Aufruf des Sun-Compilers. |
AbstractParserTables |
get(java.lang.Class parserType,
java.lang.Object syntaxInput,
java.lang.String className)
Deprecated. Builds the ParserTables from scratch if not found as class in CLASSPATH, else loads that class. |
AbstractParserTables |
get(java.lang.Object syntaxInput)
Deprecated. Builds the ParserTables from scratch if not found as class in CLASSPATH, else loads that class. |
AbstractParserTables |
get(java.lang.Object syntaxInput,
java.lang.String className)
Deprecated. Builds the ParserTables from scratch if not found as class in CLASSPATH, else loads that class. |
static void |
main(java.lang.String[] args)
Deprecated. Test main. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CLASSFILE_SUFFIX
Constructor Detail |
public CompiledTables()
public CompiledTables(boolean development)
Method Detail |
public AbstractParserTables get(java.lang.Object syntaxInput) throws java.lang.Exception
syntaxInput
- the Parser syntax as File, InputStream, List of Lists, String [][] or Syntax.
java.lang.Exception
public AbstractParserTables get(java.lang.Object syntaxInput, java.lang.String className) throws java.lang.Exception
syntaxInput
- the Parser syntax as File, InputStream, List of Lists, String [][] or Syntax.className
- name of target class of ParserTables, without package path, without .java extension.
java.lang.Exception
public AbstractParserTables get(java.lang.Class parserType, java.lang.Object syntaxInput, java.lang.String className) throws java.lang.Exception
syntaxInput
- the Parser syntax as File, InputStream, List of Lists, String [][] or Syntax.className
- name of target class of ParserTables, without package path, without .java extension.parserType
- class of ParserTables to create, e.g. LALRParserTables.class
java.lang.Exception
protected int compile(java.lang.String javaFile)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |