diff trunk/src/dil/ast/Expression.d @ 621:2ac14bb6b84e

Moved class dil.ast.Expression to its own module.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 11 Jan 2008 01:11:12 +0100
parents
children 89ee7802c978
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/dil/ast/Expression.d	Fri Jan 11 01:11:12 2008 +0100
@@ -0,0 +1,46 @@
+/++
+  Author: Aziz Köksal
+  License: GPL3
++/
+module dil.ast.Expression;
+
+import dil.ast.Node;
+import dil.semantic.Scope;
+import dil.semantic.Types;
+import common;
+
+abstract class Expression : Node
+{
+  Type type; /// The type of this expression.
+
+  this()
+  {
+    super(NodeCategory.Expression);
+  }
+
+  // Semantic analysis:
+
+  Expression semantic(Scope scop)
+  {
+    debug Stdout("SA for "~this.classinfo.name).newline;
+    if (!type)
+      type = Types.Undefined;
+    return this;
+  }
+
+  Expression evaluate()
+  {
+    return null;
+  }
+
+  import dil.Messages;
+  void error(Scope scop, MID mid)
+  {
+    scop.error(this.begin, mid);
+  }
+
+  void error(Scope scop, char[] msg)
+  {
+
+  }
+}