Mercurial > projects > dil
annotate trunk/src/dil/Keywords.d @ 497:0ffcc4ff82f3
Refactored a few things in the Lexer.
Fix: SpecialTokensEnd should be TOK.VERSION not TOK.Version.
Fixed assert statement in textSpan().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 09 Dec 2007 14:58:38 +0100 |
parents | cca83c0c00fd |
children | 4e14cd1b24da |
rev | line source |
---|---|
28 | 1 /++ |
2 Author: Aziz Köksal | |
249 | 3 License: GPL3 |
28 | 4 +/ |
326 | 5 module dil.Keywords; |
327 | 6 import dil.Token; |
7 import dil.Identifier; | |
28 | 8 |
497
0ffcc4ff82f3
Refactored a few things in the Lexer.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
411
diff
changeset
|
9 /// Table of reserved identifiers. |
28 | 10 static const Identifier[] keywords = [ |
11 {TOK.Abstract, "abstract"}, | |
12 {TOK.Alias, "alias"}, | |
13 {TOK.Align, "align"}, | |
14 {TOK.Asm, "asm"}, | |
15 {TOK.Assert, "assert"}, | |
16 {TOK.Auto, "auto"}, | |
17 {TOK.Body, "body"}, | |
18 {TOK.Bool, "bool"}, | |
19 {TOK.Break, "break"}, | |
20 {TOK.Byte, "byte"}, | |
21 {TOK.Case, "case"}, | |
22 {TOK.Cast, "cast"}, | |
23 {TOK.Catch, "catch"}, | |
24 {TOK.Cdouble, "cdouble"}, | |
25 {TOK.Cent, "cent"}, | |
26 {TOK.Cfloat, "cfloat"}, | |
27 {TOK.Char, "char"}, | |
28 {TOK.Class, "class"}, | |
29 {TOK.Const, "const"}, | |
30 {TOK.Continue, "continue"}, | |
31 {TOK.Creal, "creal"}, | |
32 {TOK.Dchar, "dchar"}, | |
33 {TOK.Debug, "debug"}, | |
34 {TOK.Default, "default"}, | |
35 {TOK.Delegate, "delegate"}, | |
36 {TOK.Delete, "delete"}, | |
37 {TOK.Deprecated, "deprecated"}, | |
38 {TOK.Do, "do"}, | |
39 {TOK.Double, "double"}, | |
40 {TOK.Else, "else"}, | |
41 {TOK.Enum, "enum"}, | |
42 {TOK.Export, "export"}, | |
43 {TOK.Extern, "extern"}, | |
44 {TOK.False, "false"}, | |
45 {TOK.Final, "final"}, | |
46 {TOK.Finally, "finally"}, | |
47 {TOK.Float, "float"}, | |
48 {TOK.For, "for"}, | |
49 {TOK.Foreach, "foreach"}, | |
50 {TOK.Foreach_reverse, "foreach_reverse"}, | |
51 {TOK.Function, "function"}, | |
52 {TOK.Goto, "goto"}, | |
53 {TOK.Idouble, "idouble"}, | |
54 {TOK.If, "if"}, | |
55 {TOK.Ifloat, "ifloat"}, | |
56 {TOK.Import, "import"}, | |
57 {TOK.In, "in"}, | |
58 {TOK.Inout, "inout"}, | |
59 {TOK.Int, "int"}, | |
60 {TOK.Interface, "interface"}, | |
61 {TOK.Invariant, "invariant"}, | |
62 {TOK.Ireal, "ireal"}, | |
63 {TOK.Is, "is"}, | |
64 {TOK.Lazy, "lazy"}, | |
65 {TOK.Long, "long"}, | |
269 | 66 {TOK.Macro, "macro"}, // D2.0 |
28 | 67 {TOK.Mixin, "mixin"}, |
68 {TOK.Module, "module"}, | |
69 {TOK.New, "new"}, | |
70 {TOK.Null, "null"}, | |
71 {TOK.Out, "out"}, | |
72 {TOK.Override, "override"}, | |
73 {TOK.Package, "package"}, | |
74 {TOK.Pragma, "pragma"}, | |
75 {TOK.Private, "private"}, | |
76 {TOK.Protected, "protected"}, | |
77 {TOK.Public, "public"}, | |
78 {TOK.Real, "real"}, | |
79 {TOK.Ref, "ref"}, | |
80 {TOK.Return, "return"}, | |
81 {TOK.Scope, "scope"}, | |
82 {TOK.Short, "short"}, | |
83 {TOK.Static, "static"}, | |
84 {TOK.Struct, "struct"}, | |
85 {TOK.Super, "super"}, | |
86 {TOK.Switch, "switch"}, | |
87 {TOK.Synchronized, "synchronized"}, | |
88 {TOK.Template, "template"}, | |
89 {TOK.This, "this"}, | |
90 {TOK.Throw, "throw"}, | |
269 | 91 {TOK.Traits, "__traits"}, // D2.0 |
28 | 92 {TOK.True, "true"}, |
93 {TOK.Try, "try"}, | |
94 {TOK.Typedef, "typedef"}, | |
95 {TOK.Typeid, "typeid"}, | |
96 {TOK.Typeof, "typeof"}, | |
97 {TOK.Ubyte, "ubyte"}, | |
98 {TOK.Ucent, "ucent"}, | |
99 {TOK.Uint, "uint"}, | |
100 {TOK.Ulong, "ulong"}, | |
101 {TOK.Union, "union"}, | |
102 {TOK.Unittest, "unittest"}, | |
103 {TOK.Ushort, "ushort"}, | |
104 {TOK.Version, "version"}, | |
105 {TOK.Void, "void"}, | |
106 {TOK.Volatile, "volatile"}, | |
107 {TOK.Wchar, "wchar"}, | |
108 {TOK.While, "while"}, | |
312 | 109 {TOK.With, "with"}, |
110 // Special tokens: | |
343
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
111 {TOK.FILE, "__FILE__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
112 {TOK.LINE, "__LINE__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
113 {TOK.DATE, "__DATE__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
114 {TOK.TIME, "__TIME__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
115 {TOK.TIMESTAMP, "__TIMESTAMP__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
116 {TOK.VENDOR, "__VENDOR__"}, |
95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
aziz
parents:
327
diff
changeset
|
117 {TOK.VERSION, "__VERSION__"}, |
411 | 118 {TOK.EOF, "__EOF__"}, // D2.0 |
28 | 119 ]; |