Exemplo n.º 1
0
 public void Visit(ASTNode_GetVar node)
 {
     if (node.address is FreeAddress)
     {
         var v = (FreeAddress)node.address;
         if (FreeAddresses.IndexOf(v) == -1)
         {
             FreeAddresses.Add(v);
         }
     }
 }
Exemplo n.º 2
0
 public void Visit(ASTNode_GetVar node)
 {
     if (node.address is LocalAddress)
     {
         ByteCodes.Add(ByteCodeEnum.PUSH_LOCAL);
         ByteCodes.Add(((LocalAddress)node.address).index);
     }
     else if (node.address is GlobalAddress)
     {
         ByteCodes.Add(ByteCodeEnum.PUSH_GLOBAL);
         ByteCodes.Add(((GlobalAddress)node.address).index);
     }
     else
     {
         var address = GetTranslatedFreeAddress((FreeAddress)node.address);
         ByteCodes.Add(ByteCodeEnum.PUSH_FREE);
         ByteCodes.Add(address.envIndex);
         ByteCodes.Add(address.index);
     }
 }
Exemplo n.º 3
0
 public void Visit(ASTNode_GetVar node)
 {
     Value = Env.GetVar(mEnv, node.address);
 }
Exemplo n.º 4
0
 public void Visit(ASTNode_GetVar node)
 {
     Value = Env.GetVar(mEnv, node.address);
 }
Exemplo n.º 5
0
 public void Visit(ASTNode_GetVar node)
 {
     if (node.address is FreeAddress) {
         var v = (FreeAddress)node.address;
         if (FreeAddresses.IndexOf(v) == -1) {
             FreeAddresses.Add(v);
         }
     }
 }
Exemplo n.º 6
0
 public void Visit(ASTNode_GetVar node)
 {
     if (node.address is LocalAddress) {
         ByteCodes.Add(ByteCodeEnum.PUSH_LOCAL);
         ByteCodes.Add(((LocalAddress)node.address).index);
     } else if (node.address is GlobalAddress) {
         ByteCodes.Add(ByteCodeEnum.PUSH_GLOBAL);
         ByteCodes.Add(((GlobalAddress)node.address).index);
     } else {
         var address = GetTranslatedFreeAddress((FreeAddress)node.address);
         ByteCodes.Add(ByteCodeEnum.PUSH_FREE);
         ByteCodes.Add(address.envIndex);
         ByteCodes.Add(address.index);
     }
 }