Esempio n. 1
0
        public override GrammarParseResult VisitStatements(StatementsContext context)
        {
            if (context == null)
            {
                return(GrammarParseResult.Unsuccessful(context.GetText()));
            }

            Debug.WriteLine($"VisitStatements \"{context.GetText()}\"");

            StatementContext[] statements = context.statement();

            if (statements.Length == 1)
            {
                return(VisitStatement(statements[0]));
            }

            GrammarParseResult result = new GrammarParseResult(context.GetText());

            foreach (StatementContext ctx in statements)
            {
                result.Children.Add(VisitStatement(ctx));
            }

            return(result);
        }
Esempio n. 2
0
        public MathFuncNode VisitStatements(StatementsContext context)
        {
            MathFuncNode result = null;

            foreach (StatementContext statement in context.statement())
            {
                result = Visit(statement);
            }
            return(result);
        }
        public List <ClassDescriptor> VisitStatements(StatementsContext context)
        {
            List <ClassDescriptor> tables = new List <ClassDescriptor>();

            foreach (var statement in context.statement())
            {
                tables.Add(VisitStmt(statement));
            }

            return(tables);
        }
Esempio n. 4
0
 public new IList <StatementNode> VisitStatements([NotNull] StatementsContext context)
 {
     return(context.statement().Select(VisitStatement).ToList());
 }