view dmd/TemplateAliasParameter.d @ 7:89cc05dbdae1

Implementing TemplateAliasParameter and TemplateValueParameter
author dkoroskin <>
date Mon, 14 Dec 2009 14:50:03 +0300
parents 10317f0c89a5
children 427f8aa74d28 01cadcfa4842
line wrap: on
line source

module dmd.TemplateAliasParameter;

import dmd.TemplateParameter;
import dmd.Loc;
import dmd.Identifier;
import dmd.Type;
import dmd.ArrayTypes;
import dmd.Scope;
import dmd.Declaration;
import dmd.MATCH;
import dmd.OutBuffer;
import dmd.HdrGenState;
import dmd.Dsymbol;

import dmd.templates.Util;

class TemplateAliasParameter : TemplateParameter
{
    /* Syntax:
     *	specType ident : specAlias = defaultAlias
     */

    Type specType;
    Object specAlias;
    Object defaultAlias;

    static Dsymbol sdummy;

    this(Loc loc, Identifier ident, Type specType, Object specAlias, Object defaultAlias)
	{
		super(loc, ident);

		this.specType = specType;
		this.specAlias = specAlias;
		this.defaultAlias = defaultAlias;
	}

    TemplateAliasParameter isTemplateAliasParameter()
	{
		return this;
	}
	
    TemplateParameter syntaxCopy()
	{
		TemplateAliasParameter tp = new TemplateAliasParameter(loc, ident, specType, specAlias, defaultAlias);
		if (tp.specType)
			tp.specType = specType.syntaxCopy();
		tp.specAlias = objectSyntaxCopy(specAlias);
		tp.defaultAlias = objectSyntaxCopy(defaultAlias);
		return tp;
	}
	
    void declareParameter(Scope sc)
	{
		assert(false);
	}
	
    void semantic(Scope)
	{
		assert(false);
	}
	
    void print(Object oarg, Object oded)
	{
		assert(false);
	}
	
    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
	{
		assert(false);
	}
	
    Object specialization()
	{
		assert(false);
	}
	
    Object defaultArg(Loc loc, Scope sc)
	{
		assert(false);
	}
	
    bool overloadMatch(TemplateParameter)
	{
		assert(false);
	}
	
    MATCH matchArg(Scope sc, Objects tiargs, int i, TemplateParameters parameters, Objects dedtypes, Declaration* psparam, int flags)
	{
		assert(false);
	}
	
    void* dummyArg()
	{
		assert(false);
	}
}