Example #1
0
        public override BaseNode VisitInitial(CoronaParser.InitialContext context)
        {
            // Visit each statement and add to the initial node
            StatementNode statement = new BuildStatementAst().Visit(context.compoundStatement());

            return(new InitialNode(statement));
        }
Example #2
0
        public override BaseNode VisitRules(CoronaParser.RulesContext context)
        {
            BuildStatementAst statementVisitor = new BuildStatementAst();
            RulesNode         node             = new RulesNode(new List <StatementNode>());

            // Visit each statement in rules
            foreach (CoronaParser.StatementContext s in context.compoundStatement().statement())
            {
                node.Statements.Add(statementVisitor.Visit(s));
            }

            return(node);
        }