Class DefaultParserHelper
- java.lang.Object
-
- jadex.rules.parser.conditions.javagrammar.DefaultParserHelper
-
- All Implemented Interfaces:
IParserHelper
public class DefaultParserHelper extends java.lang.Object implements IParserHelper
Basic handler for context specific parsing issues.
-
-
Field Summary
Fields Modifier and Type Field Description protected BuildContext
context
The build context.
-
Constructor Summary
Constructors Constructor Description DefaultParserHelper(ICondition condition, OAVTypeModel tmodel)
Create a BDI parser helper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVariable(Variable var)
Add a variable.BuildContext
getBuildContext()
Get the build context.java.util.List
getConditions()
Get the conditions after parsing.java.lang.Object[]
getReplacementType(OAVObjectType type)
Get the replacement type for an object type in an existential declaration E.g. when a flyweight should be replaced by the real state type (IGoal $g instead of goal $g)Variable
getVariable(java.lang.String name)
Get a variable with a given name.boolean
isPseudoVariable(java.lang.String name)
Test, if a name refers to a pseudo variable (e.g.
-
-
-
Field Detail
-
context
protected BuildContext context
The build context.
-
-
Constructor Detail
-
DefaultParserHelper
public DefaultParserHelper(ICondition condition, OAVTypeModel tmodel)
Create a BDI parser helper.- Parameters:
condition
- The predefined condition.state
- The state.returnvar
- The return value variable (if return value condition).
-
-
Method Detail
-
getVariable
public Variable getVariable(java.lang.String name)
Get a variable with a given name.- Specified by:
getVariable
in interfaceIParserHelper
- Parameters:
name
- The variable name.- Returns:
- The variable.
-
addVariable
public void addVariable(Variable var)
Add a variable.- Specified by:
addVariable
in interfaceIParserHelper
- Parameters:
var
- The variable.
-
isPseudoVariable
public boolean isPseudoVariable(java.lang.String name)
Test, if a name refers to a pseudo variable (e.g. $beliefbase).- Specified by:
isPseudoVariable
in interfaceIParserHelper
- Parameters:
name
- The variable name.- Returns:
- True, if the name is a pseudo variable.
-
getConditions
public java.util.List getConditions()
Get the conditions after parsing.- Specified by:
getConditions
in interfaceIParserHelper
-
getBuildContext
public BuildContext getBuildContext()
Get the build context.- Specified by:
getBuildContext
in interfaceIParserHelper
-
getReplacementType
public java.lang.Object[] getReplacementType(OAVObjectType type)
Get the replacement type for an object type in an existential declaration E.g. when a flyweight should be replaced by the real state type (IGoal $g instead of goal $g)- Specified by:
getReplacementType
in interfaceIParserHelper
- Parameters:
type
- The type to be replaced.- Returns:
- a tuple containing the replacement type and the replacement value source (e.g. a function call recreating the flyweight from the state object).
-
-