public override void PreVisit(MainStatBlock mainStatBlock) { this.FunctionScope = GlobalScope.Get("main", Classification.Function).Link; this.ClassInstanceScope = new SymbolTable(); InstructionStream.Add("entry"); }
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"); }
public override void Visit(MainStatBlock mainStatBlock) { this.Visit((StatBlock)mainStatBlock); }
public override void PreVisit(MainStatBlock mainStatBlock) { this.FunctionScopeLink = this.GlobalScope.Get("main", Classification.Function); this.ClassInstanceScope = new SymbolTable(); }
public override void PreVisit(MainStatBlock statBlock) { this._lastFunctionRequiredReturnType = "__MAIN__"; this._functionScope = statBlock.Table; this._classInstanceScope = new SymbolTable(); }
public virtual void PreVisit(MainStatBlock mainStatBlock) { }