|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.lexgen.DefinitionFile
| Nested Class Summary | |
(package private) static class |
DefinitionFile.KeywordTokenInfo
This nested class serves as a data structure for accumulating information in #accumKeywords(List,String,List). |
| Field Summary | |
private static String |
DEFAULT_PREFIX
|
private TokenDefinition[] |
definitions
|
private List |
flags
An immutable list of identifier Strings representing the valid flags for keywords and literals in this vocabulary. |
private String |
packageName
|
private String |
prefix
|
private String |
sourceFile
|
private String |
vocabulary
|
| Constructor Summary | |
DefinitionFile(String sourceFile,
String packageName,
String vocabulary,
String prefix,
List flags,
ArrayList definitions)
Constructs a token definition file |
|
| Method Summary | |
(package private) boolean |
accumKeywords(List accum,
String prefix,
List legalFlags)
Accumulates a list of keyword token information in accum. |
int |
checkIdentifiers(Hashtable identifiers,
String prefix,
int id)
Check for duplicate identifiers |
List |
flags()
Returns an immutable list of identifier Strings representing the valid flags for keywords and literals in this vocabulary. |
String |
getClassName()
Returns the package name |
String |
getPackageName()
Returns the package name |
String |
getPrefix()
Returns the literal prefix |
String |
getVocabulary()
Returns the vocabulary name |
void |
printDefinition(PrintWriter out,
String prefix)
Prints token definitions to definition file (txt) |
void |
printInterface(PrintWriter out,
String parent)
Prints the token definition to interface file (java) |
static DefinitionFile |
read(String sourceFile)
Reads and parses an token definition file |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final String DEFAULT_PREFIX
private final String sourceFile
private final String packageName
private final String vocabulary
private final String prefix
private final List flags
private final TokenDefinition[] definitions
| Constructor Detail |
public DefinitionFile(String sourceFile,
String packageName,
String vocabulary,
String prefix,
List flags,
ArrayList definitions)
| Method Detail |
public static DefinitionFile read(String sourceFile)
throws LexgenError
sourceFile - the name of the source file
LexgenError
public int checkIdentifiers(Hashtable identifiers,
String prefix,
int id)
throws LexgenError
identifiers - a table of all token identifiersprefix - the literal prefixid - the id of the first token
LexgenError
public void printDefinition(PrintWriter out,
String prefix)
out - the output streamprefix - the literal prefix
public void printInterface(PrintWriter out,
String parent)
out - the output streamparent - the super interface
boolean accumKeywords(List accum,
String prefix,
List legalFlags)
accum.
requires (\forall Object o; accum.contains(o); o instanceof KeywordTokenInfo); ensures (\forall Object o; accum.contains(o); o instanceof KeywordTokenInfo); also ensures \result != true ==> (* an error was reported to System.err *);
public String getClassName()
public String getPackageName()
public String getVocabulary()
public String getPrefix()
public List flags()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||