/// <summary> /// These label addresses aren't guaranteed correct until the final pass of the compiler /// </summary> public int GetLabelAddressBestEffort(TerminalName targetName) { var result = labelNameToAddress[targetName]; if (result == null) { labelsHaveChanged = true; return(0); } return((int)result); }
/// <summary> /// Mark the point in the generated code which is this label's target /// </summary> public void MarkLabel(TerminalName name) { var currentAddress = emitter.CurrentAddress; var previousAddress = labelNameToAddress[name]; if (previousAddress != null && (int)previousAddress != currentAddress) { labelsHaveChanged = true; } labelNameToAddress[name] = currentAddress; Debug.Print(name + ":"); }
protected VariableInfo(TerminalName name, Representation representation) { this.Name = name; this.Representation = representation; }
public StaticVariableInfo(TerminalName name, Static representation) : base(name, representation) { }
public Label(TerminalName name) { this.Name=name; }
public LocalVariableInfo(TerminalName name, Representation representation) : base(name, representation) { }
public Representation AllocateRepresentation(TerminalName variableName) { return((Representation)AllocateRegisterIfPossible(null) ?? AllocateStackTemporary()); }
public Label(TerminalName name) { this.Name = name; }
public bool IsLiveLocalVariableName(TerminalName name) { return(liveLocalVariableNames.ContainsKey(name)); }
public bool TryGetRepresentation(TerminalName refName, out Representation result) { result = (Representation)VariableNameToRepresentation[refName]; return(result != null); }