Ejemplo n.º 1
0
        public Builder(BuilderOptions options, DyLinker linker)
        {
            this.referencedUnits = new Dictionary <string, UnitInfo>();
            this.types           = new Dictionary <string, TypeInfo>();
            this.memberNames     = new Dictionary <string, int>();

            this.options = options;
            this.linker  = linker;
            counters     = new Stack <int>();
            pdb          = new DebugWriter();
            isDebug      = options.Debug;
            globalScope  = new Scope(true, null);
            unit         = new Unit
            {
                GlobalScope = globalScope,
                Symbols     = pdb.Symbols
            };
            cw           = new CodeWriter(unit);
            currentScope = globalScope;
            programEnd   = cw.DefineLabel();
        }
Ejemplo n.º 2
0
 public Builder(Builder builder)
 {
     this.iterative       = true;
     this.linker          = builder.linker;
     this.types           = builder.types;
     this.memberNames     = builder.memberNames;
     this.referencedUnits = builder.referencedUnits;
     this.counters        = new Stack <int>();
     this.options         = builder.options;
     this.pdb             = builder.pdb.Clone();
     this.unit            = builder.unit.Clone(this.pdb.Symbols);
     this.cw           = builder.cw.Clone(this.unit);
     this.globalScope  = unit.GlobalScope;
     this.currentScope = builder.currentScope != builder.globalScope
         ? builder.currentScope.Clone() : this.globalScope;
     this.isDebug        = builder.isDebug;
     this.lastLocation   = builder.lastLocation;
     this.Messages       = new List <BuildMessage>();
     this.counters       = new Stack <int>(builder.counters.ToArray());
     this.currentCounter = builder.currentCounter;
     this.programEnd     = cw.DefineLabel();
 }
Ejemplo n.º 3
0
 public DyCompiler(DyCompiler compiler)
 {
     this.options = compiler.options;
     this.linker  = compiler.linker;
     this.builder = new Builder(compiler.builder);
 }
Ejemplo n.º 4
0
 public DyCompiler(BuilderOptions options, DyLinker linker)
 {
     this.options = options ?? BuilderOptions.Default();
     this.linker  = linker;
     this.builder = new Builder(this.options, linker);
 }