Exemplo n.º 1
0
            public void Visit(ASTNode_SetVar node)
            {
                mTailFlag.Push(false);
                node.rightNode.AcceptVisitor(this);
                mTailFlag.Pop();

                if (node.address is LocalAddress)
                {
                    ByteCodes.Add(ByteCodeEnum.POP_LOCAL);
                    ByteCodes.Add(((LocalAddress)node.address).index);
                }
                else if (node.address is GlobalAddress)
                {
                    ByteCodes.Add(ByteCodeEnum.POP_GLOBAL);
                    ByteCodes.Add(((GlobalAddress)node.address).index);
                }
                else
                {
                    var address = GetTranslatedFreeAddress((FreeAddress)node.address);
                    ByteCodes.Add(ByteCodeEnum.POP_FREE);
                    ByteCodes.Add(address.envIndex);
                    ByteCodes.Add(address.index);
                }

                ByteCodes.Add(ByteCodeEnum.PUSH_LITERAL);
                ByteCodes.Add(GetLiteralIndex(null));
            }
Exemplo n.º 2
0
 public void Visit(ASTNode_SetVar node)
 {
     if (node.address is FreeAddress)
     {
         var v = (FreeAddress)node.address;
         if (FreeAddresses.IndexOf(v) == -1)
         {
             FreeAddresses.Add(v);
         }
     }
     node.rightNode.AcceptVisitor(this);
 }
Exemplo n.º 3
0
 public void Visit(ASTNode_SetVar node)
 {
     node.rightNode.AcceptVisitor(this);
     Env.SetVar(mEnv, node.address, Value);
     Value = null;
 }
Exemplo n.º 4
0
 public void Visit(ASTNode_SetVar node)
 {
     node.rightNode.AcceptVisitor(this);
     Env.SetVar(mEnv, node.address, Value);
     Value = null;
 }
Exemplo n.º 5
0
 public void Visit(ASTNode_SetVar node)
 {
     if (node.address is FreeAddress) {
         var v = (FreeAddress)node.address;
         if (FreeAddresses.IndexOf(v) == -1) {
             FreeAddresses.Add(v);
         }
     }
     node.rightNode.AcceptVisitor(this);
 }
Exemplo n.º 6
0
            public void Visit(ASTNode_SetVar node)
            {
                mTailFlag.Push(false);
                node.rightNode.AcceptVisitor(this);
                mTailFlag.Pop();

                if (node.address is LocalAddress) {
                    ByteCodes.Add(ByteCodeEnum.POP_LOCAL);
                    ByteCodes.Add(((LocalAddress)node.address).index);
                } else if (node.address is GlobalAddress) {
                    ByteCodes.Add(ByteCodeEnum.POP_GLOBAL);
                    ByteCodes.Add(((GlobalAddress)node.address).index);
                } else {
                    var address = GetTranslatedFreeAddress((FreeAddress)node.address);
                    ByteCodes.Add(ByteCodeEnum.POP_FREE);
                    ByteCodes.Add(address.envIndex);
                    ByteCodes.Add(address.index);
                }

                ByteCodes.Add(ByteCodeEnum.PUSH_LITERAL);
                ByteCodes.Add(GetLiteralIndex(null));
            }