Пример #1
0
        public void Visit(NotNode n)
        {
            var children     = n.GetChildren();
            var table        = (FunctionSymbolTableEntry)n.SymTable;
            var resultOffset = table.MemoryLayout.GetOffset(n.TemporaryVariableName);

            var operandVarOffsets = new List <int>();

            foreach (var child in children)
            {
                child.Accept(this);
                var offset = table.MemoryLayout.GetOffset(child.TemporaryVariableName);
                operandVarOffsets.Add(offset);
            }

            _writer.WriteComment($"Not at ({n.Token.StartLine}:{n.Token.StartColumn})");

            var opReg   = PopRegister();
            var destReg = PopRegister();

            _writer.WriteInstruction(Instructions.Lw, opReg, $"{operandVarOffsets[0]}({FSPReg})");
            _writer.WriteInstruction(Instructions.Not, destReg, opReg);
            _writer.WriteInstruction(Instructions.Sw, $"{resultOffset}({FSPReg})", destReg);

            PushRegister(destReg);
            PushRegister(opReg);
        }
Пример #2
0
        public void Visit(NotNode n)
        {
            var child = n.GetChildren().Single();

            child.Accept(this);
            n.ExprType = child.ExprType;
        }
Пример #3
0
 public void Visit(NotNode n)
 {
     PrintDOTIDLabel(n);
     PrintDOTParentChild(n);
     foreach (var child in n.GetChildren())
     {
         child.Accept(this);
     }
 }
Пример #4
0
        public void Visit(NotNode n)
        {
            var children = n.GetChildren();

            foreach (var child in children)
            {
                child.SymTable = n.SymTable;
                child.Accept(this);
            }
        }
        public void Visit(NotNode n)
        {
            var table = (FunctionSymbolTableEntry)n.SymTable;

            n.TemporaryVariableName = table.MemoryLayout.AddTemporaryVariable();

            var children = n.GetChildren();

            foreach (var child in children)
            {
                child.Accept(this);
            }
        }