logic
Class LogicParser

java.lang.Object
  extended by logic.LogicParser

public class LogicParser
extends java.lang.Object

Logic Parser

Logic Parser is a syntax analyser for the logical expressions. Typically, Logic Parser is provided with a string containing the expression to evaluate. Exceptions are thrown if the provided string does not represent a legal formla.

Copyright(c) 2005 Université Laval, LSFM research group.

Version:
1.0
Author:
Nicolas Richard

Constructor Summary
LogicParser()
          Constructor with no parameters.
 
Method Summary
 Formula parse(java.lang.String s)
          Logical parser.
 void setAP(java.util.TreeSet ap)
          Sets the current atomic proposition set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicParser

public LogicParser()
Constructor with no parameters. Creates a parser object usable for parsing several formulas. This constructor does nothing.

Method Detail

setAP

public void setAP(java.util.TreeSet ap)
Sets the current atomic proposition set

Parameters:
ap - a sorted set representing the atomic propositions

parse

public Formula parse(java.lang.String s)
              throws LogicParserException
Logical parser. Convert a string representing a formula to usable logical expressions.

Parameters:
s - a string representing the formula to convert
Returns:
the formula represented by the provided string
Throws:
LogicParserException - should there be an invalid construction or expression in the formula