| java.lang.Object fri.patterns.interpreter.parsergenerator.util.SourceGenerator
SourceGenerator | abstract public class SourceGenerator (Code) | | Java source generator. Following code generations are supported:
- SemanticSkeleton, code base for a Semantic-implementation of big syntaxes.
- Turn ParserTables (built from a Syntax) into compileable Java-code (for faster loading).
- Turn a Syntax object into compileable Java code (for faster loading).
SYNTAX: java fri.patterns.interpreter.parsergenerator.util.SourceGenerator [semantic|LALR|SLR|LR] file.syntax [file.syntax ...]
LALR|SLR|LR: Generates ParserTable implementation(s) of passed grammar file(s).
else: Generates Syntax implementation(s) of passed grammar file(s).
CAUTION: Files MUST have relative pathes!
author: (c) 2002, Fritz Ritzberger |
generateParserTable | public static void generateParserTable(AbstractParserTables parserTables, String className, String pkgName) throws Exception(Code) | | Generates Java code from parser tables. makes the output filename and calls parserTables.toSourceFile() then.
Parameters: parserTables - ParserTables for which the source should stand Parameters: className - basename of class to generate Parameters: pkgName - name of package of class to generate, can be null |
generateSemanticSkeleton | public static void generateSemanticSkeleton(Syntax syntax, String className, String pkgName) throws Exception(Code) | | Generates a semantic skeleton implementation for a given syntax.
Parameters: input - syntax the semantic is meant for Parameters: className - basename of class to generate, semantic will be named className+"Semantic.java" Parameters: pkgName - package-name of class to generate |
generateSyntaxImpl | public static void generateSyntaxImpl(Syntax syntax, String className, String pkgName, List initialNonterminals) throws IOException(Code) | | Generates a Java implementation from the passed Syntax object.
Parameters: syntax - Syntax to convert to Java code. Parameters: className - basename of class to generate Parameters: pkgName - name of package of class to generate |
main | public static void main(String[] args)(Code) | | Source generator main. Writes syntax to stderr when launched with no arguments or -h.
|
|
|