fipaos.parser.sl
Class SLParser


public class SLParser
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.


Inner Class Summary
 (package private) static classSLParser.JJCalls
           

Field Summary
 (package private) ASCII_CharStreamjj_input_stream
           
 Tokenjj_nt
           
 booleanlookingAhead
           
 Tokentoken
           
 SLParserTokenManagertoken_source
           

Constructor Summary
SLParser()
          Empty constructor for manipulating Parser instance
SLParser(java.io.InputStream stream)
           
SLParser(java.io.Reader stream)
           
SLParser(SLParserTokenManager tm)
           

Method Summary
 final ContentActionExpression()
           
 final ContentActionExpressionFactored()
          The production obtained by left-factorising SLActionExpression
 final ContentActionFactored()
           
 final StringActionOp()
           
 final ContentAgent()
           
 final StringArithmeticOp()
           
 final ContentAtomicFormula()
           
 final ContentAtomicFormulaFactored()
          The production obtained by left-factorising SLAtomicFormula for the beginning parenthesis.
 final StringBinaryLogicalOp()
           
 final StringBinaryTermOp()
           
 booleancanParse(String content)
          Determines if the Parser implementation can parse the given content
 final ContentConstant()
           
 final ContentContent()
           
 final ContentContentExpression()
           
 Stringdeparse(Content sl_content)
          This method converts a Content object into a document which is of a format determined by the Parser implementation.
 final voiddisable_tracing()
           
 final voidenable_tracing()
           
 final ContentFunctionalTerm()
           
 final ContentFunctionalTermFactored()
           
 final StringFunctionSymbol()
           
 final ParseExceptiongenerateParseException()
           
 final TokengetNextToken()
           
 StringgetParserType()
          Returns the type of content language that the Parser implementation handles.
 final TokengetToken(int index)
           
 final ContentIdentifyingExpression()
           
 static voidmain(String[] args)
          Test Harness method where a file of strings is parsed.
 final StringModalOp()
           
 final StringNumericalConstant()
           
 final ContentParameter()
           
 final ContentParameterValue()
           
 Contentparse(String sl_content)
          This method converts a content String into a set of Content objects
 static ContentparseActionExpression(String sl_action_expression)
          parseActionExpression method is the preferred method for parsing an SL actionExpression message string.
 static ContentparseAtomicFormula(String sl_atomic_formula)
          parseAtomicFormula method is the preferred method for parsing an SL atomicFormula message string.
 static ContentparseContent(String sl_content)
          parse method is the preferred method for parsing an SL content message string.
 static ContentparseTerm(String sl_term)
          parseTerm method is the preferred method for parsing an SL term message string.
 final StringPredicateSymbol()
           
 final ContentProposition()
           
 final StringPropositionSymbol()
           
 final StringQuantifier()
           
 final StringReferentialOperator()
           
 voidReInit(java.io.InputStream stream)
           
 voidReInit(java.io.Reader stream)
           
 voidReInit(SLParserTokenManager tm)
           
 final ContentSequence()
           
 final ContentSet()
           
 final ContentsymbolTermFactored()
           
 final ContentTerm()
           
 final StringUnaryLogicalOp()
           
 final StringVariable()
           
 final ContentWff()
           
 final ContentWffFactored()
           

Field Detail

jj_input_stream

ASCII_CharStream jj_input_stream

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead

token

public Token token

token_source

public SLParserTokenManager token_source
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

ActionExpression

public final Content ActionExpression()
throws ParseException

ActionExpressionFactored

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

ActionFactored

public final Content ActionFactored()
throws ParseException

ActionOp

public final String ActionOp()
throws ParseException

Agent

public final Content Agent()
throws ParseException

ArithmeticOp

public final String ArithmeticOp()
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.

BinaryLogicalOp

public final String BinaryLogicalOp()
throws ParseException

BinaryTermOp

public final String BinaryTermOp()
throws ParseException

canParse

public boolean canParse(String content)
Determines if the Parser implementation can parse the given content
Parameters:
A - content String.
Returns: True if the Parser implementation can parse the given String

Constant

public final Content Constant()
throws ParseException

Content

public final Content Content()
throws ParseException

ContentExpression

public final Content ContentExpression()
throws ParseException

deparse

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

disable_tracing

public final void disable_tracing()

enable_tracing

public final void enable_tracing()

FunctionalTerm

public final Content FunctionalTerm()
throws ParseException

FunctionalTermFactored

public final Content FunctionalTermFactored()
throws ParseException

FunctionSymbol

public final String FunctionSymbol()
throws ParseException

generateParseException

public final ParseException generateParseException()

getNextToken

public final Token getNextToken()

getParserType

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

getToken

public final Token getToken(int index)

IdentifyingExpression

public final Content IdentifyingExpression()
throws ParseException

main

public static void main(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

ModalOp

public final String ModalOp()
throws ParseException

NumericalConstant

public final String NumericalConstant()
throws ParseException

Parameter

public final Content Parameter()
throws ParseException

ParameterValue

public final Content ParameterValue()
throws ParseException

parse

public Content parse(String sl_content)
throws fipaos.parser.ParserException
This method converts a content String into a set of Content objects
Parameters:
content - The String to parse into Content objects
Returns: A Content object representing the content String given.

parseActionExpression

public static Content parseActionExpression(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

parseAtomicFormula

public static Content parseAtomicFormula(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

parseContent

public static Content parseContent(String sl_content)
throws fipaos.parser.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(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

PredicateSymbol

public final String PredicateSymbol()
throws ParseException

Proposition

public final Content Proposition()
throws ParseException

PropositionSymbol

public final String PropositionSymbol()
throws ParseException

Quantifier

public final String Quantifier()
throws ParseException

ReferentialOperator

public final String ReferentialOperator()
throws ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(SLParserTokenManager tm)

Sequence

public final Content Sequence()
throws ParseException

Set

public final Content Set()
throws ParseException

symbolTermFactored

public final Content symbolTermFactored()
throws ParseException

Term

public final Content Term()
throws ParseException

UnaryLogicalOp

public final String UnaryLogicalOp()
throws ParseException

Variable

public final String Variable()
throws ParseException

Wff

public final Content Wff()
throws ParseException

WffFactored

public final Content WffFactored()
throws ParseException

Association Links

to Class fipaos.parser.sl.SLParserTokenManager

to Class fipaos.parser.sl.ASCII_CharStream

to Class fipaos.parser.sl.Token

to Class fipaos.parser.sl.Token

to Class fipaos.parser.sl.SLParser.JJCalls

to Class java.util.Vector