Object-oriented Parser System
v3.6

oops3
Class Gen

Object
  extended by Utils
      extended by Gen
All Implemented Interfaces:
Symbols

public abstract class Gen
extends Utils

ParserFactory aspect: generate source code. Uses package access.

Version:
3.6.0

Field Summary
static ResourceBundle templates
          MessageFormat.format templates to generate output.
 
Fields inherited from class Utils
error
 
Fields inherited from interface Symbols
badInput, endOfFile, firstSymbol, noInput
 
Constructor Summary
Gen()
           
 
Method Summary
static void actions(PrintWriter out, Parser parser)
          generate actions interface.
static void epilog(PrintWriter out, Parser parser)
          output epilog.
static void factory(PrintWriter out, Parser parser)
          generate tree factory.
static void factory(PrintWriter out, Parser parser, String name)
          generate tree factory.
protected static String format(String key, Object... args)
          format a string from the resource file.
static void jlex(PrintWriter out, Parser parser)
          generate JLex-based scanner.
static void jlexSource(PrintWriter out, Parser parser)
          generate source of JLex-based scanner.
static void main(PrintWriter out, String parser, boolean addNull, String className)
          output main program for compiler.
static void prolog(PrintWriter out, Parser parser)
          output prolog.
 
Methods inherited from class Utils
className, error, error, fromString, getError, message, testScanner, toChars, toString, toString, warning, warning
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templates

public static final ResourceBundle templates
MessageFormat.format templates to generate output. The property Gen.properties overwrites the filename stem.

Constructor Detail

Gen

public Gen()
Method Detail

format

protected static String format(String key,
                               Object... args)
format a string from the resource file.

Parameters:
args - can be null if none.

prolog

public static void prolog(PrintWriter out,
                          Parser parser)
output prolog.


main

public static void main(PrintWriter out,
                        String parser,
                        boolean addNull,
                        String className)
output main program for compiler.


jlex

public static void jlex(PrintWriter out,
                        Parser parser)
                 throws IOException
generate JLex-based scanner. Requires patched version of JLex.

Throws:
IOException

jlexSource

public static void jlexSource(PrintWriter out,
                              Parser parser)
generate source of JLex-based scanner.


actions

public static void actions(PrintWriter out,
                           Parser parser)
generate actions interface.


factory

public static void factory(PrintWriter out,
                           Parser parser)
generate tree factory. Backward compatibility: default factory name.


factory

public static void factory(PrintWriter out,
                           Parser parser,
                           String name)
generate tree factory. If visitor (and optionally param) is set in the properties file the tree factory will implement a visitor pattern.

Parameters:
name - for the tree factory class, Tree if null or empty.

epilog

public static void epilog(PrintWriter out,
                          Parser parser)
output epilog.



(c) 2008 Axel T. Schreiner