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

POTTIER Francois's avatar
POTTIER Francois committed
3
grammar: UID 
4 5 6 7 8

Either a declaration or %% is expected at this point.

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

9
grammar: HEADER UID 
10 11 12 13 14

Either another declaration or %% is expected at this point.

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

15 16 17 18 19 20 21 22
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 
23 24 25 26 27 28 29 30 31

Ill-formed %type declaration.
Examples of well-formed declarations:
  %type <Syntax.expression> expression
  %type <int> date time
  %type <int option> option(date)

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

32 33 34 35
grammar: TOKEN TYPE 
grammar: TOKEN OCAMLTYPE TYPE 
grammar: TOKEN UID STAR 
grammar: TOKEN UID COMMA TYPE 
36 37 38 39 40 41 42 43 44

Ill-formed %token declaration.
Examples of well-formed declarations:
  %token FOO
  %token DOT SEMICOLON
  %token <string> LID UID

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

45 46 47 48
grammar: START UID 
grammar: START OCAMLTYPE LEFT 
grammar: START LID UID 
grammar: START LID COMMA UID 
49 50 51 52 53 54 55 56 57 58

Ill-formed %start declaration.
A start symbol must begin with a lowercase letter.
Examples of well-formed declarations:
  %start program
  %start expression phrase
  %start <int> date time

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

59 60 61
grammar: RIGHT TYPE 
grammar: RIGHT UID STAR 
grammar: RIGHT UID COMMA TYPE 
62 63 64 65 66 67 68 69 70 71

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

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

72
grammar: PARAMETER UID 
73 74 75 76 77 78 79

Ill-formed %parameter declaration.
Examples of well-formed declarations:
  %parameter <X : sig type t end>

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

80
grammar: PERCENTPERCENT TYPE 
81

82
Either a rule or %% is expected at this point.
83 84 85

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

86
grammar: PERCENTPERCENT UID COLON ACTION TYPE 
87

88
Either another rule or %% is expected at this point.
89 90 91

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

92 93 94
grammar: PERCENTPERCENT PUBLIC TYPE 
grammar: PERCENTPERCENT INLINE TYPE 
grammar: PERCENTPERCENT PUBLIC INLINE TYPE 
95 96 97 98 99 100 101 102 103 104

Ill-formed rule.
%inline, %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) }

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

105
grammar: PERCENTPERCENT UID UID 
106 107

Ill-formed rule.
108 109
Either a parenthesized, comma-delimited list of formal parameters
or a colon is expected at this point.
110 111 112 113 114 115 116
Examples of well-formed rules:
  main: e = expr EOL { e }
  expr: i = INT { i } | e1 = expr PLUS e2 = expr { e1 + e2 }
  option(X): { None } | x = X { Some x }

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

117 118 119
grammar: PERCENTPERCENT UID LPAREN TYPE 
grammar: PERCENTPERCENT UID LPAREN UID UID 
grammar: PERCENTPERCENT UID LPAREN UID COMMA TYPE 
120 121 122 123 124 125 126 127 128

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) }

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

129 130 131 132
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 
133 134 135 136 137 138 139 140 141 142

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

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

143 144 145 146 147
grammar: PERCENTPERCENT UID COLON UID TYPE 
grammar: PERCENTPERCENT UID COLON LID TYPE 
grammar: PERCENTPERCENT UID COLON LID EQUAL TYPE 
grammar: PERCENTPERCENT UID COLON UID PLUS TYPE 
grammar: PERCENTPERCENT UID COLON LID EQUAL UID PLUS TYPE 
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

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 })

# The following sentences are similar, but have an open parenthesis.
# Suggesting that a parenthesis could be closed seems a safe bet. These
# sentences are otherwise tricky. In front of us could be many things (comma,
# closing parenthesis, identifier, modifier, %prec keyword, etc.). We expect
# to reduce to actual or lax_actual. Let's just back up to a safe level of
# abstraction and say this is an ill-formed production.

168 169 170
grammar: PERCENTPERCENT UID COLON UID LPAREN UID TYPE 
grammar: PERCENTPERCENT UID COLON UID LPAREN UID STAR TYPE 
grammar: PERCENTPERCENT UID COLON UID LPAREN UID LPAREN LID RPAREN TYPE 
POTTIER Francois's avatar
POTTIER Francois committed
171
grammar: PERCENTPERCENT UID COLON UID LPAREN LID TYPE 
172
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION BAR TYPE 
173 174

Ill-formed production.
175
Maybe you meant to close a parenthesis at this point?
176 177 178 179 180 181 182 183 184 185 186 187 188
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 })

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

189
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION UID 
190 191 192 193 194
# 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.
195
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION PREC UID UID 
196 197 198 199 200 201 202 203 204 205 206
# 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.

Either another production | ...
or a comma or a closing parenthesis
is expected at this point.

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

207 208 209
grammar: PERCENTPERCENT UID COLON PREC TYPE 
grammar: PERCENTPERCENT UID COLON UID LPAREN ACTION PREC TYPE 
grammar: PERCENTPERCENT UID COLON ACTION PREC TYPE 
210 211 212 213 214 215 216 217

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

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

218 219
grammar: PERCENTPERCENT UID COLON UID LPAREN TYPE 
grammar: PERCENTPERCENT UID COLON UID LPAREN UID COMMA TYPE 
220 221 222 223 224 225 226 227 228

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 }

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

229
grammar: PERCENTPERCENT UID COLON PREC LID UID 
230 231 232 233 234 235 236 237 238 239

Ill-formed rule.
Either a semantic action { ... }
or another production | ...
is expected here.
Examples of well-formed rules:
  expr: MINUS e = expr %prec UMINUS { -e }

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

240
grammar: PERCENTPERCENT UID LPAREN UID RPAREN BAR 
241 242 243 244 245 246 247 248

Ill-formed rule.
A colon is expected at this point.
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }

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

249
grammar: PERCENTPERCENT UID COLON ACTION PREC UID TYPE 
250 251 252 253

Either another rule
or another production | ...
is expected at this point.
254 255
Examples of well-formed rules:
  option(X): { None } | x = X { Some x }
256

257 258
# ----------------------------------------------------------------------------

259 260
grammar: TYPE OCAMLTYPE UID LPAREN UID LPAREN TYPE 
grammar: PERCENTPERCENT UID COLON UID LPAREN UID LPAREN TYPE 
261 262 263 264 265 266 267 268 269 270

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...
271
# Also omitting the subtle distinctions between lax_actual, actual, etc.
272 273 274

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

POTTIER Francois's avatar
POTTIER Francois committed
275
grammar: TYPE OCAMLTYPE UID LPAREN UID PLUS UID 
276 277 278 279 280 281 282 283 284 285

Ill-formed list of actual parameters.
A modifier, a closing parenthesis, or a comma is expected at this point.
A modifier is * or + or ?.
Examples of well-formed actual parameters:
  expr
  expr+
  option(expr)
  separated_list(COMMA, expr)

286 287 288 289 290
# ------------------------------------------------------------------------------

# Local Variables:
# mode: shell-script
# End: