diff dmd/ConditionalStatement.d @ 0:10317f0c89a5

Initial commit
author korDen
date Sat, 24 Oct 2009 08:42:06 +0400
parents
children 0aa7d1437ada
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dmd/ConditionalStatement.d	Sat Oct 24 08:42:06 2009 +0400
@@ -0,0 +1,65 @@
+module dmd.ConditionalStatement;
+
+import dmd.Statement;
+import dmd.Condition;
+import dmd.Loc;
+import dmd.OutBuffer;
+import dmd.Scope;
+import dmd.HdrGenState;
+import dmd.ArrayTypes;
+import dmd.BE;
+
+class ConditionalStatement : Statement
+{
+    Condition condition;
+    Statement ifbody;
+    Statement elsebody;
+
+    this(Loc loc, Condition condition, Statement ifbody, Statement elsebody)
+	{
+		super(loc);
+		this.condition = condition;
+		this.ifbody = ifbody;
+		this.elsebody = elsebody;
+	}
+	
+    Statement syntaxCopy()
+	{
+		assert(false);
+	}
+	
+    Statement semantic(Scope sc)
+	{
+		assert(false);
+	}
+	
+    Statements flatten(Scope sc)
+	{
+		Statement s;
+
+		if (condition.include(sc, null))
+			s = ifbody;
+		else
+			s = elsebody;
+
+		Statements a = new Statements();
+		a.push(cast(void*)s);
+
+		return a;
+	}
+	
+    bool usesEH()
+	{
+		assert(false);
+	}
+	
+    BE blockExit()
+	{
+		assert(false);
+	}
+
+    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
+	{
+		assert(false);
+	}
+}
\ No newline at end of file