public class Main extends Object
LBJava stands for Learning Based Java. LBJava is a language for building systems that learn.
java edu.illinois.cs.cogcomp.lbjava.Main [options] <source file>
-c |
Compile only: This option tells LBJava to translate the given source to Java, but not to compile the generated Java sources or do any training. |
-d <directory> |
Any class files generated during compilation will be written in the specified directory, just
like javac 's -d command line parameter. |
-j <a> |
Sends the contents of <a> to javac as command line arguments
while compiling. Don't forget to put quotes around <a> if there is more than
one such argument or if the argument has a parameter. |
-s |
Print the names of all declarations and quit. |
-t <n> |
Enables default progress output during training. A message is printed every
<n> examples while training any classifier whose learn expression
doesn't contain a progressOutput clause. |
-v |
Prints the version number and exits. |
-w |
Disables the output of warning messages. Currenlty, there are only two types of warnings. A warning is reported if a constraint declaration does not contain any constraint statements, and a warning is reported if a learner's type is less specific than the declared type of the classifier it's being used in. |
-x |
Clean: Delete all files that would otherwise be generated. No code is generated and no training takes place. |
-generatedsourcepath <directory> -gsp <directory> |
LBJava will potentially generate many Java source files. Use this option to have LBJava write
them to the specified directory instead of the current directory. <directory>
must already exist. Note that LBJava will also compile these files which can result in even more
class files than there were sources. Those class files will also be written in
<directory> unless the -d command line parameter is utilized as
well. |
-sourcepath <path> |
If the LBJava source depends on classes whose source files cannot be found on the user's
classpath, specify the directories where they can be found using this parameter. It works just
like javac 's -sourcepath command line parameter. |
--parserDebug |
Debug: Debug output for parse phase only. |
--lexerOutput |
Lexer output: Print lexical token stream and quit. |
--parserOutput |
Parser output: Print the parsed AST and quit. |
--semanticOutput |
Semantic analysis output: Print semantic analysis information and quit. |
Modifier and Type | Field and Description |
---|---|
static String |
classDirectory
The directory in which Javac will place class files (with subdirectories mimicing the package
name included).
|
static String |
classPackageDirectory
The directory in which class files should be written, not including the subdirectory
structure that mimics the package.
|
static String |
classPath
The directory in which to search for source files.
|
static boolean |
clean
This flag is set to
true if cleaning has been enabled on the command line. |
static boolean |
concurrentTraining
This flag is set if concurrent training has been enabled.
|
static HashSet<String> |
fileNames
A list of names of files generated by the compiler, created as they are generated.
|
static String |
generatedSourceDirectory
The directory in which to write generated Java source files (with subdirectories mimicing the
package name included).
|
static String |
javacArguments
Holds command line arguments to be sent to
javac when compiling. |
static boolean |
printSymbols
This flag is set if symbol printing is enabled on the command line.
|
static String |
sourceDirectory
The relative path to the LBJava source file.
|
static String |
sourceFileBase
The source file's name without the
.lbj extension. |
static String |
sourceFilename
The name of the LBJava source file as specified on the command line.
|
static String |
sourcePath
The directory in which to search for source files.
|
static boolean |
warningsDisabled
This flag is set if warnings have been disabled on the command line.
|
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
The main compiler driver.
|
static void |
PrintUsage()
Print a usage message.
|
static void |
runSemanticAnalysis(AST ast)
Runs the semantic analysis pass on the specified AST, then prints errors and warnings if they
exist, and finally sets the
generatedSourceDirectory and classDirectory
variables. |
public static boolean clean
true
if cleaning has been enabled on the command line.public static boolean concurrentTraining
public static boolean warningsDisabled
public static boolean printSymbols
public static String sourceDirectory
public static String sourceFilename
public static String sourceFileBase
.lbj
extension.public static String javacArguments
javac
when compiling.public static HashSet<String> fileNames
public static String classDirectory
public static String classPackageDirectory
public static String classPath
public static String sourcePath
public static String generatedSourceDirectory
public static void main(String[] args) throws Exception
args
- The user's command line arguments are found here.Exception
- An exception is thrown when any error occurs.public static void runSemanticAnalysis(AST ast)
generatedSourceDirectory
and classDirectory
variables.ast
- The AST.public static void PrintUsage()
Copyright © 2016. All rights reserved.