diff dmd/DotTypeExp.d @ 0:10317f0c89a5

Initial commit
author korDen
date Sat, 24 Oct 2009 08:42:06 +0400
parents
children 2e2a5c3f943a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dmd/DotTypeExp.d	Sat Oct 24 08:42:06 2009 +0400
@@ -0,0 +1,48 @@
+module dmd.DotTypeExp;
+
+import dmd.Expression;
+import dmd.backend.elem;
+import dmd.UnaExp;
+import dmd.OutBuffer;
+import dmd.Loc;
+import dmd.Scope;
+import dmd.IRState;
+import dmd.HdrGenState;
+import dmd.Dsymbol;
+import dmd.TOK;
+import dmd.PREC;
+import dmd.expression.Util;
+
+class DotTypeExp : UnaExp
+{
+	Dsymbol sym;
+
+	this(Loc loc, Expression e, Dsymbol s)
+	{
+		super(loc, TOK.TOKdottype, DotTypeExp.sizeof, e);
+		this.sym = s;
+		this.type = s.getType();
+	}
+
+	Expression semantic(Scope sc)
+	{
+	version (LOGSEMANTIC) {
+		printf("DotTypeExp.semantic('%s')\n", toChars());
+	}
+		UnaExp.semantic(sc);
+		return this;
+	}
+
+	void toCBuffer(OutBuffer buf, HdrGenState* hgs)
+	{
+		expToCBuffer(buf, hgs, e1, PREC.PREC_primary);
+		buf.writeByte('.');
+		buf.writestring(sym.toChars());
+	}
+
+	elem* toElem(IRState* irs)
+	{
+		assert(false);
+	}
+}
+