annotate ast/Decl.d @ 63:9f8131676242 new_gen

Now Decl's have a DType type(), and should use varType and returnType to get the old type id
author Anders Halager <halager@gmail.com>
date Tue, 29 Apr 2008 15:13:38 +0200
parents 2451f0904bf6
children 91f10c34cd7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
1 module ast.Decl;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
2
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
3 import ast.Exp,
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
4 ast.Stmt;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
5
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
6 import lexer.Token;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
7
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
8 import tango.io.Stdout;
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
9
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
10 import sema.SymbolTable,
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
11 sema.DType,
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
12 basic.SmallArray;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
13
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
14 enum DeclType
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
15 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
16 VarDecl,
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
17 FuncDecl,
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
18 StructDecl,
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
19 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
20
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
21 class Decl
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
22 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
23 this(DeclType declType)
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
24 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
25 this.declType = declType;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
26 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
27
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
28 void simplify()
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
29 {
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
30 }
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
31
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
32 DType type() { return null; }
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
33
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
34 DeclType declType;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
35 Scope env;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
36 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
37
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
38 class VarDecl : Decl
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
39 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
40 this(Identifier type, Identifier identifier,
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
41 Exp e = null)
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
42 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
43 super(DeclType.VarDecl);
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
44 this.varType = type;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
45 this.identifier = identifier;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
46 this.init = e;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
47 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
48
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
49 void simplify()
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
50 {
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
51 }
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
52
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
53 override DType type()
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
54 {
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
55 return env.find(identifier).type;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
56 }
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
57
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
58 Identifier varType, identifier;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
59 Exp init;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
60 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
61
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
62 class FuncDecl : Decl
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
63 {
44
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
64 this(Identifier type, Identifier identifier)
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
65 {
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
66 super(DeclType.FuncDecl);
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
67 this.returnType = type;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
68 this.identifier = identifier;
44
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
69 }
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
70
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
71 void addParam(Identifier type, Identifier name)
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
72 {
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
73 funcArgs ~= new VarDecl(type, name, null);
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
74 }
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
75
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
76 void setBody(CompoundStatement stmts)
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
77 {
495188f9078e Big update - Moving towards a better, more seperated parser
Anders Halager <halager@gmail.com>
parents: 22
diff changeset
78 statements = stmts.statements;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
79 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
80
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
81 void simplify()
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
82 {
60
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
83 if(auto t = cast(DFunction)env.find(identifier).type)
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
84 {
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
85 if(auto s = cast(DStruct)t.returnType)
60
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
86 {
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
87 VarDecl[] funcArgs;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
88 auto i = new Identifier("ret.val");
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
89 i.env = env;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
90 i.env.add(i);
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
91 i.env.find(i).type = s;
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
92 auto var = new VarDecl(returnType, i);
60
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
93 var.env = env;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
94 funcArgs ~= var;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
95 funcArgs ~= this.funcArgs;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
96 this.funcArgs = funcArgs;
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
97 t.returnType = DType.Void;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
98 this.returnType = new Identifier("void");
60
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
99 env.find(identifier).type = t;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
100 sret = true;
2451f0904bf6 Dumping Ast with AstPrinter is now possible again! :)
Anders Johnsen <skabet@gmail.com>
parents: 56
diff changeset
101 }
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
102 }
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
103
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
104 foreach ( funcArg ; funcArgs )
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
105 funcArg.simplify();
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
106 foreach ( stmt ; statements )
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
107 stmt.simplify();
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
108 }
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
109
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
110 override DType type()
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
111 {
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
112 if (myType !is null)
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
113 return myType;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
114
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
115 auto t = new DFunction(identifier);
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
116 t.returnType = env.findType(returnType);
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
117 SmallArray!(DType) array;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
118 foreach (a; funcArgs)
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
119 array ~= a.type();
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
120 t.params = array.safe();
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
121 myType = t;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
122 return myType;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
123 }
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
124
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
125 Identifier returnType, identifier;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
126 VarDecl[] funcArgs;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
127 Stmt[] statements;
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
128 bool sret = false;
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
129 private DType myType;
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
130 }
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
131
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
132 class StructDecl : Decl
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
133 {
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
134 this(Identifier identifier)
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
135 {
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
136 super(DeclType.StructDecl);
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
137 this.identifier = identifier;
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
138 this.vars = vars;
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
139 }
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
140
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
141 void addMember(Identifier type, Identifier name, Exp exp)
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
142 {
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
143 vars ~= new VarDecl(type, name, exp);
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
144 }
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 44
diff changeset
145
56
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
146 void simplify()
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
147 {
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
148 }
4ae365eff712 Now return types works for structs... Also, simplyfing in AST have been startet - but still messy. This update is a little messy...
Anders Johnsen <skabet@gmail.com>
parents: 53
diff changeset
149
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
150 override DType type()
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
151 {
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
152 return env.find(identifier).type;
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
153 }
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
154
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
155 Identifier identifier;
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
156 VarDecl[] vars;
63
9f8131676242 Now Decl's have a DType type(), and should use varType and returnType to get the old type id
Anders Halager <halager@gmail.com>
parents: 60
diff changeset
157 private DType myType;
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
158 }
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 1
diff changeset
159