/// <summary> /// Generates the code for exiting the given variable map /// </summary> /// <param name="map"></param> private void GenerateBlockExit(LocalVariableMap map) { if (map.ScopeByteSize != 0) { writer.WriteLine("addl ${0}, %esp", map.ScopeByteSize); // Move the stack pointer 'back' (up) to where it was before entering this block } }
private void EnterLoop(string continueLabel, string breakLabel, LocalVariableMap variableMap) { loopDatas.Push(new LoopData(continueLabel, breakLabel, variableMap)); }
public LoopData(string continueLabel, string breakLabel, LocalVariableMap loopLevelMap) { ContinueLabel = continueLabel; BreakLabel = breakLabel; LoopLevelMap = loopLevelMap; }
public LocalVariableMap(LocalVariableMap template) { map = template.map; // We can do this since map is immutable, e.g. if we 'change it' we'll just get a copy and the original one remains the same offset = template.offset; newlyDeclaredVars = new HashSet <string>(); // Needs to be new }