示例#1
0
        public override int VisitExprSingleDoubleColonsOperators(RParser.ExprSingleDoubleColonsOperatorsContext context)
        {
            RASTComposite parent = m_parents.Peek();

            // PREORDER ACTIONS
            // Create new element
            RASTComposite newElement = new RSingleDoubleColonsOperators(parent);

            // Update parents stack
            m_parents.Push(newElement);

            // Add new element to the parent's descentants
            parent.AddChild(newElement, m_currentContext.Peek());

            // VISIT CHILDREN
            VisitElementInContext(context.left, ContextType.CT_EXPR_SINGLE_DOUBLE_COLONS_OPERATORS_BASE);
            VisitElementInContext(context.right, ContextType.CT_EXPR_SINGLE_DOUBLE_COLONS_OPERATORS_OFFSET);

            // POSTORDER ACTIONS

            // Update parents stack
            m_parents.Pop();

            return(0);
        }
示例#2
0
        public override int VisitExprSingleDoubleColonsOperators(RParser.ExprSingleDoubleColonsOperatorsContext context)
        {
            // PREORDER ACTIONS
            string label = "DoubleColonsOperator_" + ms_ASTElementCounter.ToString();

            m_outputStream.WriteLine("\"{0}\"->\"{1}\";", m_PTPath.Peek(), label);
            ms_ASTElementCounter++;
            m_PTPath.Push(label);

            base.VisitExprSingleDoubleColonsOperators(context);

            // POSTORDER ACTIONS
            m_PTPath.Pop();

            return(0);
        }