예제 #1
0
 public void Accept(IdentifierNode node)
 {
 }
예제 #2
0
 public void Accept(IdentifierNode node)
 {
     if (node.Identifier == "this")
     {
         method.Emit(node.SourceLocation, InstructionType.SelfReference);
         return;
     }
     if (table.ContainsGlobalSymbol(node.Identifier))
         method.Emit(node.SourceLocation, InstructionType.LoadGlobalVariable, table.GetGlobalSymbol(node.Identifier));
     else if (!table.ContainsSymbol(node.Identifier))
     {
         if (!module.ConstantPool.ContainsValue(node.Identifier))
             module.ConstantPool.Add(node.Identifier.GetHashCode(), node.Identifier);
         method.Emit(node.SourceLocation, InstructionType.LoadGlobal, node.Identifier.GetHashCode());
     }
     else
         method.Emit(node.SourceLocation, InstructionType.LoadLocal, table.GetSymbol(node.Identifier));
 }