Skip to content

IntegerLiterals.sdf3

pdmosses/java-front/lang.java/syntax/java/literals/IntegerLiterals.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
module java/literals/IntegerLiterals

// 3.10.1. Integer Literals

context-free start-symbols

  IntLiteral

context-free sorts

  

context-free syntax

  .Deci = DeciLiteral {prefer}
  .Hexa = HexaLiteral {prefer}
  .Octa = OctaLiteral {prefer}
  .Bin  = BinLiteral  {prefer}

lexical sorts

  
  
  
  

lexical syntax

   = DeciNumeral [lL]?
   = HexaNumeral [lL]?
   = OctaNumeral [lL]?
    = BinNumeral  [lL]?
   = "0"
   = [1-9] [0-9\_]* [0-9]
   = [1-9]
   = [0] [xX] [0-9a-fA-F\_]* [0-9a-fA-F]
   = [0] [\_0-7]* [0-7]
    = "0" [bB] BinDigits
  BinDigits   = [01]
  BinDigits   = [01] [01\_]* [01]

lexical restrictions

  DeciNumeral -/- [0-9\.fFdD]
  HexaNumeral -/- [0-9a-fA-F]
  OctaNumeral -/- [0-7]
  BinNumeral  -/- [01]
  DeciLiteral -/- [lL]
  HexaLiteral -/- [lL]
  OctaLiteral -/- [lL]
  BinLiteral  -/- [lL]