JFlex

Class Emitter


public final class Emitter
extends java.lang.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

void
emit()
Main Emitter method.
void
emitActionTable()
static boolean
endsWithJavadoc(StringBuffer usercode)
Try to find out if user code ends with a javadoc comment
static String
getBaseName(String className)
Computes base name of the class name.
static File
normalize(String name, File input)
Constructs a file in Options.getDir() or in the same directory as another file.

Constructor Details

Emitter

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

Method Details

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:
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

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
input - fall back location if path = null (expected to be a file in the directory to write to)