bcg
Class FrontEnd

java.lang.Object
  extended by bcg.FrontEnd

public class FrontEnd
extends java.lang.Object

Front-end to the BCG language


Field Summary
protected static java.lang.String USAGE
           
 
Constructor Summary
FrontEnd()
           
 
Method Summary
static void main(java.lang.String[] args)
          Compile and/or run a BCG program.
protected static void unknown(java.lang.String opt)
           
protected static void usage()
           
protected static void usage(int code)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USAGE

protected static final java.lang.String USAGE
See Also:
Constant Field Values
Constructor Detail

FrontEnd

public FrontEnd()
Method Detail

unknown

protected static void unknown(java.lang.String opt)

usage

protected static void usage()

usage

protected static void usage(int code)

main

public static void main(java.lang.String[] args)
Compile and/or run a BCG program. java -cp bcg.jar FrontEnd [<options>] [--] [<file>] Where options includes: -v prints stack traces on exceptions -d[rpsa] Print debug information (parse trees) Bare -d is the same as -ds -dr prints the raw parse tree via toString -dp prints the parse tree with types and indenting -ds prints the syntax tree (AST) -sa prints all the above -n Do not run code. Most useful with -d options -i Interprets the code rather than compiling -c Compiles to a class file instead of running directly. Requires either a source file (not standard in) or the -o option. -o <name> Sets the output class name (Implies -c) Note: -n, -i and -c are mutually exclusive -- Stops option parsing. If there is no file provided on the command line, it reads from standard input. To force this, use "-" as the file name. Only one file can be given at a time.



Written by Brian Gernhardt for Compiler Construction at RIT, Winter 2010