Mercurial > projects > dil
comparison trunk/src/dil/Token.d @ 502:4e14cd1b24da
Refactored code and added modules related to tabulated Identifiers.
Rearranged members of struct Identifier and added new member ID identID.
Moved idTableLookup to module dil.IdTable.
Renamed module TokenIDs to TokensEnum.
Added member Identifier* ident to struct Token.
Changed string switchtes in Parser to integer switches using enum ID.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 11 Dec 2007 14:19:30 +0100 |
parents | 41b7f9e439bd |
children | 996041463028 |
comparison
equal
deleted
inserted
replaced
501:949a53332c66 | 502:4e14cd1b24da |
---|---|
2 Author: Aziz Köksal | 2 Author: Aziz Köksal |
3 License: GPL3 | 3 License: GPL3 |
4 +/ | 4 +/ |
5 module dil.Token; | 5 module dil.Token; |
6 import dil.Location; | 6 import dil.Location; |
7 import dil.Identifier; | |
7 import tango.stdc.stdlib : malloc, free; | 8 import tango.stdc.stdlib : malloc, free; |
8 import tango.core.Exception; | 9 import tango.core.Exception; |
9 import common; | 10 import common; |
10 | 11 |
11 public import dil.TokenIDs; | 12 public import dil.TokensEnum; |
12 | 13 |
13 /++ | 14 /++ |
14 A Token is a sequence of characters formed by the lexical analyzer. | 15 A Token is a sequence of characters formed by the lexical analyzer. |
15 +/ | 16 +/ |
16 struct Token | 17 struct Token |
46 version(D2) | 47 version(D2) |
47 Token* tok_str; /// Points to the contents of a token string stored as a | 48 Token* tok_str; /// Points to the contents of a token string stored as a |
48 /// doubly linked list. The last token is always '}' or | 49 /// doubly linked list. The last token is always '}' or |
49 /// EOF in case end of source text is "q{" EOF. | 50 /// EOF in case end of source text is "q{" EOF. |
50 } | 51 } |
52 Identifier* ident; | |
51 dchar dchar_; | 53 dchar dchar_; |
52 long long_; | 54 long long_; |
53 ulong ulong_; | 55 ulong ulong_; |
54 int int_; | 56 int int_; |
55 uint uint_; | 57 uint uint_; |