parserMessages.messages 8.88 KB
Newer Older
1 2 3 4 5 6 7 8
# ----------------------------------------------------------------------------

UID

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

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

9 10 11 12 13 14
HEADER UID 

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

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

15 16
TYPE UID 
TYPE OCAMLTYPE TYPE 
17
TYPE OCAMLTYPE UID PREC 
18 19 20 21
TYPE OCAMLTYPE UID LPAREN TYPE 
TYPE OCAMLTYPE UID COMMA TYPE 
TYPE OCAMLTYPE UID LPAREN UID UID 
TYPE OCAMLTYPE UID LPAREN UID COMMA TYPE 
22
TYPE OCAMLTYPE UID PLUS RPAREN 
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

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

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

TOKEN TYPE 
TOKEN OCAMLTYPE TYPE 
TOKEN UID STAR 
TOKEN UID COMMA TYPE 

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

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

START UID 
START OCAMLTYPE LEFT 
START LID UID 
START LID COMMA UID 

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

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

RIGHT TYPE 
RIGHT UID STAR 
RIGHT UID COMMA TYPE 

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

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

PARAMETER UID 

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

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

80
PERCENTPERCENT TYPE 
81

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

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

86
PERCENTPERCENT UID COLON ACTION TYPE 
87

88
Either another rule or %% is expected at this point.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107

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

PERCENTPERCENT PUBLIC TYPE 
PERCENTPERCENT INLINE TYPE 
PERCENTPERCENT PUBLIC INLINE TYPE 

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

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

PERCENTPERCENT UID UID 

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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
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 }

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

PERCENTPERCENT UID LPAREN TYPE 
PERCENTPERCENT UID LPAREN UID UID 
PERCENTPERCENT UID LPAREN UID COMMA TYPE 

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

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

PERCENTPERCENT UID COLON TYPE 
PERCENTPERCENT UID COLON BAR TYPE 
PERCENTPERCENT UID COLON ACTION BAR TYPE 
PERCENTPERCENT UID COLON UID BAR TYPE 

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 }

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

PERCENTPERCENT UID COLON UID TYPE 
PERCENTPERCENT UID COLON LID TYPE 
PERCENTPERCENT UID COLON LID EQUAL TYPE 
PERCENTPERCENT UID COLON UID PLUS TYPE 
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 168

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.

PERCENTPERCENT UID COLON UID LPAREN UID TYPE 
169 170
PERCENTPERCENT UID COLON UID LPAREN UID STAR TYPE 
PERCENTPERCENT UID COLON UID LPAREN UID LPAREN LID RPAREN TYPE 
171 172
PERCENTPERCENT UID COLON UID LPAREN LID TYPE
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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
PERCENTPERCENT UID COLON UID LPAREN ACTION UID 
# 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.
PERCENTPERCENT UID COLON UID LPAREN ACTION PREC UID UID 
# 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
PERCENTPERCENT UID COLON PREC TYPE 
208 209
PERCENTPERCENT UID COLON UID LPAREN ACTION PREC TYPE 
PERCENTPERCENT UID COLON ACTION PREC TYPE 
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253

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

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

PERCENTPERCENT UID COLON UID LPAREN TYPE 
PERCENTPERCENT UID COLON UID LPAREN UID COMMA TYPE 

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 }

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

PERCENTPERCENT UID COLON PREC LID UID 

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 }

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

PERCENTPERCENT UID LPAREN UID RPAREN BAR 

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

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

PERCENTPERCENT UID COLON ACTION PREC UID TYPE 

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 261 262 263 264 265 266 267 268 269 270
# ----------------------------------------------------------------------------

TYPE OCAMLTYPE UID LPAREN UID LPAREN TYPE 
PERCENTPERCENT UID COLON UID LPAREN UID LPAREN TYPE 

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 275 276 277 278 279 280 281 282 283 284 285

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

TYPE OCAMLTYPE UID LPAREN UID PLUS UID 

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: