예제 #1
0
        public override int VisitExpr_ASSIGN(MINICParser.Expr_ASSIGNContext context)
        {
            ASTComposite         m_parent = m_parents.Peek();
            CASTExpressionAssign newnode  = new CASTExpressionAssign(context.GetText(), 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_EXPRESSION_ASSIGN_LVALUE);
            this.VisitElementInContext(context.expression(), m_parentContext, contextType.CT_EXPRESSION_ASSIGN_EXPRESSION);
            m_parents.Pop();
            return(0);
        }
예제 #2
0
        public override int VisitExpr_ASSIGN(MINICParser.Expr_ASSIGNContext context)
        {
            int    serial = ms_serialCounter++;
            string s      = "Expr_ASSIGN_" + serial;

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

            m_labels.Push(s);

            base.VisitChildren(context);

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