JFlex
Class Emitter

java.lang.Object
  extended by JFlex.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(java.io.File inputFile, LexParse parser, DFA dfa)
           
 
Method Summary
 void emit()
          Main Emitter method.
 void emitActionTable()
           
static boolean endsWithJavadoc(java.lang.StringBuffer usercode)
          Try to find out if user code ends with a javadoc comment
static java.lang.String getBaseName(java.lang.String className)
          Computes base name of the class name.
static java.io.File normalize(java.lang.String name, java.io.File input)
          Constructs a file in Options.getDir() or in the same directory as another file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Emitter

public Emitter(java.io.File inputFile,
               LexParse parser,
               DFA dfa)
        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getBaseName

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

Returns:
the
See Also:
LexScan.className

normalize

public static java.io.File normalize(java.lang.String name,
                                     java.io.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)

endsWithJavadoc

public static boolean endsWithJavadoc(java.lang.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

emitActionTable

public void emitActionTable()

emit

public void emit()
Main Emitter method.