comparison doc/manual/wm.tex @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 \chapter{Warning and Error Messages}
2 \index{Warning messages}\index{Error messages}\index{Messages}\index{Messages}
3
4 AnaGram provides diagnostic messages in the \agwindow{Warnings} window
5 when it finds constructs in your grammar which might be incorrect, or
6 when it finds that it cannot continue its analysis of your grammar.
7 AnaGram gives up only if it encounters a syntax error or finds that
8 you have not specified a \index{Grammar token}\index{Token}grammar
9 token. Otherwise, it continues its analysis. If AnaGram succeeds in
10 analyzing your grammar, it will be in a position to build a parser for
11 you, if you should want one.
12
13 When AnaGram finds a syntax error in its input it attempts to continue
14 scanning for syntax errors but it does no further analysis of the
15 input.
16
17 When AnaGram identifies a problem while it is scanning your syntax
18 file, it precedes the diagnostic with the line number and column
19 number at which it found the problem. It does not provide line and
20 column numbers for those problems it discovers when it is actually
21 analyzing the grammar.
22
23 As an aid to debugging, for all warnings developed while scanning the
24 syntax file, AnaGram locks the cursor in the syntax file window to the
25 cursor in the Warnings window. This means that when you move the
26 cursor bar in the Warnings window to a warning message that has a line
27 number and column number, the cursor in the syntax file window is
28 moved to the corresponding line and column.
29
30 \section{Alphabetic Listing of Warning Messages}
31
32 In this list of warning messages, each message is classified according
33 to whether it is a warning or an error and according to when it
34 occurs. Errors prevent AnaGram from building a parser; warnings do
35 not. Messages may occur at program initialization, while scanning the
36 syntax file, while analyzing the grammar, or while building the
37 parser. Messages issued while scanning the syntax file are always
38 accompanied by the line and column number in the syntax file where the
39 problem is recognized.
40
41 % XXX I would like to change ``warning, analysis'' to ``analysis
42 % warning'' for all these.
43
44 \dualheading{Both error token resynch and auto resynch specified}
45 {warning, analysis}
46
47 Your grammar defines an \index{Error token}\index{Token}\agparam{error
48 token} and also requests automatic resynchronization. AnaGram will
49 ignore the request for automatic
50 \index{Resynchronization}resynchronization and will provide error
51 token \index{Resynchronization}resynchronization. If you named a token
52 \agcode{error} but do not wish error token resynchronization, you can
53 either rename \agcode{error}, or explicitly specify the error token to be
54 something you don't use in your grammar:
55
56 \begin{indentingcode}{0.4in}
57 {}[ error token = not used ]
58 \end{indentingcode}
59
60 \dualheading{Conflicts resolved by precedence rules}
61 {warning, analysis}
62
63 Your grammar has conflicts which AnaGram has resolved by applying the
64 precedence rules you supplied. These conflicts are listed in the
65 \index{Resolved Conflicts}\index{Window}\agwindow{Resolved Conflicts}
66 window, and are not listed in the
67 \index{Conflicts}\index{Window}\agwindow{Conflicts} window.
68
69 \dualheading{Duplicate production}
70 {warning, scan}
71
72 A \index{Production}production has been duplicated. You will have a
73 number of reduce-reduce \index{Conflicts}conflicts as a consequence.
74 Eliminate the duplicate, and the conflicts it caused will go away.
75
76 \dualheading{Empty keyword string}
77 {warning, scan}
78
79 \index{Keywords}
80 Keyword strings must contain at least one character. If you wish a
81 null match, use a null production instead.
82
83 \dualheading{eof token not defined}
84 {warning, analysis}
85
86 \index{Eof token}\index{Token}
87 You have requested either error token or automatic resynchronization
88 and you have not defined an end of file token. The resynchronization
89 procedure will not work correctly at end of file.
90
91 \dualheading{Error defining T\textit{nnn}: \textit{token-representation}}
92 {warning, analysis}
93
94 Errors were encountered while attempting to evaluate the
95 \index{Character set}character set for token number \textit{nnn}.
96 This warning is always generated in addition to more detailed warnings
97 that were made when the actual errors were encountered.
98
99 \dualheading{Event driven parser cannot use pointer input}
100 {error, build}
101
102 \index{Parser}
103 \index{Configuration switches}
104 \index{Event driven}
105 \index{Pointer input}
106 If you are going to use \agparam{pointer input}, you should not
107 specify your parser as \agparam{event driven}.
108 Conversely, if you really want an event driven parser, you cannot specify
109 \agparam{pointer input}. See Appendix A, Configuration Parameters for
110 details on the \agparam{pointer input} and \agparam{event driven}
111 switches.
112
113 \dualheading{Excessive recursion}
114 {error, scan}
115
116 An internal \index{Stack}stack in AnaGram overflowed because of the
117 complexity of an expression in your grammar. Simplify your grammar by
118 using definition statements to name subexpressions.
119
120 \dualheading{Fatal syntax errors}
121 {error, analysis}
122
123 AnaGram could not complete its analysis of your syntax file because of
124 syntax errors.
125
126 \dualheading{Grammar is ambiguous. See Conflicts Window}
127 {warning, analysis}
128
129 Your grammar is ambiguous. See Chapter 7 for suggestions on how to
130 deal with the ambiguities.
131
132 \dualheading{Inappropriate value}
133 {warning, scan}
134
135 The value assigned to a configuration parameter is not appropriate.
136 The value of the parameter is unchanged. Check the definition of the
137 parameter in Appendix A, Configuration Parameters.
138
139 \dualheading{Input scan aborted}
140 {error, scan}
141
142 Because of the previous errors, AnaGram was unable to finish scanning
143 your syntax file.
144
145 \dualheading{Insufficient memory}
146 {warning, scan or analysis}
147
148 Not enough memory is available to continue parsing or analyzing the
149 current syntax file. If you have been running AnaGram for some time,
150 you might succeed in analyzing your grammar if you restart AnaGram.
151 Otherwise, you need more memory, or you need to make your grammar
152 somewhat less complex.
153
154 \dualheading{Internal error: ...}
155 {error, any phase}
156
157 This error results from internal consistency checks that should never
158 fail if AnaGram is
159 working properly. If you are running AnaGram on Windows 95 or Windows
160 98, it is
161 probably not advisable to continue running AnaGram after receiving
162 this warning without rebooting your system. Sometimes when you are
163 testing buggy programs using an operating system that does not have
164 complete memory protection, a program may inadvertently alter part of
165 the system's memory. If this happens, problems may snowball. In this
166 situation the problem will not recur after you reboot your system. If
167 the problem recurs on a freshly booted system, it may be a problem in
168 AnaGram which should be fixed. Please note the complete error message
169 and file a bug report via \url{http://www.parsifalsoft.com}.
170 \index{Internal error}\index{Errors}
171 A copy of the syntax file which causes the problem
172 would be of great assistance in fixing it.
173
174 \dualheading{Keyword anomalies found}
175 {warning, analysis}
176
177 See the
178 \index{Anomaly}\index{Keyword Anomalies}\agwindow{Keyword Anomalies}
179 table for a list of the anomalies found in your syntax file.
180 See Chapter 7 for a treatment of keyword anomalies.
181
182 \dualheading{Missing \textit{syntactic-element-1} in
183 \textit{syntactic-element-2}}
184 {error, scan}
185
186 AnaGram expects to see an instance of \textit{syntactic element 1} at
187 this location in an instance of \textit{syntactic element 2}. It
188 cannot reliably continue parsing its input. Therefore, it limits
189 further analysis to scanning for syntax errors.
190
191 \dualheading{Missing production, T\textit{nnn}: \textit{token-name}}
192 {error, scan}
193
194 \index{Production}
195 Token number \textit{nnn}, a nonterminal token, appears to be defined
196 recursively, but there is no initial production to get the recursion
197 started. Check your grammar closely.
198
199 \dualheading{Missing reduction procedure, R\textit{nnn}}
200 {warning, scan}
201
202 \index{Reduction procedure}
203 A reduction parameter has been defined in this rule, number
204 \textit{nnn}, but there is no reduction procedure to use it. This
205 warning is provided in case the lack of a reduction procedure is an
206 oversight.
207
208 \dualheading{Multiple definitions for T\textit{nnn}: \textit{token-name}}
209 {warning, analysis}
210
211 \index{Definitions}
212 Token number \textit{nnn} has been defined as a character set and has
213 also been defined as a nonterminal token. It can't be both.
214
215 \dualheading{Negative character codes in pointer mode}
216 {warning, analysis}
217
218 \index{Character codes}
219 You have defined negative character codes and you are using pointer
220 input. If you are using the default definition for pointer type you
221 will be reading unsigned characters, so that your parser will never
222 see the negative codes you have defined.
223
224 % I wish there were an easy way to shut this up if the pointer type is
225 % signed.
226
227 \dualheading{No grammar token specified}
228 {error, analysis}
229
230 \index{Grammar token}\index{Token}
231 You have not specified a grammar token.
232 Edit your syntax file to specify one.
233
234 \dualheading{No productions in syntax file}
235 {error, analysis}
236
237 AnaGram did not find any productions at all in the syntax file. Do
238 you have the right file?
239
240 \dualheading{No such parameter}
241 {warning, scan}
242
243 AnaGram does not recognize the name of the configuration parameter you
244 have tried to set. Check the spelling of the parameter you wish to
245 set. See Appendix A, Configuration Parameters.
246
247 \dualheading{Not a character set, T\textit{nnn}: \textit{token-name}}
248 {warning, analysis}
249
250 Token number \textit{nnn} has been used on the left side of a
251 production and in a character set expression defining some other
252 token. AnaGram will use an empty set in place of token number
253 \textit{nnn} in the character set expression. You will get another
254 warning, Error defining token, when AnaGram finishes its evaluation of
255 the character set.
256
257 \dualheading{Nothing reduces T\textit{nnn} -$>$ R\textit{mmm}}
258 {warning, analysis}
259
260 Your grammar does not specify any input to follow an instance of this
261 rule, rule number \textit{mmm}. In all probability, your grammar does
262 not have any explicit end of file indicator. If you do not have any
263 conflicts with token T000, then you can get along without an end of
264 file indicator. Otherwise, you should modify your grammar so that it
265 recognizes end of file.
266
267 \dualheading{Null character in keyword string}
268 {warning, scan}
269
270 \index{Keywords}
271 A keyword string cannot have an embedded null character. If you must
272 allow for a null you will have to rewrite your grammar rule. For
273 example, instead of
274
275 \begin{indentingcode}{0.4in}
276 widget
277 -> "abc{\bs}0def"
278 \end{indentingcode}
279 write
280 \begin{indentingcode}{0.4in}
281 widget
282 -> "abc", 0, "def"
283 \end{indentingcode}
284
285 If you have defined a symbol as a keyword string, you will have to
286 rewrite the definition as a production. Suppose, for example, you had
287 written
288
289 \begin{indentingcode}{0.4in}
290 marker = "abc{\bs}0def"
291 \end{indentingcode}
292
293 You would have to rewrite this as
294
295 \begin{indentingcode}{0.4in}
296 marker
297 -> "abc", 0, "def"
298 \end{indentingcode}
299
300 \dualheading{Parameter \textit{name} has type void}
301 {warning, scan}
302
303 The specified parameter for a reduction procedure attempts to take the
304 value of a token whose type has been specified as void.
305
306 \dualheading{Range bounds out of order}
307 {warning, scan}
308
309 \index{Character range}\index{Range}
310 AnaGram interprets 'z-a', for example, as the letters from a to z, but
311 provides a warning in case the unusual order was a typo.
312
313 \dualheading{Recursive definition of char set: \textit{name}}
314 {warning, analysis}
315
316 \index{Character sets}
317 Character sets cannot be defined recursively.
318
319 \dualheading{Redefinition of \textit{name}}
320 {warning, analysis}
321
322 There is a previous definition statement for this variable. AnaGram
323 ignores the new definition.
324
325 \dualheading{Redefinition of grammar token}
326 {warning, scan}
327
328 \index{Grammar token}\index{Token}
329 AnaGram simply discards the old definition of the grammar, or goal,
330 token and uses the new one. The last definition in the syntax file
331 wins. Check your syntax file to be sure you have the grammar token
332 you want.
333
334 \dualheading{Redefinition of token, T\textit{nnn}: \textit{name}}
335 {warning, scan}
336
337 This variable has already been used as a nonterminal token, that is,
338 it has been used as the left side of a production. AnaGram will
339 ignore this definition statement.
340
341 \dualheading{Suspicious production for \textit{token name}}
342 {warning, scan}
343
344 This production has the form
345
346 \begin{indentingcode}{0.4in}
347 x -> x
348 \end{indentingcode}
349
350 You probably have a typo somewhere. This production causes a conflict
351 in your grammar. AnaGram leaves this production in your grammar, but
352 if you build a parser, it will never succeed in recognizing this
353 production.
354
355 \dualheading{Syntax Analysis Aborted}
356 {error, analysis}
357
358 Because of the previous errors, AnaGram was unable to complete its
359 analysis of your syntax file.
360
361 \dualheading{Token not used, T\textit{nnn}: \textit{token name}}
362 {warning, analysis}
363
364 AnaGram doesn't mind, but warns you just in case there was some sort
365 of oversight.
366
367 \dualheading{Type Redefinition of T\textit{nnn}: \textit{token name}}
368 {warning, analysis}
369
370 A previous statement has defined a different data type for token
371 number \textit{nnn}. This definition will override the previous one.
372 If you intend to use different type definitions, you should use
373 extreme caution and check the generated code to verify that your
374 reduction procedures are getting the values you intended.
375
376 \dualheading{Undefined symbol: \textit{name}}
377 {warning, analysis}
378
379 \index{Symbol}
380 AnaGram encountered this undefined symbol while evaluating a character
381 set. The next warning in the Warnings window identifies the
382 particular token AnaGram was trying to evaluate.
383
384 \dualheading{Undefined token T\textit{nnn}: \textit{name}}
385 {warning, analysis}
386
387 \index{Token}
388 This name has been used as though it represented a token, but there is
389 no definition of it as a terminal nor does any production define it as
390 a nonterminal.
391
392 \dualheading{Unexpected \textit{syntactic-element-1} in
393 \textit{syntactic-element-2}}
394 {error, scan}
395
396 AnaGram does not expect to see an instance of
397 \textit{syntactic-element-1} at this location in an instance of
398 \textit{syntactic-element-2}.
399 It cannot reliably continue parsing its input. Therefore, it limits
400 further analysis to scanning for syntax errors. If this error is not
401 the result of some prior error, you should correct your syntax file.
402 Remember that this error could just as well result from something
403 missing as well as from something extraneous.
404
405 \dualheading{Void token, \textit{token-name}, used as parameter}
406 {warning, scan}
407
408 \index{Token}
409 The token being declared as void has previously been used as a
410 parameter for a reduction procedure. Your C compiler will complain
411 when it tries to compile the call to the reduction procedure.