|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.StorageManager marf.nlp.Parsing.GrammarCompiler.GrammarCompiler
public class GrammarCompiler
GrammarCompiler. Compiles source grammar file and produces TT. $Id: GrammarCompiler.java,v 1.18 2005/06/16 19:58:57 mokhov Exp $
Field Summary | |
---|---|
protected java.lang.String |
GrammarFileName
Source grammar filename. |
protected Grammar |
oGrammar
Instance of the grammar as a set of production Rules, First and Follow sets. |
protected GrammarAnalyzer |
oGrammarAnalyzer
Lexical Analyzer for the grammar. |
protected GrammarElement |
oGrammarElement
|
protected Rule |
oRule
|
protected Token |
oToken
|
protected static TransitionTable |
oTransitionTable
Instance of the TransitionTable, generated upon the need from the source grammar file. |
Fields inherited from class marf.Storage.StorageManager |
---|
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename |
Fields inherited from interface marf.Storage.IStorageManager |
---|
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS |
Constructor Summary | |
---|---|
GrammarCompiler()
Default Constructor. |
|
GrammarCompiler(java.lang.String pGrammarFileName)
Constructor. |
Method Summary | |
---|---|
protected boolean |
addIDToken()
|
protected void |
addNextRHS()
|
protected void |
addTerminalToken()
|
protected void |
checkUndefinedNonTerminals()
|
void |
compileGrammar()
Compiles grammar. |
protected void |
createEOFTerminal()
|
protected void |
createEpsilonToken()
|
protected void |
createGrammarAnalyzer()
|
protected boolean |
createNextNonTerminal()
|
protected void |
createRule()
|
protected void |
getBusted()
|
Grammar |
getGrammar()
|
protected GrammarElement |
getGrammarElement(java.lang.String pstrName)
Returns a grammar element object by it's name (lexeme) if it exists; null otherwise. |
java.lang.String |
getGrammarFileName()
|
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
protected java.lang.String |
getNextRHSToken()
|
TransitionTable |
getTransitionTable()
|
static TransitionTable |
loadTT(java.lang.String pstrTTFileName)
Loads (previously deserialized) state of the TT. |
protected void |
outputStats()
|
protected void |
parseGrammar()
Parsing grammar. |
boolean |
serialize(int piOperation)
Text serialization routine for grammar compilation. |
Methods inherited from class marf.Storage.StorageManager |
---|
backSynchronizeObject, dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Grammar oGrammar
protected java.lang.String GrammarFileName
protected GrammarAnalyzer oGrammarAnalyzer
protected static TransitionTable oTransitionTable
protected GrammarElement oGrammarElement
protected Token oToken
protected Rule oRule
Constructor Detail |
---|
public GrammarCompiler()
public GrammarCompiler(java.lang.String pGrammarFileName)
pGrammarFileName
- Method Detail |
---|
protected void createGrammarAnalyzer()
public void compileGrammar()
protected void createEpsilonToken()
protected boolean createNextNonTerminal()
protected void createRule()
protected void outputStats()
protected java.lang.String getNextRHSToken()
protected void addNextRHS()
protected boolean addIDToken()
protected void addTerminalToken()
protected void getBusted()
protected void createEOFTerminal()
protected void checkUndefinedNonTerminals()
protected void parseGrammar()
protected GrammarElement getGrammarElement(java.lang.String pstrName)
public static TransitionTable loadTT(java.lang.String pstrTTFileName)
public boolean serialize(int piOperation)
public final Grammar getGrammar()
public final java.lang.String getGrammarFileName()
public final TransitionTable getTransitionTable()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |