Character.sdf3
pdmosses/sdf/org.metaborg.meta.lang.template/syntax/characterclass/Character.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
|
module
lexical syntax
RegularChar = character:[a-zA-Z0-9]
EscapedChar = escape:(~[\0-\31A-Za-z0-9] \/ [fnrtv])
= number:[01]+
= number:[0-7]+
= number:Zero
= number:([1-9] [0-9]*)
= number:[0-9A-Fa-f]+
= "0"
lexical restrictions
BinChar -/- [0-1]
OctChar -/- [0-7]
NumChar -/- [0-9]
HexChar -/- [0-9A-Fa-f]
Zero -/- [0bx] // To avoid clashes with Binary, Octal, and Hexadecimal
syntax
-CF.Regular = RegularChar-LEX
-CF.Escaped = "\\" EscapedChar-LEX
-CF.Binary = "\\0b" BinChar-LEX
-CF.Octal = "\\0" OctChar-LEX
-CF.Decimal = "\\" NumChar-LEX
-CF.Hexadecimal = "\\0x" HexChar-LEX
context-free syntax
.Bot = "\\BOT"
.Top = "\\TOP"
.LabelStart = "\\LABEL_START"
|