Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
20168:f0f725496f2a | 20169:65d29fa81397 |
---|---|
32 CHARACTERS | 32 CHARACTERS |
33 | 33 |
34 letter = 'A' .. 'Z' + 'a' .. 'z' + '_' + '$'. | 34 letter = 'A' .. 'Z' + 'a' .. 'z' + '_' + '$'. |
35 nonZeroDigit = "123456789". | 35 nonZeroDigit = "123456789". |
36 digit = '0' + nonZeroDigit . | 36 digit = '0' + nonZeroDigit . |
37 hexDigit = "0123456789abcdefABCDEF". | |
38 octDigit = "01234567". | |
39 binaryDigit = "01". | |
37 | 40 |
38 TOKENS | 41 TOKENS |
39 | 42 |
40 identifier = letter {letter | digit}. | 43 identifier = letter {letter | digit}. |
41 numericLiteral = "0" | nonZeroDigit { digit }. | 44 numericLiteral = "0" ( "x" { hexDigit } | "b" { binaryDigit } | { octDigit } ) | nonZeroDigit { digit }. |
42 | 45 |
43 PRAGMAS | 46 PRAGMAS |
44 | 47 |
45 PRODUCTIONS | 48 PRODUCTIONS |
46 | 49 |