Exemplo n.º 1
0
 /// <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
     }
 }
Exemplo n.º 2
0
 private void EnterLoop(string continueLabel, string breakLabel, LocalVariableMap variableMap)
 {
     loopDatas.Push(new LoopData(continueLabel, breakLabel, variableMap));
 }
Exemplo n.º 3
0
 public LoopData(string continueLabel, string breakLabel, LocalVariableMap loopLevelMap)
 {
     ContinueLabel = continueLabel;
     BreakLabel    = breakLabel;
     LoopLevelMap  = loopLevelMap;
 }
Exemplo n.º 4
0
 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
 }