Пример #1
0
        public override object VisitFunctionBody(PParser.FunctionBodyContext context)
        {
            // TODO: check that parameters have been added to internal scope?

            // Add all local variables to scope.
            foreach (PParser.VarDeclContext varDeclContext in context.varDecl())
            {
                Visit(varDeclContext);
            }

            // Build the statement trees
            var statementVisitor = new StatementVisitor(handler, machine, method);

            method.Body = new CompoundStmt(context, context.statement().Select(statementVisitor.Visit).ToList());
            return(null);
        }
Пример #2
0
 public override object VisitFunctionBody(PParser.FunctionBodyContext context)
 {
     return(null);
 }
Пример #3
0
        public override IPStmt VisitFunctionBody(PParser.FunctionBodyContext context)
        {
            List <IPStmt> statements = context.statement().Select(Visit).ToList();

            return(new CompoundStmt(context, statements));
        }