comparison trunk/src/dil/ast/Expression.d @ 645:89ee7802c978

Moved semantic() methods of expressions to class SemanticPass1.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Mon, 14 Jan 2008 16:01:21 +0100
parents 2ac14bb6b84e
children 10b314bf37e3
comparison
equal deleted inserted replaced
644:a0643a4d4501 645:89ee7802c978
3 License: GPL3 3 License: GPL3
4 +/ 4 +/
5 module dil.ast.Expression; 5 module dil.ast.Expression;
6 6
7 import dil.ast.Node; 7 import dil.ast.Node;
8 import dil.semantic.Scope;
9 import dil.semantic.Types; 8 import dil.semantic.Types;
10 import common; 9 import common;
11 10
11 /// The root class of all expressions.
12 abstract class Expression : Node 12 abstract class Expression : Node
13 { 13 {
14 Type type; /// The type of this expression. 14 Type type; /// The type of this expression.
15 15
16 this() 16 this()
17 { 17 {
18 super(NodeCategory.Expression); 18 super(NodeCategory.Expression);
19 } 19 }
20 20
21 // Semantic analysis:
22
23 Expression semantic(Scope scop)
24 {
25 debug Stdout("SA for "~this.classinfo.name).newline;
26 if (!type)
27 type = Types.Undefined;
28 return this;
29 }
30
31 Expression evaluate() 21 Expression evaluate()
32 { 22 {
33 return null; 23 return null;
34 } 24 }
35
36 import dil.Messages;
37 void error(Scope scop, MID mid)
38 {
39 scop.error(this.begin, mid);
40 }
41
42 void error(Scope scop, char[] msg)
43 {
44
45 }
46 } 25 }