コード例 #1
0
        public override void PreVisit(MainStatBlock mainStatBlock)
        {
            this.FunctionScope      = GlobalScope.Get("main", Classification.Function).Link;
            this.ClassInstanceScope = new SymbolTable();

            InstructionStream.Add("entry");
        }
コード例 #2
0
        public override void Visit(MainStatBlock mainStatBlock)
        {
            InstructionStream.Add("hlt");

            int programSize   = InstructionStream.Instructions.Count * 4;
            int indexToInsert = InstructionStream.Instructions.IndexOf("entry") + 1;

            InstructionStream.Instructions.Insert(indexToInsert, $"addi r14, r0, {programSize}  % Set the stack pointer");
        }
コード例 #3
0
 public override void Visit(MainStatBlock mainStatBlock)
 {
     this.Visit((StatBlock)mainStatBlock);
 }
コード例 #4
0
 public override void PreVisit(MainStatBlock mainStatBlock)
 {
     this.FunctionScopeLink  = this.GlobalScope.Get("main", Classification.Function);
     this.ClassInstanceScope = new SymbolTable();
 }
コード例 #5
0
 public override void PreVisit(MainStatBlock statBlock)
 {
     this._lastFunctionRequiredReturnType = "__MAIN__";
     this._functionScope      = statBlock.Table;
     this._classInstanceScope = new SymbolTable();
 }
コード例 #6
0
 public virtual void PreVisit(MainStatBlock mainStatBlock)
 {
 }