Class DefaultParserHelper

  • All Implemented Interfaces:
    IParserHelper

    public class DefaultParserHelper
    extends java.lang.Object
    implements IParserHelper
    Basic handler for context specific parsing issues.
    • 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 interface IParserHelper
        Parameters:
        name - The variable name.
        Returns:
        The variable.
      • addVariable

        public void addVariable​(Variable var)
        Add a variable.
        Specified by:
        addVariable in interface IParserHelper
        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 interface IParserHelper
        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 interface IParserHelper
      • 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 interface IParserHelper
        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).