Ejemplo n.º 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)));
			}
		}
Ejemplo n.º 2
0
 public void Accept(NameExpression ident)
 {
     ident.Visit (functionCompiler);
 }
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 4
0
		public override void Accept (NameExpression ident)
		{
			symbolTable.AddSymbol (ident.Value);
		}
Ejemplo n.º 5
0
 public virtual void Accept(NameExpression ident)
 {
 }