Beispiel #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);
 }
Beispiel #2
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);
     DurationConstraint = treeNode.GetGrandChildAst <DurationConstraintAstNode>(3, 1);
     Condition          = treeNode.GetGrandChildAst <DaGdAstNode>(4, 1);
     Effect             = treeNode.GetGrandChildAst <DaEffectAstNode>(5, 1);
 }
Beispiel #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)
        {
            if (treeNode.GetMappedChildNodes().Count == 1)
            {
                IsProductExpression      = false;
                ProductExprNumericFactor = null;
            }
            else
            {
                IsProductExpression = true;
                var productArg1 = treeNode.GetGrandChildAst <TermOrNumericAstNode>(1, 0);
                var productArg2 = treeNode.GetGrandChildAst <TermOrNumericAstNode>(1, 1);

                if (productArg1 != null)
                {
                    ProductExprNumericFactor = productArg1;
                }
                else if (productArg2 != null)
                {
                    ProductExprNumericFactor = productArg2;
                }
            }
        }