public StaticVariableInfo(TerminalName name, Static representation)
     : base(name, representation)
 {
 }
 /// <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+":");
 }
 public bool TryGetRepresentation(TerminalName refName, out Representation result)
 {
     result=(Representation)VariableNameToRepresentation[refName];
       return result!=null;
 }
 public bool IsLiveLocalVariableName(TerminalName name)
 {
     return liveLocalVariableNames.ContainsKey(name);
 }
 public Representation AllocateRepresentation(TerminalName variableName)
 {
     return (Representation)AllocateRegisterIfPossible(null) ?? AllocateStackTemporary();
 }
Beispiel #7
0
 protected VariableInfo(TerminalName name, Representation representation)
 {
     this.Name=name;
       this.Representation=representation;
 }
 public LocalVariableInfo(TerminalName name, Representation representation)
     : base(name, representation)
 {
 }