agg.parser
Class SimpleParser

java.lang.Object
  extended by agg.parser.AbstractParser
      extended by agg.parser.SimpleParser
All Implemented Interfaces:
Parser, java.lang.Runnable
Direct Known Subclasses:
LayeredSimpleParser

public class SimpleParser
extends AbstractParser
implements java.lang.Runnable

This class provides a parser which works without critical pair analysis. So a simple backtracking algorithm is implemented.

See Also:
createParser(...)

Field Summary
protected  boolean correct
           
protected  boolean stop
           
 
Fields inherited from class agg.parser.AbstractParser
delay, grammar, graph, listener, pairContainer, stopGraph
 
Constructor Summary
SimpleParser(GraGra grammar, Graph hostGraph, Graph stopGraph)
          Created a new parser.
 
Method Summary
 boolean parse()
          Starts the parser.
 void run()
          Usually this method is invoked by the start method from the class Thread.
 void stop()
          Stops the running.
 boolean wasStopped()
           
 
Methods inherited from class agg.parser.AbstractParser
addParserEventListener, applyRule, finalize, findMatch, findMatch, fireParserEvent, getGraph, getHostGraph, getStopGraph, parseString, printGraph, printImageGraph, removeParserEventListener, setCriticalPairs, setDelayAfterApplyRule, setGrammar, setHostGraph, setStopGraph
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stop

protected boolean stop

correct

protected boolean correct
Constructor Detail

SimpleParser

public SimpleParser(GraGra grammar,
                    Graph hostGraph,
                    Graph stopGraph)
Created a new parser.

Parameters:
grammar - The graph grammar.
hostGraph - The host graph.
stopGraph - The stop graph.
Method Detail

run

public void run()
Usually this method is invoked by the start method from the class Thread. This method starts the parser.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Stops the running.


wasStopped

public boolean wasStopped()

parse

public boolean parse()
Starts the parser.

Specified by:
parse in interface Parser
Specified by:
parse in class AbstractParser
Returns:
true if the graph can be parsed.