Esempio n. 1
0
        public override int VisitTerminal(ITerminalNode node)
        {
            ASTComposite m_parent = m_parents.Peek();

            switch (node.Symbol.Type)
            {
            case firstLexer.NUMBER:
                CASTNUMBER newnode1 = new CASTNUMBER(node.Symbol.Text, nodeType.NT_NUMBER, m_parents.Peek(), 0);
                m_parent.AddChild(newnode1, m_parentContext.Peek());
                break;

            case firstLexer.IDENTIFIER:
                CASTIDENTIFIER newnode2 = new CASTIDENTIFIER(node.Symbol.Text, nodeType.NT_IDENTIFIER, m_parents.Peek(), 0);
                m_parent.AddChild(newnode2, m_parentContext.Peek());
                break;

            default:
                break;
            }
            return(base.VisitTerminal(node));
        }
 public virtual T VisitIDENTIFIER(CASTIDENTIFIER node)
 {
     VisitChildren(node);
     return(default(T));
 }
Esempio n. 3
0
 public override int VisitIDENTIFIER(CASTIDENTIFIER node)
 {
     m_ostream.WriteLine("{0}->{1}", node.MParent.MNodeName, node.MNodeName);
     return(base.VisitIDENTIFIER(node));
 }