Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/expression/Expression.atg @ 20169:65d29fa81397
DSL: add support for hex, oct and binary integer literals.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Sun, 05 Apr 2015 19:51:46 +0100 |
parents | 62c43fcf5be2 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/expression/Expression.atg Sun Apr 05 09:45:58 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/expression/Expression.atg Sun Apr 05 19:51:46 2015 +0100 @@ -34,11 +34,14 @@ letter = 'A' .. 'Z' + 'a' .. 'z' + '_' + '$'. nonZeroDigit = "123456789". digit = '0' + nonZeroDigit . +hexDigit = "0123456789abcdefABCDEF". +octDigit = "01234567". +binaryDigit = "01". TOKENS identifier = letter {letter | digit}. -numericLiteral = "0" | nonZeroDigit { digit }. +numericLiteral = "0" ( "x" { hexDigit } | "b" { binaryDigit } | { octDigit } ) | nonZeroDigit { digit }. PRAGMAS