Skip to content

FloatingPointLiterals.sdf3

pdmosses/java-front/lang.java/syntax/java/literals/FloatingPointLiterals.sdf3

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module java/literals/FloatingPointLiterals

// 3.10.2. Floating-Point Literals

context-free start-symbols

  FloatLiteral

context-free sorts

  

context-free syntax

  .DeciFloat = DeciFloatLiteral
  .HexaFloat = HexaFloatLiteral
  .DeciDouble = DeciDoubleLiteral
  .HexaDouble = HexaDoubleLiteral

lexical sorts

  
  HexaFloatLiteral
  
  HexaDoubleLiteral

lexical syntax

   = Digits "." Digits? DeciFloatExponentPart? [fF]
   = "." Digits DeciFloatExponentPart? [fF]
   = Digits DeciFloatExponentPart [fF]
   = Digits [fF]

   = Digits "." Digits? DeciFloatExponentPart? [dD]?
   = "." Digits DeciFloatExponentPart? [dD]?
   = Digits DeciFloatExponentPart [dD]?
   = Digits [dD]

   = [eE] SignedInteger
   = [\+\-]? Digits

   = Digit
   = Digit DigitsAndUnderscores? Digit
   = [0]
   = [1-9]
  DigitsAndUnderscores = DigitsOrUnderscore+
  DigitsOrUnderscore = (Digit | [\_])
  Underscores = [\_]+


lexical restrictions

  DeciFloatLiteral -/- [fF]
  DeciDoubleLiteral -/- [dD]
  SignedInteger -/- [0-9]

lexical syntax

  HexaFloatLiteral = HexaSignificand BinaryExponent [fF]
  HexaDoubleLiteral = HexaSignificand BinaryExponent [dD]?
   = [0] [xX] [0-9a-fA-F\_]* [0-9a-fA-F] "."?  
   = [0] [xX] [0-9a-fA-F\_]* [0-9a-fA-F] "." [0-9a-fA-F\_]* [0-9a-fA-F]
   = [pP] SignedInteger

lexical restrictions

  HexaSignificand -/- [0-9a-fA-F\.]