lp.trans
Class EvolpSolver.TransEvolpParser

java.lang.Object
  extended by lp.parse.LpParser
      extended by lp.parse.EvolpParser
          extended by lp.trans.EvolpSolver.TransEvolpParser
All Implemented Interfaces:
Closeable
Enclosing class:
EvolpSolver

private class EvolpSolver.TransEvolpParser
extends EvolpParser

Special parser that recognizes the indexation of atoms in the normal logic program that was constructed by the transformation from an evolving logic program.


Field Summary
private  int group
          Contains the index of the last atom that was parsed.
private  boolean topLevel
          Used internally to remember whether we are parsing a top-level atom or some atom that is part of an inner rule.
 
Fields inherited from class lp.parse.EvolpParser
SEP_RULE
 
Constructor Summary
private EvolpSolver.TransEvolpParser()
           
 
Method Summary
 int getGroup()
          Returns the index of the last atom that was parsed.
 LpAtom parseAtom()
          Parses an atom in a normal way but cuts off the indexation suffix "N([0-9]+)" and stores $1.
 void setInput(File file)
          Sets the character input of this LpParser to the contents of the given file.
 void setInput(CharSequence input)
          Sets the character input of this LpParser to the given CharSequence.
 void setInput(Reader input)
          Sets the character input of this LpParser to the given Reader.
 
Methods inherited from class lp.parse.EvolpParser
parseEvolp, parseTerm
 
Methods inherited from class lp.parse.LpParser
close, expect, getLexer, hasMoreTokens, match, nextToken, parseAllRules, parseAllRules, parseArguments, parseLiteral, parseOnlyRule, parseRule, parseRuleBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

group

private int group
Contains the index of the last atom that was parsed.


topLevel

private boolean topLevel
Used internally to remember whether we are parsing a top-level atom or some atom that is part of an inner rule.

Constructor Detail

EvolpSolver.TransEvolpParser

private EvolpSolver.TransEvolpParser()
Method Detail

setInput

public void setInput(CharSequence input)
Sets the character input of this LpParser to the given CharSequence.

Overrides:
setInput in class LpParser
Parameters:
input - the character sequence to be parsed
See Also:
LpLexer.setInput(CharSequence)

setInput

public void setInput(File file)
Sets the character input of this LpParser to the contents of the given file. The default system character encoding is used to read the file.

Overrides:
setInput in class LpParser
Parameters:
file - the file to be parsed
See Also:
LpLexer.setInput(File)

setInput

public void setInput(Reader input)
Sets the character input of this LpParser to the given Reader.

Overrides:
setInput in class LpParser
Parameters:
input - the input reader
See Also:
LpLexer.setInput(Reader)

parseAtom

public LpAtom parseAtom()
Parses an atom in a normal way but cuts off the indexation suffix "N([0-9]+)" and stores $1. It can be later retrieved by calling the getGroup() method.

Overrides:
parseAtom in class LpParser
Returns:
the parsed atom

getGroup

public int getGroup()
Returns the index of the last atom that was parsed.