forked from RobertHarper/cmyacc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax.sml
More file actions
32 lines (23 loc) · 807 Bytes
/
Copy pathsyntax.sml
File metadata and controls
32 lines (23 loc) · 807 Bytes
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
structure Symbol = SymbolFun (structure Value = StringHashable)
structure Syntax =
struct
type symbol = Symbol.symbol
datatype label =
IdentLabel of symbol
| NumericLabel of int (* nonnegative (zero is illegal too, but that's not enforced by the parser) *)
datatype constituent =
Unlabeled of symbol
| Labeled of label * symbol
datatype precedence =
EmptyPrec
| PrecNone
| PrecLeft of int
| PrecRight of int
type production = constituent list * symbol * precedence
datatype directive =
Option of symbol * string
| Start of symbol
| Terminal of symbol * symbol option * precedence
| Nonterminal of symbol * symbol * production list
| Follower of symbol
end