"Name" = 'D' "Case Sensitive" = True "Start Symbol" = whitespace = {Whitespace}+ Comment Line = '//' Comment Start = '/*' Comment End = '*/' ! Nested comments not yet supported by Goldie NestedCommentStart = '/+' NestedCommentEnd = '+/' ! Token Strings need to be lexed just like ordinary code, ! so there's no special terminal for them other than 'q{' identifier = ({Letter} | '_') ({AlphaNumeric} | '_')* !{NonZeroDigit} = {Number} - [0] !{DecimalDigit} = {Number} + [_] !{BinaryDigit} = [_01] !{OctalDigit} = [_01234567] !{HexDigit} = {Number} + [_abcdefABCDEF] !{Decimal} = ( '0' | ({NonZeroDigit} ({Number}|'_')*) ) ([LuU]|'Lu'|'LU'|'uL'|'UL')? !Binary = '0' [bB] {BinaryDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? !Octal = '0' {OctalDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? !Hexadecimal = '0' [xX] {HexDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? !FloatLiteralDec = ( '0' | ({NonZeroDigit} ({Number}|'_')*) ) ([LuU]|'Lu'|'LU'|'uL'|'UL')? ([fF]'i'|'Li'|'i') ( [eE][-+]?({Number}|'_')+ )? !FloatLiteralBin = '0' [bB] {BinaryDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? ([fF]'i'|'Li'|'i') ( [eE][-+]?({Number}|'_')+ )? !FloatLiteralOct = '0' {OctalDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? ([fF]'i'|'Li'|'i') ( [eE][-+]?({Number}|'_')+ )? !FloatLiteralHex = '0' [xX] {HexDigit}+ ([LuU]|'Lu'|'LU'|'uL'|'UL')? ([fF]'i'|'Li'|'i') ( [eE][-+]?({Number}|'_')+ )? !DecimalFloat1 = {DecimalDigit}+ '.' ( {DecimalDigit}+ ( [eE][-+]?{DecimalDigit}+ )? )? !DecimalFloat2 = '.' ( '0' | ({NonZeroDigit} {DecimalDigit}*) ) ( [eE][-+]?{DecimalDigit}+ )? !DecimalFloat3 = {Number} {DecimalDigit}* [eE][-+]?{DecimalDigit}+ !HexFloat1 = '0' [xX] {HexDigit} '.' {HexDigit}+ [pP][-+]?{HexDigit}+ !HexFloat2 = '0' [xX] '.' {HexDigit}+ [pP][-+]?{HexDigit}+ !HexFloat3 = '0' [xX] {HexDigit}+ [pP][-+]?{HexDigit}+ !{DoubleQuotedStringChar} = {Printable} - ["] !DoubleQuotedString = '"' ({DoubleQuotedStringChar} | '\' {Printable})* '"' [cwd]? !WysiwygString = 'r"' {DoubleQuotedStringChar}* '"' [cwd]? !{AlternateWysiwygStringChar} = {Printable} - [`] !AlternateWysiwygString = '`' {DoubleQuotedStringChar}* '`' [cwd]? !{HexStringDigit} = {HexDigit} + {Whitespace} !HexString = 'x"' {HexStringDigit}* '"' [cwd]? ! Not yet supported, the following won't work quite right ! DelimitedString = 'q"' {DoubleQuotedStringChar}* '"' [cwd]? !{CharacterLiteralChar} = {Printable} - [''] !CharacterLiteral = '' ({CharacterLiteralChar} | '\' {Printable}) '' [cwd]? intLiteral = {Digit}+ ::= | ::= 'module' ::= 'import' ';' | 'static' 'import' ';' ::= | | ',' ::= | identifier '=' ::= ':' ::= | ',' ::= identifier | identifier '=' identifier ::= | | | ::= | ::= | | | | | | | | | ';' ::= 'alias' identifier 'this' ';' ::= 'struct' identifier ::= '{' '}' ::= 'class' identifier | 'class' identifier ':' ::= '{' '}' ::= | ',' ::= | ::= ';' | | ::= | | | ::= | | | | | | | | | | | | ::= 'return' ';' | 'return' ';' ::= 'switch' '(' ')' ::= 'final' ::= 'case' ':' ::= 'case' ':' '...' 'case' ':' ::= 'default' ':' ::= | ::= ';' | | ::= 'continue' identifier ';' | 'continue' ';' ::= 'break' identifier ';' | 'break' ';' ::= 'goto' identifier ';' ::= ';' ::= ';' | ';' | ';' ::= 'if' '(' ')' | 'if' '(' ')' 'else' ::= | ',' ::= identifier | ::= identifier '!' '(' ')' | identifier '!' '(' ')' | identifier '!' identifier ::= | ::= | | | '[' ']' | '[' '..' ']' | '.' ::= '++' | '--' ::= | '&' | '!' | '*' | '+' | '-' | '~' ::= '++' | '--' ::= | '.' identifier | intLiteral | 'true' | 'false' | | '(' ')' | ::= 'typeof' '(' ')' | 'typeof' '(' 'return' ')' ::= 'is' '(' ')' | 'is' '(' ':' ')' | 'is' '(' '==' ')' | 'is' '(' ':' ',' ')' | 'is' '(' '==' ',' ')' | 'is' '(' identifier ')' | 'is' '(' identifier ':' ')' | 'is' '(' identifier '==' ')' | 'is' '(' identifier ':' ',' ')' | 'is' '(' identifier '==' ',' ')' ::= | ',' | ',' ::= | | | | ::= identifier | identifier | identifier | identifier ::= ':' ::= '=' ::= | | | ::= ':' ::= '=' '__FILE__' | '=' '__MODULE__' | '=' '__LINE__' | '=' '__FUNCTION__' | '=' '__PRETTY_FUNCTION__' | '=' ::= 'alias' identifier alias ::= : : : = = ::= 'this' ::= | 'struct' | 'union' | 'class' | 'interface' | 'enum' | 'function' | 'delegate' | 'super' | 'const' | 'immutable' | 'inout' | 'shared' | 'return' | '__parameters' ::= ::= '(' ')' | '(' ')' ::= | ',' | ',' ::= | | ::= ::= '?' ':' ';' ::= | | ::= '+' | '-' | '/' | '*' | '^' | '&' | '&&' | '|' | '||' | '>>' | '>>>' | '<<' ::= '=' | '>>>=' | '>>=' | '<<=' | '+=' | '-=' | '*=' | '%=' | '&=' | '/=' | '|=' | '^^=' | '^=' | '~=' ::= '<' | '>' | '>=' | '<=' | '==' | '!=' | '!>' | '!<' | '<>' | '!<>' | '<>=' | '!<>=' | 'is' | '!is' ::= 'while' '(' ')' ::= 'do' 'while' '(' ')' ';' ::= ::= '{' '}' | '{' '}' ::= identifier | identifier ';' ::= identifier | identifier | | ::= '*' | '[' ']' | '[' ']' ::= '(' ')' | '(' ')' ::= | ',' ::= identifier | identifier '...' | identifier ',' ::= 'auto' | 'final' | 'in' | 'lazy' | 'out' | 'ref' | 'scope' | ::= 'nothrow' | 'pure' | ::= 'const' | 'immutable' | 'inout' | 'shared' | ::= '@' identifier ::= | '__FILE__' | '__MODULE__' | '__LINE__' | '__FUNCTION__' | '__PRETTY_FUNCTION__' ::= | | | | | ::= 'in' ::= 'out' | 'out' '(' identifier ')' ::= 'body' ::= 'bool' | 'byte' | 'ubyte' | 'short' | 'ushort' | 'int' | 'uint' | 'long' | 'ulong' | 'char' | 'wchar' | 'dchar' | 'float' | 'double' | 'real' | 'ifloat' | 'idouble' | 'ireal' | 'cfloat' | 'cdouble' | 'creal' | 'void' ::= 'extern' '(' identifier ')' ::= 'alias' ::= | ',' ::= identifier '=' ::= ';' | identifier '=' ';' ::= identifier | identifier ',' ::= | 'const' '(' ')' | 'immutable' '(' ')' | 'shared' '(' ')' | 'inout' '(' ')' ::= '*' | '[' ']' | '[' ']' | 'delegate' | 'function' ::= 'mixin' '(' ')' ';' ::= 'const' | 'const' 'shared' | 'shared' 'const' | 'inout' | 'inout' 'shared' | 'shared' 'inout' | 'immutable' | 'shared' ::= identifier | identifier ',' ::= identifier | identifier '.' ::= | ::= 'const' | 'immutable' | 'inout' | 'shared' ::= 'align' | 'align' '(' intLiteral ')' ::= 'private' | 'package' | 'protected' | 'public' | 'export' ::= 'version' '(' intLiteral ')' | 'version' '(' identifier ')' | 'version' '(' unittest ')' | 'version' '(' assert ')' ::= 'version' '=' identifier ';' | 'version' '=' intLiteral ';' ::= 'debug' | 'debug' '(' intLiteral ')' | 'debug' '(' identifier ')' ::= 'debug' '=' identifier ';' | 'debug' '=' intLiteral ';' ::= 'static' 'if' '(' ')' ::= 'static' 'assert' '(' ')' ';' | 'static' 'assert' '(' ',' ')' ';' ::= 'traits' '(' identifier ',' ')' ::= | ',' ::= | ::= 'unittest' ::= '[' ']' | '[' ']' ::= | ',' | ',' ::= | ::= 'void' ::= | | ::= identifier '=>' | '=>' | '=>' ::= '[' ']'