Ejemplo n.º 1
0
        public override int VisitFunctionDefinition(CASTFunctionDefinition node, object param)
        {
            ExtractSubgraphs(node, contextType.CT_FUNCTIONDEFINITION_IDENTIFIER);
            ExtractSubgraphs(node, contextType.CT_FUNCTIONDEFINITION_FARGS);
            ExtractSubgraphs(node, contextType.CT_FUNCTIONDEFINITION_BODY);
            base.VisitFunctionDefinition(node);

            m_ostream.WriteLine("{0}->{1}", node.MParent.MNodeName, node.MNodeName);

            return(0);
        }
Ejemplo n.º 2
0
        public override int VisitFunctionDefinition(MINICParser.FunctionDefinitionContext context)
        {
            ASTComposite           m_parent = m_parents.Peek();
            CASTFunctionDefinition newnode  = new CASTFunctionDefinition(context.GetText(), m_parents.Peek(), 3);

            m_parent.AddChild(newnode, m_parentContext.Peek());
            m_parents.Push(newnode);
            this.VisitTerminalInContext(context, context.IDENTIFIER().Symbol, m_parentContext,
                                        contextType.CT_FUNCTIONDEFINITION_IDENTIFIER);
            if (context.fargs() != null)
            {
                this.VisitElementInContext(context.fargs(), m_parentContext, contextType.CT_FUNCTIONDEFINITION_FARGS);
            }
            this.VisitElementInContext(context.compoundStatement(), m_parentContext, contextType.CT_FUNCTIONDEFINITION_BODY);
            m_parents.Pop();
            return(0);
        }
Ejemplo n.º 3
0
 public virtual Result VisitFunctionDefinition(CASTFunctionDefinition node, VParam param = default(VParam))
 {
     VisitChildren(node, param);
     return(default(Result));
 }