public override int VisitExpr_ASSIGNMENT(firstParser.Expr_ASSIGNMENTContext context)
        {
            CASTAssignment newNode = new CASTAssignment(nodeType.NT_ASSIGNMENT, m_parents.Peek(), 2);

            m_parents.Push(newNode);

            base.VisitExpr_ASSIGNMENT(context);

            m_parents.Pop();
            return(0);
        }
Exemplo n.º 2
0
        public override int VisitExpr_ASSIGNMENT(firstParser.Expr_ASSIGNMENTContext context)
        {
            ASTComposite   m_parent = m_parents.Peek();
            CASTAssignment newnode  = new CASTAssignment(context.GetText(), nodeType.NT_ASSIGNMENT, m_parents.Peek(), 2);

            m_parent.AddChild(newnode, m_parentContext.Peek());
            m_parents.Push(newnode);

            this.VisitTerminalInContext(context, context.IDENTIFIER().Symbol, m_parentContext, contextType.CT_ASSIGNMENT_LEFT);
            this.VisitElementInContext(context.expr(), m_parentContext, contextType.CT_ASSIGNMENT_RIGHT);

            m_parents.Pop();
            return(0);
        }
        public override int VisitExpr_ASSIGNMENT(firstParser.Expr_ASSIGNMENTContext context)
        {
            int    serial = ms_serialCounter++;
            string s      = "Assign_" + serial;

            // Preorder action
            outFile.WriteLine("\"{0}\"->\"{1}\";", m_labels.Peek(), s);

            m_labels.Push(s);

            base.VisitChildren(context);

            m_labels.Pop();
            return(0);
        }