pmp
Class Analyzer

java.lang.Object
  extended by pmp.Macroprocessor.Component
      extended by pmp.Analyzer
All Implemented Interfaces:
java.util.EventListener, MacroListModifyListener

public final class Analyzer
extends Macroprocessor.Component
implements MacroListModifyListener

Syntactic analyzer.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Nested Class Summary
static class Analyzer.State
          States of syntactic analyzer.
 
Field Summary
protected  CallStack callStack
          Macro call stack.
protected  Analyzer.State synState
          Current state of lexical analyzer.
 
Constructor Summary
Analyzer(Macroprocessor mp)
          Constructs lexical analyzer.
 
Method Summary
 void macroListModified(MacroListModifyEvent event)
          Listener method for macro list modifications.
 void processInput()
          Executes program.
 java.lang.String stateAsString()
          Returns state of parser as string
 java.lang.String stateAsString(Analyzer.State state)
          Converts integer representation of parser state to string
 java.lang.String toString()
          Returns string representation of this object.
 
Methods inherited from class pmp.Macroprocessor.Component
error, getMP, getMPAnalyzer, getMPIO, getMPIQ, getMPMacros, notice, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

synState

protected Analyzer.State synState
Current state of lexical analyzer.


callStack

protected final CallStack callStack
Macro call stack.

Constructor Detail

Analyzer

public Analyzer(Macroprocessor mp)
Constructs lexical analyzer.

Parameters:
mp - owner of this object
Method Detail

stateAsString

public java.lang.String stateAsString()
Returns state of parser as string

Returns:
String describing state of analyzer

stateAsString

public java.lang.String stateAsString(Analyzer.State state)
Converts integer representation of parser state to string

Parameters:
state - state of parser
Returns:
string representation of state

toString

public java.lang.String toString()
Returns string representation of this object. Returned String consists of result of toString() method of superclass and state of parser.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this class

macroListModified

public void macroListModified(MacroListModifyEvent event)
Listener method for macro list modifications.

Specified by:
macroListModified in interface MacroListModifyListener
Parameters:
event - event object describing modification

processInput

public void processInput()
Executes program. Reads input, splits in into tokens and substitues macro calls.

Throws:
this - exception shouldn't be thrown as Writer should report errors to InputOutput object.