parserMessages.messages 21.2 KB
Newer Older
1 2
# ----------------------------------------------------------------------------

3 4
grammar: UID
grammar: HEADER UID
5

POTTIER Francois's avatar
POTTIER Francois committed
6
Either a declaration or '%%' is expected at this point.
7 8 9

# ----------------------------------------------------------------------------

10 11 12 13 14 15 16 17
grammar: TYPE UID
grammar: TYPE OCAMLTYPE TYPE
grammar: TYPE OCAMLTYPE UID PREC
grammar: TYPE OCAMLTYPE UID LPAREN TYPE
grammar: TYPE OCAMLTYPE UID COMMA TYPE
grammar: TYPE OCAMLTYPE UID LPAREN UID UID
grammar: TYPE OCAMLTYPE UID LPAREN UID COMMA TYPE
grammar: TYPE OCAMLTYPE UID PLUS RPAREN
18
grammar: ON_ERROR_REDUCE TYPE
19

20 21 22 23
# %type<ocamltype> and %on_error_reduce are both followed with clist(strict_actual),
# so they are not distinguished in the automaton.

Ill-formed declaration.
24 25 26 27
Examples of well-formed declarations:
  %type <Syntax.expression> expression
  %type <int> date time
  %type <int option> option(date)
28 29 30
  %on_error_reduce expression
  %on_error_reduce date time
  %on_error_reduce option(date)
31 32 33

# ----------------------------------------------------------------------------

34 35 36
grammar: TOKEN TYPE
grammar: TOKEN OCAMLTYPE TYPE
grammar: TOKEN UID STAR
37
grammar: TOKEN UID QID STAR
38
grammar: TOKEN UID COMMA TYPE
39

POTTIER Francois's avatar
POTTIER Francois committed
40
Ill-formed '%token' declaration.
41 42
Examples of well-formed declarations:
  %token FOO
43 44
  %token BAR "|"
  %token DOT "." SEMICOLON ";"
45
  %token <string> LID UID
46
  %token FOO [@cost 0]
47 48 49

# ----------------------------------------------------------------------------

50 51 52 53
grammar: START UID
grammar: START OCAMLTYPE LEFT
grammar: START LID UID
grammar: START LID COMMA UID
54

POTTIER Francois's avatar
POTTIER Francois committed
55
Ill-formed '%start' declaration.
56 57 58 59 60 61 62 63
A start symbol must begin with a lowercase letter.
Examples of well-formed declarations:
  %start program
  %start expression phrase
  %start <int> date time

# ----------------------------------------------------------------------------

64 65 66
grammar: RIGHT TYPE
grammar: RIGHT UID STAR
grammar: RIGHT UID COMMA TYPE
67 68 69 70 71 72 73 74 75 76

Ill-formed precedence declaration.
Examples of well-formed declarations:
  %left PLUS
  %left PLUS MINUS
  %nonassoc unary_minus
  %right CONCAT

# ----------------------------------------------------------------------------

77
grammar: PARAMETER UID
78

POTTIER Francois's avatar
POTTIER Francois committed
79
Ill-formed '%parameter' declaration.
80 81 82 83 84
Examples of well-formed declarations:
  %parameter <X : sig type t end>

# ----------------------------------------------------------------------------

85
grammar: PERCENTPERCENT TYPE
86

87 88 89
# Do not mention that %% or EOF would be accepted at this point.

A rule is expected at this point.
90 91 92

# ----------------------------------------------------------------------------

POTTIER Francois's avatar
POTTIER Francois committed
93 94 95 96 97 98 99 100 101 102
grammar: PERCENTPERCENT UID COLON ACTION SEMI UNDERSCORE

# We have seen a semicolon, so we know that the previous rule is complete.

# Do not mention that %% or EOF would be accepted at this point.

Another rule is expected at this point.

# ----------------------------------------------------------------------------

103
grammar: PERCENTPERCENT UID COLON ACTION TYPE
104

105 106
# Do not mention that %% or EOF would be accepted at this point.

POTTIER Francois's avatar
POTTIER Francois committed
107
Either another production '|' ...
108
or another rule is expected at this point.
109 110 111

# ----------------------------------------------------------------------------

112
grammar: PERCENTPERCENT INLINE TYPE
POTTIER Francois's avatar
POTTIER Francois committed
113 114 115 116 117 118 119 120 121 122

# This is definitely old-style syntax.

Ill-formed rule.
Either '%public' or a non-terminal symbol is expected at this point.
Examples of well-formed rules:
  %public option(X): { None } | x = X { Some x }
  %inline clist(X): xs = separated_nonempty_list(COMMA?, X) { xs }
  %public %inline pair(X, Y): x = X; y = Y { (x, y) }

123
grammar: PERCENTPERCENT PUBLIC INLINE TYPE
124

POTTIER Francois's avatar
POTTIER Francois committed
125 126
# This is definitely old-style syntax.

127
Ill-formed rule.
POTTIER Francois's avatar
POTTIER Francois committed
128
A non-terminal symbol is expected at this point.
129 130 131 132 133 134 135
Examples of well-formed rules:
  %public option(X): { None } | x = X { Some x }
  %inline clist(X): xs = separated_nonempty_list(COMMA?, X) { xs }
  %public %inline pair(X, Y): x = X; y = Y { (x, y) }

# ----------------------------------------------------------------------------

136
grammar: PERCENTPERCENT UID UID
137 138

Ill-formed rule.
139
Either a parenthesized, comma-delimited list of formal parameters
140
or an attribute
POTTIER Francois's avatar
POTTIER Francois committed
141
or a colon ':' is expected at this point.
142
Examples of well-formed rules:
143 144
  main: e = expr; EOL { e }
  expr: i = INT { i } | e1 = expr; PLUS; e2 = expr { e1 + e2 }
145
  option(X): { None } | x = X { Some x }
146
  main [@cost 0]: e = expr; EOL { e }
147 148 149

# ----------------------------------------------------------------------------

150 151
grammar: PERCENTPERCENT UID LPAREN TYPE
grammar: PERCENTPERCENT UID LPAREN UID COMMA TYPE
152 153 154 155 156 157 158 159 160

Ill-formed rule.
A comma-delimited list of formal parameters is expected at this point.
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }
  pair(X, Y): x = X; y = Y { (x, y) }

# ----------------------------------------------------------------------------

POTTIER Francois's avatar
POTTIER Francois committed
161 162 163 164 165 166 167 168 169 170 171 172
grammar: PERCENTPERCENT UID LPAREN UID UID

# Ignore the fact that the comma-delimited list of symbols could continue.

Ill-formed rule.
A closing parenthesis ')' is expected at this point.
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }
  pair(X, Y): x = X; y = Y { (x, y) }

# ----------------------------------------------------------------------------

173 174 175 176
grammar: PERCENTPERCENT UID COLON TYPE
grammar: PERCENTPERCENT UID COLON BAR TYPE
grammar: PERCENTPERCENT UID COLON ACTION BAR TYPE
grammar: PERCENTPERCENT UID COLON UID BAR TYPE
177 178 179 180

Ill-formed rule.
A list of productions is expected at this point.
Examples of well-formed rules:
181 182
  main: e = expr; EOL { e }
  expr: i = INT { i } | e1 = expr; PLUS; e2 = expr { e1 + e2 }
183 184 185 186
  symbol: s = LID | s = UID { s }

# ----------------------------------------------------------------------------

187
grammar: PERCENTPERCENT UID COLON UID TYPE
188
grammar: PERCENTPERCENT UID COLON UID SEMI TYPE
189 190 191
grammar: PERCENTPERCENT UID COLON LID TYPE
grammar: PERCENTPERCENT UID COLON LID EQUAL TYPE
grammar: PERCENTPERCENT UID COLON LID EQUAL UID PLUS TYPE
192 193 194 195 196 197 198 199 200 201 202 203

Ill-formed production.
A production is a sequence of producers, followed with a semantic action.
Examples of well-formed producers:
  expr
  option(COMMA)
  separated_list(COMMA, expr)
  e = expr
  ds = declaration*
  es = list(terminated(expr, SEMI))
  es = list(e = expr SEMI { e })
  xs = list(x = var { Some x } | WILDCARD { None })
204
  expr [@cost 0]
205

POTTIER Francois's avatar
POTTIER Francois committed
206 207 208 209 210 211 212 213 214 215
# The following sentences are tricky. In front of us could be many things
# (comma, closing parenthesis, identifier, modifier, %prec keyword, etc.).
# We don't know which symbol we expect to reduce towards (e.g., it could be
# [actual] or [lax_actual]).

# Let's just back up to a safe level of abstraction and say that this is an
# ill-formed production.

# As RPAREN is in the lookahead set, we may suggest that a parenthesis could
# be closed.
216

217 218 219
grammar: PERCENTPERCENT UID COLON UID LPAREN UID TYPE
grammar: PERCENTPERCENT UID COLON UID LPAREN UID STAR TYPE
grammar: PERCENTPERCENT UID COLON UID LPAREN LID TYPE
220 221

Ill-formed production.
222
Maybe you meant to close a parenthesis at this point?
223 224 225 226 227 228 229 230 231 232 233 234 235
A production is a sequence of producers, followed with a semantic action.
Examples of well-formed producers:
  expr
  option(COMMA)
  separated_list(COMMA, expr)
  e = expr
  ds = declaration*
  es = list(terminated(expr, SEMI))
  es = list(e = expr SEMI { e })
  xs = list(x = var { Some x } | WILDCARD { None })

# ----------------------------------------------------------------------------

POTTIER Francois's avatar
POTTIER Francois committed
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION BAR TYPE

# Here, we have seen a BAR, so we expect a production (group).

A production is expected at this point.
A production is a sequence of producers, followed with a semantic action.
Examples of well-formed producers:
  expr
  option(COMMA)
  separated_list(COMMA, expr)
  e = expr
  ds = declaration*
  es = list(terminated(expr, SEMI))
  es = list(e = expr SEMI { e })
  xs = list(x = var { Some x } | WILDCARD { None })

# ----------------------------------------------------------------------------

254
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION UID
255 256 257 258 259
# In the non-canonical automaton, this is a tricky case where, looking at the
# description of the state, it seems that only COMMA and RPAREN can follow
# here. But in fact, other tokens are possible, such as BAR, simply because
# they will NOT take us into this state. In the canonical automaton, the list
# of possibilities is explicit in the lookahead sets.
260
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION PREC UID UID
261 262 263 264 265
# In the first case above, we may expect a %prec annotation, whereas in the
# second case above, we have just seen it. In the error message, we merge
# these two situations and do not mention the possibility of a %prec
# annotation.

POTTIER Francois's avatar
POTTIER Francois committed
266 267 268
Either another production '|' ...
or a comma ','
or a closing parenthesis ')'
269 270 271 272
is expected at this point.

# ----------------------------------------------------------------------------

273 274 275
grammar: PERCENTPERCENT UID COLON PREC TYPE
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION PREC TYPE
grammar: PERCENTPERCENT UID COLON ACTION PREC TYPE
POTTIER Francois's avatar
POTTIER Francois committed
276 277 278 279
grammar: PERCENTPERCENT LET LID COLONEQUAL PREC EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL ACTION PREC EOF

# Conflate old rule syntax and new rule syntax.
280 281 282 283 284 285 286 287

Ill-formed %prec annotation.
A symbol is expected at this point.
Examples of well-formed annotations:
  expr: MINUS e = expr %prec UMINUS { -e }

# ----------------------------------------------------------------------------

288 289
grammar: PERCENTPERCENT UID COLON UID LPAREN TYPE
grammar: PERCENTPERCENT UID COLON UID LPAREN UID COMMA TYPE
290 291 292 293 294 295 296 297 298

Ill-formed rule.
A comma-delimited list of actual parameters is expected at this point.
Examples of well-formed rules:
  call: f = callee LPAREN args = separated_list(COMMA, expr) RPAREN { f, args }
  list(X): { [] } | x = X; xs = list(X) { x :: xs }

# ----------------------------------------------------------------------------

299
grammar: PERCENTPERCENT UID COLON PREC LID UID
300 301

Ill-formed rule.
POTTIER Francois's avatar
POTTIER Francois committed
302 303 304
Either a semantic action '{' ... '}'
or another production '|' ...
is expected at this point.
305 306 307 308 309
Examples of well-formed rules:
  expr: MINUS e = expr %prec UMINUS { -e }

# ----------------------------------------------------------------------------

310
grammar: PERCENTPERCENT UID LPAREN UID RPAREN BAR
311 312

Ill-formed rule.
POTTIER Francois's avatar
POTTIER Francois committed
313
A colon ':' is expected at this point.
314 315 316 317 318
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }

# ----------------------------------------------------------------------------

319
grammar: PERCENTPERCENT UID COLON ACTION PREC UID TYPE
320 321

Either another rule
POTTIER Francois's avatar
POTTIER Francois committed
322
or another production '|' ...
323
is expected at this point.
324 325
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }
326

327 328
# ----------------------------------------------------------------------------

329 330
grammar: TYPE OCAMLTYPE UID LPAREN UID LPAREN TYPE
grammar: PERCENTPERCENT UID COLON UID LPAREN UID LPAREN TYPE
331 332 333 334 335 336 337 338 339 340

Ill-formed list of actual parameters.
A comma-delimited list of actual parameters is expected at this point.
Examples of well-formed actual parameters:
  expr
  expr+
  option(expr)
  separated_list(COMMA, expr)

# Omitting the fact that an anonymous rule is a valid actual parameter...
341
# Also omitting the subtle distinctions between lax_actual, actual, etc.
342 343 344

# ----------------------------------------------------------------------------

345
grammar: TYPE OCAMLTYPE UID LPAREN UID PLUS UID
346 347

Ill-formed list of actual parameters.
POTTIER Francois's avatar
POTTIER Francois committed
348 349 350
Either a modifier '*' or '+' or '?'
or a closing parenthesis ')'
or a comma ',' is expected at this point.
351 352 353 354 355 356
Examples of well-formed actual parameters:
  expr
  expr+
  option(expr)
  separated_list(COMMA, expr)

357 358
# ------------------------------------------------------------------------------

359 360 361 362 363 364 365
grammar: PERCENTATTRIBUTE TYPE
grammar: PERCENTATTRIBUTE UID COMMA TYPE
grammar: PERCENTATTRIBUTE UID TYPE
grammar: PERCENTATTRIBUTE UID PLUS TYPE
grammar: PERCENTATTRIBUTE UID LPAREN TYPE
grammar: PERCENTATTRIBUTE UID ATTRIBUTE UID

POTTIER Francois's avatar
POTTIER Francois committed
366 367
Ill-formed '%attribute' declaration.
An '%attribute' declaration should contain a nonempty list of symbols,
368 369 370 371 372
followed with a nonempty list of attributes.
Examples of well-formed declarations:
  %attribute FOO [@printer "foo"]
  %attribute bar BAZ [@printer "bar/BAZ"] [@cost 2.0]

POTTIER Francois's avatar
POTTIER Francois committed
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------

# The following error sentences concern both the old and new rule syntax.

grammar: PERCENTPERCENT PUBLIC TYPE

Ill-formed rule.
'let' or '%inline' or a non-terminal symbol is expected at this point.
Examples of well-formed rules:
  %public     option(X):   { None } | x = X  { Some x }
  %public let option(X) := { None } | x = X; { Some x }

# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------

# The following error sentences have to do with the new rule syntax.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET EOF

A lowercase identifier is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID EOF
grammar: PERCENTPERCENT LET LID LPAREN UID RPAREN EOF

# Ignore attributes.

# In the first case, we have not seen a list of formal parameters yet,
# so such a list could still appear; yet I choose not to mention it.

# People are likely to write '=' whereas we expect ':=' or '=='.
# We should remind them what these two symbols mean.

An equality symbol ':=' or '==' is expected at this point.
Examples of well-formed rules:
  let  option(X) := { None } | x = X; { Some x } (* ordinary *)
  let ioption(X) == { None } | x = X; { Some x } (*  inline  *)

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID LPAREN EOF

# By accident, the lookahead token (EQUALEQUAL or COLONEQUAL) reveals
# that we are in the new rule syntax.

A comma-delimited list of formal parameters is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID LPAREN UID EOF

# By accident, the lookahead token (EQUALEQUAL or COLONEQUAL) reveals
# that we are in the new rule syntax.

At this point, one of the following is expected:
a comma ',' followed with an expression, or
a closing parenthesis ')'.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL EOF

# A choice expression is expected.

An expression is expected at this point.
Examples of expressions:
  term
  t = term; { t }
  LPAREN; ~ = term; RPAREN; <>
  factor | term; MUL; factor

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL TILDE EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN TILDE EOF

An equals sign '=' is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL TILDE EQUAL EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN TILDE EQUAL EOF

# A symbol expression is expected.
# A symbol expression always begins with a symbol,
# so we can say that a symbol is expected.

A symbol is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL TILDE EQUAL LID EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UNDERSCORE EQUAL UID ATTRIBUTE EOF

# Ignore the fact that an attribute or a modifier is permitted.

A semicolon ';' is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL PREC UID EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN PREC UID EOF

A semantic action is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL LPAREN EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL LPAREN LPAREN EOF

This opening parenthesis seems to be the beginning of a tuple pattern.
Thus, a comma-separated list of patterns is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL LPAREN LPAREN UNDERSCORE EOF
grammar: PERCENTPERCENT LET LID COLONEQUAL LPAREN UNDERSCORE EOF

The previous opening parenthesis seemed to be the beginning of a tuple pattern.
Thus, either a comma ',' followed with a pattern
or a closing parenthesis ')' is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL LPAREN UNDERSCORE COMMA EOF

A pattern is expected at this point.
Examples of patterns:
  x
  ~
  _
  (x, y, _)

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL LID TYPE

# This is tricky. We have read a lowercase identifier,
# but do not know yet whether it represents a pattern
# (in which case an EQUAL sign is expected)
# or a symbol
# (in which case many continuations are possible)
# (in fact, the rule could be complete, as we are
#  at the top level).

# Ignore the fact that this symbol could be followed with a list of
# actual parameters, or a modifier, or an attribute.

At this point, one of the following is expected:
an equals sign '=' followed with a symbol, or
a semicolon ';' followed with an expression, or
a bar '|' followed with an expression, or
another rule.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN LID EOF

# This is analogous to the previous case,
# except we are not at the top level.

At this point, one of the following is expected:
an equals sign '=' followed with a symbol, or
a semicolon ';' followed with an expression, or
a bar '|' followed with an expression, or
a closing parenthesis ')'.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL ACTION TYPE

At this point, one of the following is expected:
a bar '|' followed with an expression, or
another rule.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID TYPE

# Ignore modifiers and attributes.
# We expect either SEMI; seq_expression or BAR; expression or another rule.

At this point, one of the following is expected:
a semicolon ';' followed with an expression, or
a bar '|' followed with an expression, or
another rule.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UID LPAREN TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UNDERSCORE EQUAL UID LPAREN TYPE

A comma-separated list of expressions is expected at this point.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL BAR TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID BAR TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN BAR TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UID BAR TYPE

# A sequence expression is expected.

# We are inside a choice expression.

# We can show examples that involve '|',
# as our sequence expression can be part of a choice expression
# and therefore followed with a BAR.

An expression is expected at this point.
Examples of expressions:
  term
  t = term; { t }
  LPAREN; ~ = term; RPAREN; <>
  factor | term; MUL; factor

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UID SEMI TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UNDERSCORE EQUAL UID SEMI TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UNDERSCORE EQUAL UID SEMI TYPE
grammar: PERCENTPERCENT LET LID COLONEQUAL UID SEMI EOF

# A sequence expression is expected.

# We are inside a sequence expression.

# In fact, we have just read a semicolon.
# Maybe it is worth re-iterating that (in the new syntax)
# a rule cannot be terminated with a semicolon.

After a semicolon, an expression is expected.
(A rule cannot be terminated with a semicolon.)
Examples of expressions:
  term
  t = term; { t }
  LPAREN; ~ = term; RPAREN; <>

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN ACTION EOF

At this point, one of the following is expected:
a comma ',' followed with an expression, or
a bar '|' followed with an expression, or
a closing parenthesis ')'.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UID EOF

# Ignore modifiers and attributes.
# We expect either SEMI; seq_expression or BAR; expression or COMMA; expression or RPAREN.

At this point, one of the following is expected:
a semicolon ';' followed with an expression, or
a bar '|' followed with an expression, or
a comma ',' followed with an expression, or
a closing parenthesis ')'.

# ----------------------------------------------------------------------------

grammar: PERCENTPERCENT LET LID COLONEQUAL UID LPAREN UID COMMA TYPE

# A choice expression is expected (allowed).

An expression is expected at this point.
Examples of expressions:
  term
  t = term; { t }
  LPAREN; ~ = term; RPAREN; <>
  factor | ~ = term; ~ = op; ~ = factor; <EBinOp>

# ----------------------------------------------------------------------------

653 654 655
# Local Variables:
# mode: shell-script
# End: