Пример #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);
        }
Пример #2
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);
        }
Пример #3
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;
     }
       }
 }
Пример #4
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;
                }
            }
        }