Mercurial > projects > dang
view lexer/Keyword.d @ 136:2be29b296081
Lots of changes:
- Parsing classes and interfaces
- Fixed some seg faults in sema
- Supporting "private" to some extend
- And a lot of other small fixes
author | johnsen@johnsen-laptop |
---|---|
date | Fri, 11 Jul 2008 21:47:57 +0200 |
parents | c3b24e7e8cf8 |
children | 927ae00bd9d2 |
line wrap: on
line source
module lexer.Keyword; import lexer.Token; /** A list of keywords in an associative array that link a string representation of the keyword to a Tok */ Tok[char[]] keywords; static this () { keywords = [ // types "byte"[] : Tok.Byte, "ubyte" : Tok.Ubyte, "short" : Tok.Short, "ushort" : Tok.Ushort, "int" : Tok.Int, "uint" : Tok.Uint, "long" : Tok.Long, "ulong" : Tok.Ulong, "char" : Tok.Char, "wchar" : Tok.Wchar, "dchar" : Tok.Dchar, "bool" : Tok.Bool, "float" : Tok.Float, "double" : Tok.Double, "void" : Tok.Void, // type related "struct" : Tok.Struct, "function" : Tok.Function, "delegate" : Tok.Delegate, "class" : Tok.Class, "interface" : Tok.Interface, "union" : Tok.Union, "typedef" : Tok.Typedef, "typeid" : Tok.Typeid, "typeof" : Tok.Typeof, "sizeof" : Tok.Sizeof, "alias" : Tok.Alias, // control flow "if" : Tok.If, "else" : Tok.Else, "while" : Tok.While, "switch" : Tok.Switch, "case" : Tok.Case, "default" : Tok.Default, "break" : Tok.Break, "return" : Tok.Return, "cast" : Tok.Cast, // modules "module" : Tok.Module, "import" : Tok.Import, // attributse "public" : Tok.Public, "private" : Tok.Private, "protected" : Tok.Protected, "package" : Tok.Package, "export" : Tok.Export, "static" : Tok.Static, "final" : Tok.Final, "const" : Tok.Const, "abstract" : Tok.Abstract, "override" : Tok.Override, "depracted" : Tok.Depracted, "auto" : Tok.Auto, // exceptions "assert" : Tok.Assert, "throw" : Tok.Throw, "try" : Tok.Try, "catch" : Tok.Catch, "finally" : Tok.Finally, // functions "in" : Tok.In, "out" : Tok.Out, "body" : Tok.Body, "asm" : Tok.Asm ]; }