fipaos.parser.sl
Class SLParser

java.lang.Object
  |
  +--fipaos.parser.sl.SLParser
All Implemented Interfaces:
Parser, SLParserConstants

public class SLParser
extends java.lang.Object
implements Parser, SLParserConstants

The SLParser is used to parse a string that has the format of an Content as defined by XC00008 Fipa2000 (Experimental). For parsing to occur, the string should be converted to a StringReader and then passed to the constructor of the SLParser. Alternatively the static method parse() may be used to do this for the user.


Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 SLParserTokenManager token_source
           
 
Fields inherited from interface fipaos.parser.sl.SLParserConstants
Action, All, And, Any, AnyOtherToken, Append, Belief, Cons, Contains, DateTime, Day, DecimalLiteral, DEFAULT, Difference, Divide, Done, Dot, EOF, Equal, Equiv, Exists, Exponent, False, Feasible, First, Float, FloatExponent, FloatMantissa, Forall, GreaterThan, GreaterThanOrEqual, HexLiteral, Hour, Implies, Integer, Intention, Intersection, Iota, LessThan, LessThanOrEqual, Lparen, Member, MilliSecond, Minus, Minute, Month, Multiply, Not, NotEqual, Nth, OPERATOR, Or, ParameterName, PersistentGoal, Pipe, Plus, Remainder, Rest, Result, Rparen, Second, SemiColon, Sequence, Set, Sign, SPECIAL, String, StringLiteral, tokenImage, True, TypeDesignator, Uncertainty, Union, VariableIdentifier, Word, XSPECIAL, Year
 
Constructor Summary
SLParser()
          Empty constructor for manipulating Parser instance
SLParser(java.io.InputStream stream)
           
SLParser(java.io.Reader stream)
           
SLParser(SLParserTokenManager tm)
           
 
Method Summary
 Content ActionExpression()
           
 Content ActionExpressionFactored()
          The production obtained by left-factorising SLActionExpression
 Content ActionFactored()
           
 java.lang.String ActionOp()
           
 Content Agent()
           
 java.lang.String ArithmeticOp()
           
 Content AtomicFormula()
           
 Content AtomicFormulaFactored()
          The production obtained by left-factorising SLAtomicFormula for the beginning parenthesis.
 java.lang.String BinaryLogicalOp()
           
 java.lang.String BinaryTermOp()
           
 boolean canParse(java.lang.String content)
          Determines if the Parser implementation can parse the given content
 Content Constant()
           
 Content Content()
           
 Content ContentExpression()
           
 java.lang.String deparse(Content sl_content)
          This method converts a Content object into a document which is of a format determined by the Parser implementation.
 void disable_tracing()
           
 void enable_tracing()
           
 Content FunctionalTerm()
           
 Content FunctionalTermFactored()
           
 java.lang.String FunctionSymbol()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 java.lang.String getParserType()
          Returns the type of content language that the Parser implementation handles.
 Token getToken(int index)
           
 Content IdentifyingExpression()
           
static void main(java.lang.String[] args)
          Test Harness method where a file of strings is parsed.
 java.lang.String ModalOp()
           
 java.lang.String NumericalConstant()
           
 Content Parameter()
           
 Content ParameterValue()
           
 Content parse(java.lang.String sl_content)
          This method converts a content String into a set of Content objects
static Content parseActionExpression(java.lang.String sl_action_expression)
          parseActionExpression method is the preferred method for parsing an SL actionExpression message string.
static Content parseAtomicFormula(java.lang.String sl_atomic_formula)
          parseAtomicFormula method is the preferred method for parsing an SL atomicFormula message string.
static Content parseContent(java.lang.String sl_content)
          parse method is the preferred method for parsing an SL content message string.
static Content parseTerm(java.lang.String sl_term)
          parseTerm method is the preferred method for parsing an SL term message string.
 java.lang.String PredicateSymbol()
           
 Content Proposition()
           
 java.lang.String PropositionSymbol()
           
 java.lang.String Quantifier()
           
 java.lang.String ReferentialOperator()
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 void ReInit(SLParserTokenManager tm)
           
 Content Sequence()
           
 Content Set()
           
 Content symbolTermFactored()
           
 Content Term()
           
 java.lang.String UnaryLogicalOp()
           
 java.lang.String Variable()
           
 Content Wff()
           
 Content WffFactored()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public SLParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

SLParser

public SLParser()
Empty constructor for manipulating Parser instance

SLParser

public SLParser(java.io.InputStream stream)

SLParser

public SLParser(java.io.Reader stream)

SLParser

public SLParser(SLParserTokenManager tm)
Method Detail

parseContent

public static Content parseContent(java.lang.String sl_content)
                            throws ParserException
parse method is the preferred method for parsing an SL content message string.
Parameters:
sl_content_expression - the expression to parse
Returns:
fipaos.agent.conversation.content.Content object

parseTerm

public static Content parseTerm(java.lang.String sl_term)
                         throws ParseException
parseTerm method is the preferred method for parsing an SL term message string.
Parameters:
sl_term - the term to parse
Returns:
fipaos.agent.conversation.content.Content object

parseAtomicFormula

public static Content parseAtomicFormula(java.lang.String sl_atomic_formula)
                                  throws ParseException
parseAtomicFormula method is the preferred method for parsing an SL atomicFormula message string.
Parameters:
sl_atomic_formula - the formula to parse
Returns:
fipaos.agent.conversation.content.Content object

parseActionExpression

public static Content parseActionExpression(java.lang.String sl_action_expression)
                                     throws ParseException
parseActionExpression method is the preferred method for parsing an SL actionExpression message string.
Parameters:
sl_term - the term to parse
Returns:
fipaos.agent.conversation.content.Content object

parse

public Content parse(java.lang.String sl_content)
              throws ParserException
This method converts a content String into a set of Content objects
Specified by:
parse in interface Parser
Parameters:
content - The String to parse into Content objects
Returns:
A Content object representing the content String given.

deparse

public java.lang.String deparse(Content sl_content)
This method converts a Content object into a document which is of a format determined by the Parser implementation.
Specified by:
deparse in interface Parser
Parameters:
content - The Content object to deparse
Returns:
The Stringified representation of the Content object

canParse

public boolean canParse(java.lang.String content)
Determines if the Parser implementation can parse the given content
Specified by:
canParse in interface Parser
Parameters:
A - content String.
Returns:
True if the Parser implementation can parse the given String

getParserType

public java.lang.String getParserType()
Returns the type of content language that the Parser implementation handles.
Specified by:
getParserType in interface Parser
Returns:
A String representation of the content format (e.g. RDF, SL)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test Harness method where a file of strings is parsed. Each line is regarded as a separate SL Content

Content

public final Content Content()
                      throws ParseException

ContentExpression

public final Content ContentExpression()
                                throws ParseException

Proposition

public final Content Proposition()
                          throws ParseException

Wff

public final Content Wff()
                  throws ParseException

UnaryLogicalOp

public final java.lang.String UnaryLogicalOp()
                                      throws ParseException

BinaryLogicalOp

public final java.lang.String BinaryLogicalOp()
                                       throws ParseException

BinaryTermOp

public final java.lang.String BinaryTermOp()
                                    throws ParseException

WffFactored

public final Content WffFactored()
                          throws ParseException

ActionFactored

public final Content ActionFactored()
                             throws ParseException

AtomicFormula

public final Content AtomicFormula()
                            throws ParseException

AtomicFormulaFactored

public final Content AtomicFormulaFactored()
                                    throws ParseException
The production obtained by left-factorising SLAtomicFormula for the beginning parenthesis.

Quantifier

public final java.lang.String Quantifier()
                                  throws ParseException

ModalOp

public final java.lang.String ModalOp()
                               throws ParseException

ActionOp

public final java.lang.String ActionOp()
                                throws ParseException

Term

public final Content Term()
                   throws ParseException

IdentifyingExpression

public final Content IdentifyingExpression()
                                    throws ParseException

ReferentialOperator

public final java.lang.String ReferentialOperator()
                                           throws ParseException

FunctionalTerm

public final Content FunctionalTerm()
                             throws ParseException

FunctionalTermFactored

public final Content FunctionalTermFactored()
                                     throws ParseException

symbolTermFactored

public final Content symbolTermFactored()
                                 throws ParseException

ArithmeticOp

public final java.lang.String ArithmeticOp()
                                    throws ParseException

Constant

public final Content Constant()
                       throws ParseException

NumericalConstant

public final java.lang.String NumericalConstant()
                                         throws ParseException

Variable

public final java.lang.String Variable()
                                throws ParseException

ActionExpression

public final Content ActionExpression()
                               throws ParseException

ActionExpressionFactored

public final Content ActionExpressionFactored()
                                       throws ParseException
The production obtained by left-factorising SLActionExpression

PropositionSymbol

public final java.lang.String PropositionSymbol()
                                         throws ParseException

PredicateSymbol

public final java.lang.String PredicateSymbol()
                                       throws ParseException

FunctionSymbol

public final java.lang.String FunctionSymbol()
                                      throws ParseException

Agent

public final Content Agent()
                    throws ParseException

Sequence

public final Content Sequence()
                       throws ParseException

Set

public final Content Set()
                  throws ParseException

Parameter

public final Content Parameter()
                        throws ParseException

ParameterValue

public final Content ParameterValue()
                             throws ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(SLParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()