Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (16 sloc) 717 Bytes
module languages/ansi-c/syntax/Constants
exports
sorts HexadecimalConstant IntegerConstant CharacterConstant FloatingPointConstant StringConstant Exponent
lexical syntax
[0] [xX] [a-fA-F0-9]+ [uUlL]* -> HexadecimalConstant
[0-9]+ [uUlL]* -> IntegerConstant
[L]? [\'] (([\\]~[])|~[\\\'])+ [\'] -> CharacterConstant
[Ee] [\+\-]? [0-9]+ -> Exponent
[0-9]+ Exponent [fFlL]? -> FloatingPointConstant
[0-9]* [\.] [0-9]+ Exponent? [fFlL]? -> FloatingPointConstant
[0-9]+ [\.] Exponent? [fFlL]? -> FloatingPointConstant
[L]? [\"] ( ([\\]~[]) | ~[\\\"] )* [\"] -> StringConstant
lexical restrictions
IntegerConstant -/- [0-9]
FloatingPointConstant -/- [0-9]
HexadecimalConstant -/- [a-fA-F0-9]