JFlex
Class Skeleton
public class Skeleton
extends java.lang.Object
This class stores the skeleton of generated scanners.
The skeleton consists of several parts that can be emitted to
a file. Usually there is a portion of generated code
(produced in class Emitter) between every two parts of skeleton code.
There is a static part (the skeleton code) and state based iterator
part to this class. The iterator part is used to emit consecutive skeleton
sections to some PrintWriter
.
static String[] | line - The skeleton
|
Skeleton(PrintWriter out) - Creates a new skeleton (iterator) instance.
|
void | emitNext() - Emits the next part of the skeleton
|
static void | makePrivate() - Make the skeleton private.
|
static void | readDefault() - (Re)load the default skeleton.
|
static void | readSkel(BufferedReader reader) - Reads an external skeleton file from a BufferedReader.
|
static void | readSkelFile(File skeletonFile) - Reads an external skeleton file for later use with this class.
|
static String | replace(String a, String b, String c) - Replaces a with b in c.
|
line
public static String[] line
The skeleton
Skeleton
public Skeleton(PrintWriter out)
Creates a new skeleton (iterator) instance.
out
- the writer to write the skeleton-parts to
emitNext
public void emitNext()
Emits the next part of the skeleton
makePrivate
public static void makePrivate()
Make the skeleton private.
Replaces all occurences of " public " in the skeleton with " private ".
readDefault
public static void readDefault()
(Re)load the default skeleton. Looks in the current system class path.
readSkel
public static void readSkel(BufferedReader reader)
throws IOException
Reads an external skeleton file from a BufferedReader.
reader
- the reader to read from (must be != null)
readSkelFile
public static void readSkelFile(File skeletonFile)
Reads an external skeleton file for later use with this class.
skeletonFile
- the file to read (must be != null and readable)
replace
public static String replace(String a,
String b,
String c)
Replaces a with b in c.
a
- the String to be replacedb
- the replacementc
- the String in which to replace a by b
- a String object with a replaced by b in c