Пример #1
0
		public override void Accept (NameExpression ident)
		{
			if (symbolTable.IsSymbolDefined (ident.Value)) {
				Symbol sym = symbolTable.GetSymbol (ident.Value);
				if (sym.Type == SymbolType.Local) {
					methodBuilder.EmitInstruction (ident.Location, Opcode.LoadLocal, sym.Index);
				} else {
					methodBuilder.EmitInstruction (ident.Location, Opcode.LoadGlobal,
						methodBuilder.Module.DefineConstant (new IodineName (ident.Value)));
				}
			} else {
				methodBuilder.EmitInstruction (ident.Location, Opcode.LoadGlobal,
					methodBuilder.Module.DefineConstant (new IodineName (ident.Value)));
			}
		}
Пример #2
0
 public void Accept(NameExpression ident)
 {
     ident.Visit (functionCompiler);
 }
Пример #3
0
		public override void Accept (NameExpression ident)
		{
			if (ident.Value == "_") {
				methodBuilder.EmitInstruction (ident.Location, Opcode.LoadTrue);
			} else {
				methodBuilder.EmitInstruction (ident.Location, Opcode.LoadLocal, temporary);
				methodBuilder.EmitInstruction (ident.Location, Opcode.StoreLocal,
					symbolTable.GetSymbol (ident.Value).Index);
				methodBuilder.EmitInstruction (ident.Location, Opcode.LoadTrue);
			}
		}
Пример #4
0
		public override void Accept (NameExpression ident)
		{
			symbolTable.AddSymbol (ident.Value);
		}
Пример #5
0
 public virtual void Accept(NameExpression ident)
 {
 }