Mercurial > projects > dang
view lexer/Keyword.d @ 185:7b274cfdc1dc
Added support for array literals. Codegen is broken, though.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Fri, 25 Jul 2008 12:18:05 +0200 |
parents | 57b0b4464a0b |
children | 08f68d684047 |
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, "this" : Tok.This, "new" : Tok.New, // "super" : Tok.Super, // control flow "if" : Tok.If, "else" : Tok.Else, "while" : Tok.While, "for" : Tok.For, "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, "deprecated": Tok.Deprecated, "auto" : Tok.Auto, "extern" : Tok.Extern, // 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 ]; }