Ejemplo n.º 1
0
        public Type Visit(Argument argument, FunctionGeneratorEnvironment arg)
        {
            arg.AllocateVariable(argument.id, (Type)argument.type);
            Program.Emit(T42Instruction.DECL(1));

            return((Type)argument.type);
        }
Ejemplo n.º 2
0
        public T42Program Generate(Statement stmt)
        {
            var globalEnvironment = new FunctionGeneratorEnvironment();

            Program.Emit(T42Instruction.DECL(1));
            Program.Emit(T42Instruction.BSR("main"));
            Program.Emit(T42Instruction.END);
            stmt.Accept(this, globalEnvironment);
            Program.Link();
            return(Program);
        }