view dmd/SymbolDeclaration.d @ 114:e28b18c23469

added a module dmd.common for commonly used stuff it currently holds code for consistency checking of predefined versions also added a VisualD project file
author Trass3r
date Wed, 01 Sep 2010 18:21:58 +0200
parents 2e2a5c3f943a
children e3afd1303184
line wrap: on
line source

module dmd.SymbolDeclaration;

import dmd.common;
import dmd.Declaration;
import dmd.StructDeclaration;
import dmd.Loc;
import dmd.TOK;
import dmd.STC;
import dmd.Identifier;

import dmd.backend.Symbol;

import core.stdc.string;
import std.stdio;

// This is a shell around a back end symbol

class SymbolDeclaration : Declaration
{
    Symbol* sym;
    StructDeclaration dsym;

    this(Loc loc, Symbol* s, StructDeclaration dsym)
	{
		int len = strlen(s.Sident.ptr);
		string name = s.Sident.ptr[0..len].idup;

		super(new Identifier(name, TOK.TOKidentifier));
		
		this.loc = loc;
		sym = s;
		this.dsym = dsym;
		storage_class |= STCconst;
	}

    override Symbol* toSymbol()
	{
		return sym;
	}

    // Eliminate need for dynamic_cast
    override SymbolDeclaration isSymbolDeclaration() { return this; }
}