This commit is contained in:
Christian Rinderknecht 2019-08-04 18:02:56 +02:00
parent 6c818567fa
commit ce31bc2572
19 changed files with 104 additions and 80 deletions

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -15,31 +15,31 @@ item_or_closing(item,sep,term) ::=
(* Compound constructs *)
par(X) ::= LPAR X RPAR
par(item) ::= LPAR item RPAR
brackets(X) ::= LBRACKET X RBRACKET
brackets(item) ::= LBRACKET item RBRACKET
(* Sequences *)
(* Possibly empty sequence of items *)
seq(X) ::=
option(nseq(X))
seq(item) ::=
option(nseq(item))
(* Non-empty sequence of items *)
nseq(X) ::= X seq(X)
nseq(item) ::= item seq(item)
(* Non-empty separated sequence of items *)
nsepseq(X,Sep) ::=
X
| X Sep nsepseq(X,Sep)
nsepseq(item,Sep) ::=
item
| item Sep nsepseq(item,Sep)
(* Possibly empty separated sequence of items *)
sepseq(X,Sep) ::=
option(nsepseq(X,Sep))
sepseq(item,Sep) ::=
option(nsepseq(item,Sep))
(* Main *)
@ -182,9 +182,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -1,6 +1,6 @@
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -187,9 +187,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -193,9 +193,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -193,9 +193,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -191,9 +191,9 @@ single_instr ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -344,5 +344,8 @@ core_pattern ::=
| par(cons_pattern)
| par(nsepseq(core_pattern,COMMA))
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -345,5 +345,8 @@ core_pattern ::=
| par(cons_pattern)
| par(nsepseq(core_pattern,COMMA))
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -347,5 +347,8 @@ core_pattern ::=
| par(cons_pattern)
| par(nsepseq(core_pattern,COMMA))
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -350,5 +350,8 @@ core_pattern ::=
| par(cons_pattern)
| par(nsepseq(core_pattern,COMMA))
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -350,5 +350,8 @@ core_pattern ::=
| LPAR cons_pattern RPAR
| LPAR nsepseq(core_pattern,COMMA) RPAR
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -353,5 +353,8 @@ paren_pattern ::=
cons_pattern
| nsepseq(core_pattern,COMMA)
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))
cons_pattern ::=
core_pattern CONS pattern

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -195,9 +195,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -353,3 +353,6 @@ paren_pattern ::=
core_pattern CONS pattern
| core_pattern
| core_pattern COMMA nsepseq(core_pattern,COMMA)
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))

View File

@ -5,9 +5,9 @@ right_assoc(item,op) ::=
left_assoc(item,op) ::=
right_assoc(item,op)
option(X) :=
option(item) :=
(**)
| X
| item
series(item,sep,term) ::=
item after_item(item,sep,term)
@ -186,9 +186,9 @@ path ::=
injection(Kind,element) ::=
Kind series(element,SEMI,End)
| Kind End
| Kind LBRACKET bracketed
| Kind LBRACKET bracketed(element)
bracketed ::=
bracketed(element) ::=
series(element,SEMI,RBRACKET)
| RBRACKET
@ -283,7 +283,7 @@ core_expr ::=
| C_None
| C_Some arguments
| Constr option(arguments)
| LPAR paren_expr RPAR
| par(paren_expr)
| injection(List,expr)
| Nil
| structure
@ -332,9 +332,12 @@ core_pattern ::=
| Constr option(tuple_pattern)
| injection(List,core_pattern)
| Nil
| LPAR paren_pattern RPAR
| par(paren_pattern)
paren_pattern ::=
core_pattern CONS pattern
| core_pattern
| core_pattern COMMA nsepseq(core_pattern,COMMA)
tuple_pattern ::=
par(nsepseq(core_pattern,COMMA))