-
Notifications
You must be signed in to change notification settings - Fork 165
/
fstStudio.cf
59 lines (47 loc) · 1.68 KB
/
fstStudio.cf
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
-- This is the labelled bnf of fstStudio.
-- Two things that exists in XFST are not added:
-- * parallel replacement.
-- * substitution.
Prog . Program ::= [Def] ;
Declaration . Def ::= "<" Ident [Ident] ">" "::=" Exp ;
Main . Def ::= "<" "main" ">" "::=" Exp ;
Import . Def ::= "import" [Ident] ;
LongReplace . Exp ::= Exp "@->" Exp1 ;
Restriction . Exp ::= Exp "=>" Exp1 "_" Exp1 ;
Replacement . Exp ::= Exp "->" Exp1 ;
CReplacement . Exp ::= Exp "->" Exp1 "||" Exp1 "_" Exp1 ;
CSReplacement . Exp ::= Exp "->" Exp1 "//" Exp1 "_" Exp1 ;
Composition . Exp ::= Exp ".o." Exp1 ;
CrossProduct . Exp ::= Exp ".x." Exp1 ;
_ . Exp ::= Exp1 ;
Markup . Exp1 ::= Exp2 "..." Exp2 ; -- for replacement
Minus . Exp1 ::= Exp1 "-" Exp2 ;
Intersect . Exp1 ::= Exp1 "&" Exp2 ;
Union . Exp1 ::= Exp1 "|" Exp2 ;
_ . Exp1 ::= Exp2 ;
Concat . Exp2 ::= Exp2 Exp3 ;
_ . Exp2 ::= Exp3 ;
Containment . Exp3 ::= "$" Exp4 ;
TComplement . Exp3 ::= "\\" Exp4 ;
Complement . Exp3 ::= "~" Exp4 ;
_ . Exp3 ::= Exp4 ;
NConcat . Exp4 ::= Exp4 "^" Integer ;
AppDecl . Exp4 ::= "<" Ident [Exp] ">" ;
Star . Exp4 ::= Exp4 "*" ;
Plus . Exp4 ::= Exp4 "+" ;
Symbol . Exp4 ::= String ;
Variable . Exp4 ::= Ident;
Concats . Exp4 ::= "{" String "}" ;
Any . Exp4 ::= "?" ;
Epsilon . Exp4 ::= "0" ;
Relation . Exp4 ::= String ":" String ;
Boundary . Exp4 ::= ".#." ;
_ . Exp4 ::= "(" Exp ")" ;
[] . [Def] ::= ;
(:) . [Def] ::= Def ";" [Def] ;
[] . [Exp] ::= ;
(:) . [Exp] ::= "," Exp [Exp] ;
[] . [Ident] ::= ;
(:) . [Ident] ::= "," Ident [Ident] ;
comment "--" ;
comment "{-" "-}" ;