marf.nlp.Parsing.GrammarCompiler
Class GrammarAnalyzer

java.lang.Object
  |
  +--marf.nlp.Parsing.GenericLexicalAnalyzer
        |
        +--marf.nlp.Parsing.GrammarCompiler.GrammarAnalyzer
Direct Known Subclasses:
ProbabilisticGrammarAnalyzer

public class GrammarAnalyzer
extends GenericLexicalAnalyzer

GrammarAnalyzer class encapsulates functionality required for lexical analysis of a the grammar definition file. $Id: GrammarAnalyzer.java,v 1.14 2005/06/16 19:58:57 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.14 $
Author:
Serguei Mokhov

Field Summary
protected static java.lang.String DEFAULT_GRAMMAR_FILE
           
protected  marf.nlp.Parsing.GrammarCompiler.GrammarTokenType oTokenType
           
 
Fields inherited from class marf.nlp.Parsing.GenericLexicalAnalyzer
ErrorLogFilename, ErrorsPresent, LexicalErrors, oFileReader, oStreamTokenizer, oToken, OutputFilename, SourceFilename, SymTab, TokenList
 
Constructor Summary
GrammarAnalyzer()
           
GrammarAnalyzer(java.lang.String pGrammarFileName)
           
GrammarAnalyzer(marf.nlp.Parsing.SymbolTable pSymTab)
           
 
Method Summary
protected  void addToTokenList()
           
protected  void createEOFToken()
           
protected  void createNextToken()
           
protected  void createOrdinaryToken()
           
protected  void createWordToken()
           
 java.util.Vector getLexicalGrammarErrors()
           
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 marf.nlp.Parsing.Token getNextToken()
          Returns Next GrammarToken.
 boolean init()
          Initialization routine.
 boolean serialize(int piOperation)
          Load/Save the contents of lists such as Token list and Error list.
 
Methods inherited from class marf.nlp.Parsing.GenericLexicalAnalyzer
createToken, getErrorLogFilename, getErrorsPresent, getOutputFilename, getSourceFilename, getSymTab, getTokenList, scan, setErrorLogFilename, setOutputFilename, setSourceFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GRAMMAR_FILE

protected static final java.lang.String DEFAULT_GRAMMAR_FILE
See Also:
Constant Field Values

oTokenType

protected marf.nlp.Parsing.GrammarCompiler.GrammarTokenType oTokenType
Constructor Detail

GrammarAnalyzer

public GrammarAnalyzer()

GrammarAnalyzer

public GrammarAnalyzer(java.lang.String pGrammarFileName)

GrammarAnalyzer

public GrammarAnalyzer(marf.nlp.Parsing.SymbolTable pSymTab)
Method Detail

init

public boolean init()
Description copied from class: GenericLexicalAnalyzer
Initialization routine. Should be overridden by derivatives because it is language-specific, and default initialization will not always suffice.

Overrides:
init in class GenericLexicalAnalyzer

serialize

public boolean serialize(int piOperation)
Load/Save the contents of lists such as Token list and Error list. 0 means LOAD, 1 means SAVE. Load currently is not implemented

Specified by:
serialize in class GenericLexicalAnalyzer

createEOFToken

protected void createEOFToken()

createWordToken

protected void createWordToken()

createOrdinaryToken

protected void createOrdinaryToken()

createNextToken

protected void createNextToken()

getNextToken

public marf.nlp.Parsing.Token getNextToken()
Returns Next GrammarToken.

Specified by:
getNextToken in class GenericLexicalAnalyzer

addToTokenList

protected void addToTokenList()

getLexicalGrammarErrors

public java.util.Vector getLexicalGrammarErrors()

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string