JFlex

Class Emitter

public final class Emitter extends Object

This class manages the actual code generation, putting the scanner together, filling in skeleton sections etc. Table compression, String packing etc. is also done here.
Constructor Summary
Emitter(File inputFile, LexParse parser, DFA dfa)
Method Summary
voidemit()
Main Emitter method.
voidemitActionTable()
static booleanendsWithJavadoc(StringBuffer usercode)
Try to find out if user code ends with a javadoc comment
static StringgetBaseName(String className)
Computes base name of the class name.
static Filenormalize(String name, File input)
Constructs a file in Options.getDir() or in the same directory as another file.

Constructor Detail

Emitter

public Emitter(File inputFile, LexParse parser, DFA dfa)

Method Detail

emit

public void emit()
Main Emitter method.

emitActionTable

public void emitActionTable()

endsWithJavadoc

public static boolean endsWithJavadoc(StringBuffer usercode)
Try to find out if user code ends with a javadoc comment

Parameters: buffer the user code

Returns: true if it ends with a javadoc comment

getBaseName

public static String getBaseName(String className)
Computes base name of the class name. Needs to take into account generics.

Returns: the

See Also: className

normalize

public static File normalize(String name, File input)
Constructs a file in Options.getDir() or in the same directory as another file. Makes a backup if the file already exists.

Parameters: name the name (without path) of the file path the path where to construct the file input fall back location if path = null (expected to be a file in the directory to write to)