Exemple #1
0
 /// <summary>
 /// Initialization of the AST node. Specifies conversion from parse-tree node to AST node.
 /// </summary>
 /// <param name="treeNode">Parse-tree node.</param>
 public override void Init(ParseTreeNode treeNode)
 {
     Name          = treeNode.GetChildString(1);
     Parameters    = treeNode.GetGrandChildAst <TypedListAstNode>(2, 1);
     Preconditions = treeNode.GetGrandChildAst <GdAstNode>(3, 1);
     Effects       = treeNode.GetGrandChildAst <EffectAstNode>(4, 1);
 }
        /// <summary>
        /// Convert the given effects AST into an effects structure. A root AND-expression is split into a list of effects.
        /// </summary>
        /// <param name="effectAstNode">AST node.</param>
        /// <returns>Converted effects.</returns>
        public static Effects ToEffects(EffectAstNode effectAstNode)
        {
            ToEffectsConverter converter = new ToEffectsConverter();

            converter.Evaluate(effectAstNode);
            return(converter.EffectsData);
        }
Exemple #3
0
 /// <summary>
 /// Initialization of the AST node. Specifies conversion from parse-tree node to AST node.
 /// </summary>
 /// <param name="treeNode">Parse-tree node.</param>
 public override void Init(ParseTreeNode treeNode)
 {
     Parameters = treeNode.GetChildAst <TypedListAstNode>(1);
     Effect     = treeNode.GetChildAst <EffectAstNode>(2);
 }