-
Notifications
You must be signed in to change notification settings - Fork 2
/
prompt_grammar2.txt
16 lines (16 loc) · 1.22 KB
/
prompt_grammar2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Consider the following grammar between BEGINSRC and ENDSRC. BEGINSRC /******************************************************************************/
/* */
/* Menhir */
/* */
/* François Pottier, Inria Paris */
/* Yann Régis-Gianas, PPS, Université Paris Diderot */
/* ENDSRC . Please rewrite it to be more beautiful. We are going to use the following TARGET: BEGINTARGET letter ::= [a-zA-Z]
digit ::= [0-9]
ws ::= [ \t\n]*
symbol ::= "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">" | "'" | "=" | "|" | "." | "," | ";" | "-" | "+" | "*" | "?"
character ::= letter | digit | symbol | "_" | " "
identifier ::= letter ( letter | digit | "_" )*
S ::= ( " " | "\n" | "\t" | "\r" )
terminal ::= "'" character "'" ( character "'" ) "'"
terminator ::= (";" | ".")
term ::= "(" S rhs S ")" | "[" S rhs S "]" | "{" S rhs S "}" ENDTARGET as our target grammar format. Please rewrite SRC into TARGET.