Mercurial > projects > dang
view lexer/Keyword.d @ 42:4e879f82dd64 new_gen
Added some docs for the lexer - now you can understand _some_ of the madness going on here :)
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 22 Apr 2008 22:25:07 +0200 |
parents | 858b9805843d |
children | 381975d76baf |
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, "bool" : Tok.Bool, "float" : Tok.Float, "double" : Tok.Double, "void" : Tok.Void, // type related "struct" : Tok.Struct, // control flow "if" : Tok.If, "else" : Tok.Else, "while" : Tok.While, "switch" : Tok.Switch, "case" : Tok.Case, "default" : Tok.Default, "return" : Tok.Return ]; }