File: Identifiers.sdf

package info (click to toggle)
libxtc-rats-java 1.15.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 18,580 kB
  • sloc: java: 288,962; ansic: 20,406; ml: 14,775; makefile: 1,358; cpp: 621; sh: 352; xml: 259; perl: 123
file content (26 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
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
%%%
 %% Section 3.8: Identifiers
 %%
 %% @author Martin Bravenboer <martin@cs.uu.nl>
 %%%
module languages/java-14/lexical/Identifiers
imports
  languages/java-14/lexical/Keywords
exports
  sorts
    Id
    ID

  context-free syntax
    ID -> Id {cons("Id")}

  lexical syntax
    [A-Za-z\_\$][A-Za-z0-9\_\$]* -> ID
    
    Keyword -> ID {reject}
    "true"  -> ID {reject}
    "false" -> ID {reject}
    "null"  -> ID {reject}

  lexical restrictions
    ID -/- [a-zA-Z0-9\_\$]