Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marf.nlp.Parsing
Class GenericLexicalAnalyzer  view GenericLexicalAnalyzer download GenericLexicalAnalyzer.java

java.lang.Object
  extended bymarf.nlp.Parsing.GenericLexicalAnalyzer
Direct Known Subclasses:
LexicalAnalyzer

public abstract class GenericLexicalAnalyzer
extends java.lang.Object

GenericLexicalAnalyzer Class. (C) 2001-2005 Serguei Mokhov, $Id: GenericLexicalAnalyzer.java,v 1.8 2005/06/16 19:58:57 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.8 $

Field Summary
protected  java.lang.String ErrorLogFilename
          File name of a file which serves as an lexical errors log.
protected  boolean ErrorsPresent
           
protected  java.util.Vector LexicalErrors
           
protected  java.io.FileReader oFileReader
           
protected  java.io.StreamTokenizer oStreamTokenizer
           
protected  Token oToken
           
protected  java.lang.String OutputFilename
          File name of a file which serves as an output of the Lexical Analyzer.
protected  java.lang.String SourceFilename
          File name of a file which serves as an input of the Lexical Analyzer.
protected  SymbolTable SymTab
           
protected  java.util.Vector TokenList
           
 
Constructor Summary
GenericLexicalAnalyzer(SymbolTable pSymTab)
          Constructor.
 
Method Summary
 Token createToken(java.lang.String strLexeme, TokenSubType oTokenSubType)
          createToken() creates an instance of a Token data structure provided its type and lexeme, and location is calculated dynamically by the StreamTokenyzer.
 java.lang.String getErrorLogFilename()
          Access method for the ErrorLogFilename property.
 boolean getErrorsPresent()
          Determines if the ErrorsPresent property is true.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
abstract  Token getNextToken()
          Core method of the LexicalAnalyzer.
 java.lang.String getOutputFilename()
          Access method for the OutputFilename property.
 java.lang.String getSourceFilename()
          Access method for the SourceFilename property.
 SymbolTable getSymTab()
          Access method for the SymTab property.
 java.util.Vector getTokenList()
          Access method for the TonkenList property.
 boolean init()
          Initialization routine.
 void scan()
          Scan for tokens through the input stream.
abstract  boolean serialize(int piOperation)
          Load/Save the contents of lists such as Token list and Error list.
 void setErrorLogFilename(java.lang.String aErrorLogFilename)
          Sets the value of the ErrorLogFilename property.
 void setOutputFilename(java.lang.String aOutputFilename)
          Sets the value of the OutputFilename property.
 void setSourceFilename(java.lang.String aSourceFilename)
          Sets the value of the SourceFilename property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oFileReader

protected java.io.FileReader oFileReader

oStreamTokenizer

protected java.io.StreamTokenizer oStreamTokenizer

SourceFilename

protected java.lang.String SourceFilename
File name of a file which serves as an input of the Lexical Analyzer.


OutputFilename

protected java.lang.String OutputFilename
File name of a file which serves as an output of the Lexical Analyzer.


ErrorLogFilename

protected java.lang.String ErrorLogFilename
File name of a file which serves as an lexical errors log.

Since:
September 2001

ErrorsPresent

protected boolean ErrorsPresent
Since:
October 2, 2001

TokenList

protected java.util.Vector TokenList

SymTab

protected SymbolTable SymTab

LexicalErrors

protected java.util.Vector LexicalErrors

oToken

protected Token oToken
Constructor Detail

GenericLexicalAnalyzer

public GenericLexicalAnalyzer(SymbolTable pSymTab)
Constructor.

Method Detail

init

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


scan

public void scan()
Scan for tokens through the input stream.


serialize

public abstract 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


getNextToken

public abstract Token getNextToken()
Core method of the LexicalAnalyzer.


createToken

public Token createToken(java.lang.String strLexeme,
                         TokenSubType oTokenSubType)
createToken() creates an instance of a Token data structure provided its type and lexeme, and location is calculated dynamically by the StreamTokenyzer.


getSourceFilename

public java.lang.String getSourceFilename()
Access method for the SourceFilename property.


setSourceFilename

public void setSourceFilename(java.lang.String aSourceFilename)
Sets the value of the SourceFilename property.


getOutputFilename

public java.lang.String getOutputFilename()
Access method for the OutputFilename property.


setOutputFilename

public void setOutputFilename(java.lang.String aOutputFilename)
Sets the value of the OutputFilename property.


getErrorLogFilename

public java.lang.String getErrorLogFilename()
Access method for the ErrorLogFilename property.


setErrorLogFilename

public void setErrorLogFilename(java.lang.String aErrorLogFilename)
Sets the value of the ErrorLogFilename property.


getErrorsPresent

public boolean getErrorsPresent()
Determines if the ErrorsPresent property is true.


getTokenList

public java.util.Vector getTokenList()
Access method for the TonkenList property.


getSymTab

public SymbolTable getSymTab()
Access method for the SymTab property.


getMARFSourceCodeRevision

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