marf.nlp.Parsing
Class LexicalAnalyzer

java.lang.Object
  extended by marf.nlp.Parsing.GenericLexicalAnalyzer
      extended by 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.10 2005/06/16 19:58:57 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.10 $
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(SymbolTable pSymTab)
          Constructor.
 
Method Summary
 java.util.Vector getLexicalErrors()
          Returns the list of lexical errors.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 Token getNextToken()
          Core method of the C+- LexicalAnalyzer.
 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(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 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

getMARFSourceCodeRevision

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

Returns:
revision string