Exemplo n.º 1
0
        private CodeGenerator(CodeGeneratorHints generatorHints, ActionOnCodeGenerator action, int phase)
        {
            Instance=this;
              this.GeneratorHints=generatorHints;
              this.labelNameToAddress=generatorHints.LabelNameToAddress.ToHashtable();

              var stars=new string('*', 78);
              Debug.Print(stars);
              Debug.Print(stars);
              Debug.Print("***** STARTING PHASE "+phase);
              Debug.Print(stars);
              Debug.Print(stars);

              action(this);
        }
Exemplo n.º 2
0
 public static CompiledCode Compile(ActionOnCodeGenerator build)
 {
     var hints=new CodeGeneratorHints();
       var phaseIndex=0;
       while(true) {
     try {
       var result=new CodeGenerator(hints, build, phaseIndex++).Finish();
       hints=result as CodeGeneratorHints;
       if(hints==null) {
     return (CompiledCode)result;
       }
     } finally {
       Instance=null;
     }
       }
 }