marf.nlp.Parsing
Class LexicalAnalyzer

java.lang.Object
  |
  +--marf.nlp.Parsing.GenericLexicalAnalyzer
        |
        +--marf.nlp.Parsing.LexicalAnalyzer

public class LexicalAnalyzer
extends GenericLexicalAnalyzer

LexicalAnalyzer class encapsulates the functionality required for lexical analysis of a C+- source program. $Id: LexicalAnalyzer.java,v 1.9 2005/06/04 03:54:37 mokhov Exp $

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

Field Summary
 
Fields inherited from class marf.nlp.Parsing.GenericLexicalAnalyzer
ErrorLogFilename, ErrorsPresent, LexicalErrors, oFileReader, oStreamTokenizer, oToken, OutputFilename, SourceFilename, SymTab, TokenList
 
Constructor Summary
LexicalAnalyzer(marf.nlp.Parsing.SymbolTable pSymTab)
          Constructor.
 
Method Summary
 java.util.Vector getLexicalErrors()
          Returns the list of lexical errors.
 marf.nlp.Parsing.Token getNextToken()
          Core method of the C+- LexicalAnalyzer.
static java.lang.String getRevision()
          Retrieves class' revision.
 boolean init()
          Initialization routine.
 boolean serialize(int piOperation)
          Load/Save the textual contents of such as Token list and Error list.
protected  int validNum(java.lang.String pstrNum)
          Validates that an incoming string is a valid number or not.
 
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
 

Constructor Detail

LexicalAnalyzer

public LexicalAnalyzer(marf.nlp.Parsing.SymbolTable pSymTab)
Constructor.

Method Detail

init

public boolean init()
Initialization routine.

Overrides:
init in class GenericLexicalAnalyzer

serialize

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

Specified by:
serialize in class GenericLexicalAnalyzer

getNextToken

public marf.nlp.Parsing.Token getNextToken()
Core method of the C+- LexicalAnalyzer.

Specified by:
getNextToken in class GenericLexicalAnalyzer

validNum

protected int validNum(java.lang.String pstrNum)
Validates that an incoming string is a valid number or not.

Parameters:
pstrNum - a string constating valid numerical chars
Returns:
int, LexicalError Error code

getLexicalErrors

public java.util.Vector getLexicalErrors()
Returns the list of lexical errors.

Returns:
Vector LexicalErrors

getRevision

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

Returns:
revision string