forked from kframework/javascript-semantics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js-str-numeric-literal.k
41 lines (29 loc) · 1.55 KB
/
js-str-numeric-literal.k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module JS-STR-NUMERIC-LITERAL
syntax StrNumericLiteral ::= StrDecimalLiteral
| HexIntegerLiteral
syntax StrDecimalLiteral ::= StrUnsignedDecimalLiteral
| "+" StrUnsignedDecimalLiteral
| "-" StrUnsignedDecimalLiteral
syntax StrUnsignedDecimalLiteral ::= InfinityLiteral
| DecimalDigits "." DecimalDigits ExponentPart
| DecimalDigits "." DecimalDigits
| DecimalDigits "." ExponentPart
| DecimalDigits "."
| "." DecimalDigits ExponentPart
| "." DecimalDigits
| DecimalDigits ExponentPart
| DecimalDigits
syntax InfinityLiteral ::= Token{ "Infinity" } [notInRules, notInGround]
syntax DecimalDigits ::= DecimalDigit
| DecimalDigits DecimalDigit
syntax DecimalDigit ::= Token{ [0-9] } [notInRules, notInGround]
syntax ExponentPart ::= ExponentIndicator SignedInteger
syntax ExponentIndicator ::= Token{ [eE] } [notInRules, notInGround]
syntax SignedInteger ::= DecimalDigits
| "+" DecimalDigits
| "-" DecimalDigits
syntax HexIntegerLiteral ::= "0x" HexDigit
| "0X" HexDigit
| HexIntegerLiteral HexDigit
syntax HexDigit ::= Token{ [0-9a-fA-F] } [notInRules, notInGround]
endmodule