예제 #1
0
        public int GetParameterBytes(int block)
        {
            StackMemory mem;

            try
            {
                mem = Memory[block];
            }
            catch
            {
                mem = new StackMemory();
                Memory.Add(block, mem);
            }
            return(Memory[block].ParameterBytes);
        }
예제 #2
0
        public void AllocMemory(Identifier localVariable)
        {
            StackMemory mem;

            try
            {
                mem = Memory[localVariable.BlockId];
                //Memory.TryGetValue(block, out mem);
            }
            catch (KeyNotFoundException)
            {
                mem = new StackMemory();
                Memory.Add(localVariable.BlockId, mem);
            }
            mem.Alloc(localVariable);
        }
예제 #3
0
        public void AllocMemory(int block, FormalArgument argument)
        {
            StackMemory mem;

            try
            {
                mem = Memory[block];
                //Memory.TryGetValue(block, out mem);
            }
            catch (KeyNotFoundException)
            {
                mem = new StackMemory();
                Memory.Add(block, mem);
            }
            mem.Alloc(argument.VariableType, argument.Identifier);
        }