コード例 #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
ファイル: ModuleCompiler.cs プロジェクト: iwatakeshi/Iodine
 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)
 {
 }