view dmd/ProtDeclaration.d @ 49:0aa7d1437ada

AttribDeclaration.oneMember Lexer.decodeUTF WithStatement.ctor StructDeclaration.syntaxCopy CtorDeclaration.syntaxCopy ConditionalStatement.syntaxCopy ProtDeclaration.syntaxCopy ArrayScopeSymbol.this TemplateDeclaration.toChars
author korDen
date Sat, 21 Aug 2010 07:53:20 +0400
parents 10317f0c89a5
children 2e2a5c3f943a
line wrap: on
line source

module dmd.ProtDeclaration;

import dmd.AttribDeclaration;
import dmd.PROT;
import dmd.OutBuffer;
import dmd.HdrGenState;
import dmd.Scope;
import dmd.Dsymbol;
import dmd.Array;

class ProtDeclaration : AttribDeclaration
{
    PROT protection;

    this(PROT p, Array decl)
	{
		super(decl);

		protection = p;
		//printf("decl = %p\n", decl);
	}
	
    Dsymbol syntaxCopy(Dsymbol s)
	{
		ProtDeclaration pd;

		assert(!s);
		pd = new ProtDeclaration(protection, Dsymbol.arraySyntaxCopy(decl));
		return pd;
	}
	
    void setScope(Scope sc)
	{
		if (decl)
		{
			setScopeNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign);
		}
	}
	
    void semantic(Scope sc)
	{
		if (decl)
		{
			semanticNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign);
		}
	}
	
    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
	{
		assert(false);
	}

    static void protectionToCBuffer(OutBuffer buf, PROT protection)
	{
		assert(false);
	}
}