edu.udo.cs.ie.cowbots.bdi.brf
Class Parser

Package class diagram package Parser
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.bdi.brf.Parser

public class Parser
extends java.lang.Object

This class translates jason literals into elps and backwards.


Constructor Summary
Parser()
           
 
Method Summary
static ELPLiteral parseJLiteral(Literal l)
          translates a jason literal to an ELPLiteral
static java.util.ArrayList<ELPRule> parseJLiteralToRules(Literal l)
          this method converts jason literals into elp rules.
static ELPLiteral parseLiteralFromPlan(Literal l, int worldtime, java.lang.String sourceOverride)
          translates an annotated jason literal into an elp literal.
static Literal parsePlanLiteralToJason(Literal l)
           
static java.util.List<Literal> toJasonLiterals(java.util.Collection<ELPLiteral> lits)
          converts a collection of elp literals into a list of jason literals
static Literal toJasonWithSourceRewrite(ELPLiteral l)
          converts an elp literal to a jason literal, and additionally sets the first term as a source annotation (but does not remove first term).
static Literal toJasonWithSourceTerm(ELPLiteral l)
          converts an elp literal to a jason literal, removes first term from predicate and adds it as source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Method Detail

parseLiteralFromPlan

public static ELPLiteral parseLiteralFromPlan(Literal l,
                                              int worldtime,
                                              java.lang.String sourceOverride)
translates an annotated jason literal into an elp literal.

Parameters:
l - jason literal
worldtime - time
Returns:
elpliteral representation of l

parsePlanLiteralToJason

public static Literal parsePlanLiteralToJason(Literal l)

toJasonWithSourceTerm

public static Literal toJasonWithSourceTerm(ELPLiteral l)
converts an elp literal to a jason literal, removes first term from predicate and adds it as source

Parameters:
l -
Returns:

toJasonWithSourceRewrite

public static Literal toJasonWithSourceRewrite(ELPLiteral l)
converts an elp literal to a jason literal, and additionally sets the first term as a source annotation (but does not remove first term).

Parameters:
l -
Returns:

parseJLiteralToRules

public static java.util.ArrayList<ELPRule> parseJLiteralToRules(Literal l)
this method converts jason literals into elp rules.

Parameters:
l - jason literals
Returns:
list of elp rules

parseJLiteral

public static ELPLiteral parseJLiteral(Literal l)
translates a jason literal to an ELPLiteral

Parameters:
l - jason literal to translate
Returns:
an elp-literal (positive or strict negated)

toJasonLiterals

public static java.util.List<Literal> toJasonLiterals(java.util.Collection<ELPLiteral> lits)
converts a collection of elp literals into a list of jason literals

Parameters:
lits - collection of ELPLiterals
Returns:
list of jason literals