1/*
2 [The "BSD license"]
3 Copyright (c) 2010 Terence Parr
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9 1. Redistributions of source code must retain the above copyright
10    notice, this list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in the
13    documentation and/or other materials provided with the distribution.
14 3. The name of the author may not be used to endorse or promote products
15    derived from this software without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28/*
29 New style messages. This file only contains the messages in English, but no
30 information about which file, line, or column it occurred in.
31 The location and message ids are taken out of the formats directory.
32														Kay Roepke
33*/
34group en_US;
35
36// TOOL ERRORS
37// file errors
38CANNOT_WRITE_FILE(arg,exception,stackTrace) ::= <<
39cannot write file <arg>: <exception>
40<stackTrace; separator="\n">
41>>
42CANNOT_CLOSE_FILE(arg,exception,stackTrace) ::= "cannot close file <arg>: <exception>"
43CANNOT_FIND_TOKENS_FILE(arg) ::= "cannot find tokens file <arg>"
44ERROR_READING_TOKENS_FILE(arg,exception,stackTrace) ::= <<
45problem reading token vocabulary file <arg>: <exception>
46<stackTrace; separator="\n">
47>>
48DIR_NOT_FOUND(arg,exception,stackTrace) ::= "directory not found: <arg>"
49OUTPUT_DIR_IS_FILE(arg,exception,stackTrace) ::= "output directory is a file: <arg>"
50CANNOT_OPEN_FILE(arg,exception,stackTrace) ::= "cannot find or open file: <arg><if(exception)>; reason: <exception><endif>"
51CIRCULAR_DEPENDENCY() ::= "your grammars contain a circular dependency and cannot be sorted into a valid build order."
52
53INTERNAL_ERROR(arg,arg2,exception,stackTrace) ::= <<
54internal error: <arg> <arg2><if(exception)>: <exception><endif>
55<stackTrace; separator="\n">
56>>
57INTERNAL_WARNING(arg) ::= "internal warning: <arg>"
58ERROR_CREATING_ARTIFICIAL_RULE(arg,exception,stackTrace) ::= <<
59problems creating lexer rule listing all tokens: <exception>
60<stackTrace; separator="\n">
61>>
62TOKENS_FILE_SYNTAX_ERROR(arg,arg2) ::=
63	"problems parsing token vocabulary file <arg> on line <arg2>"
64CANNOT_GEN_DOT_FILE(arg,exception,stackTrace) ::=
65	"cannot write DFA DOT file <arg>: <exception>"
66BAD_ACTION_AST_STRUCTURE(exception,stackTrace) ::=
67	"bad internal tree structure for action '<arg>': <exception>"
68BAD_AST_STRUCTURE(arg,exception,stackTrace) ::= <<
69bad internal tree structure '<arg>': <exception>
70<stackTrace; separator="\n">
71>>
72FILE_AND_GRAMMAR_NAME_DIFFER(arg,arg2) ::=
73  "file <arg2> contains grammar <arg>; names must be identical"
74FILENAME_EXTENSION_ERROR(arg) ::=
75  "file <arg> must end in a file extension, normally .g"
76
77// code gen errors
78MISSING_CODE_GEN_TEMPLATES(arg) ::=
79	"cannot find code generation templates <arg>.stg"
80MISSING_CYCLIC_DFA_CODE_GEN_TEMPLATES() ::=
81	"cannot find code generation cyclic DFA templates for language <arg>"
82CODE_GEN_TEMPLATES_INCOMPLETE(arg) ::=
83	"at least one code generation template missing for language <arg>"
84CANNOT_CREATE_TARGET_GENERATOR(arg,exception,stackTrace) ::=
85	"cannot create target <arg> code generator: <exception>"
86CANNOT_COMPUTE_SAMPLE_INPUT_SEQ() ::=
87	"cannot generate a sample input sequence from lookahead DFA"
88
89// grammar interpretation errors
90/*
91NO_VIABLE_DFA_ALT(arg,arg2) ::=
92	"no viable transition from state <arg> on <arg2> while interpreting DFA"
93*/
94
95// GRAMMAR ERRORS
96SYNTAX_ERROR(arg) ::= "syntax error: <arg>"
97RULE_REDEFINITION(arg) ::=
98	"rule <arg> redefinition"
99LEXER_RULES_NOT_ALLOWED(arg) ::=
100	"lexer rule <arg> not allowed in parser"
101PARSER_RULES_NOT_ALLOWED(arg) ::=
102	"parser rule <arg> not allowed in lexer"
103CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL(arg) ::=
104	"cannot find an attribute name in attribute declaration"
105NO_TOKEN_DEFINITION(arg) ::=
106	"no lexer rule corresponding to token: <arg>"
107UNDEFINED_RULE_REF(arg) ::=
108	"reference to undefined rule: <arg>"
109LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE(arg) ::=
110	"literal has no associated lexer rule: <arg>"
111CANNOT_ALIAS_TOKENS_IN_LEXER(arg) ::=
112	"literals are illegal in lexer tokens{} section: <arg>"
113ATTRIBUTE_REF_NOT_IN_RULE(arg,arg2) ::=
114	"reference to attribute outside of a rule: <arg><if(arg2)>.<arg2><endif>"
115UNKNOWN_ATTRIBUTE_IN_SCOPE(arg,arg2) ::=
116	"unknown attribute for <arg>: <arg2>"
117UNKNOWN_RULE_ATTRIBUTE(arg,arg2) ::=
118	"unknown attribute for rule <arg>: <arg2>"
119UNKNOWN_SIMPLE_ATTRIBUTE(arg,args2) ::=
120	"attribute is not a token, parameter, or return value: <arg>"
121ISOLATED_RULE_SCOPE(arg) ::=
122	"missing attribute access on rule scope: <arg>"
123INVALID_RULE_PARAMETER_REF(arg,arg2) ::=
124	"cannot access rule <arg>'s parameter: <arg2>"
125INVALID_RULE_SCOPE_ATTRIBUTE_REF(arg,arg2) ::=
126	"cannot access rule <arg>'s dynamically-scoped attribute: <arg2>"
127SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE(arg) ::=
128	"symbol <arg> conflicts with global dynamic scope with same name"
129WRITE_TO_READONLY_ATTR(arg,arg2,arg3) ::=
130	"cannot write to read only attribute: $<arg><if(arg2)>.<arg2><endif>"
131LABEL_CONFLICTS_WITH_RULE(arg) ::=
132	"label <arg> conflicts with rule with same name"
133LABEL_CONFLICTS_WITH_TOKEN(arg) ::=
134	"label <arg> conflicts with token with same name"
135LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE(arg,arg2) ::=
136	"label <arg> conflicts with rule <arg2>'s dynamically-scoped attribute with same name"
137LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL(arg,arg2) ::=
138	"label <arg> conflicts with rule <arg2>'s return value or parameter with same name"
139ATTRIBUTE_CONFLICTS_WITH_RULE(arg,arg2) ::=
140	"rule <arg2>'s dynamically-scoped attribute <arg> conflicts with the rule name"
141ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL(arg,arg2) ::=
142	"rule <arg2>'s dynamically-scoped attribute <arg> conflicts with<arg2>'s return value or parameter with same name"
143LABEL_TYPE_CONFLICT(arg,arg2) ::=
144	"label <arg> type mismatch with previous definition: <arg2>"
145ARG_RETVAL_CONFLICT(arg,arg2) ::=
146	"rule <arg2>'s argument <arg> conflicts a return value with same name"
147NONUNIQUE_REF(arg) ::=
148	"<arg> is a non-unique reference"
149FORWARD_ELEMENT_REF(arg) ::=
150	"illegal forward reference: <arg>"
151MISSING_RULE_ARGS(arg) ::=
152	"missing parameter(s) on rule reference: <arg>"
153RULE_HAS_NO_ARGS(arg) ::=
154	"rule <arg> has no defined parameters"
155ARGS_ON_TOKEN_REF(arg) ::=
156	"token reference <arg> may not have parameters"
157ILLEGAL_OPTION(arg) ::=
158	"illegal option <arg>"
159LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT(arg) ::=
160	"rule '+=' list labels are not allowed w/o output option: <arg>"
161UNDEFINED_TOKEN_REF_IN_REWRITE(arg) ::=
162  "reference to undefined token in rewrite rule: <arg>"
163REWRITE_ELEMENT_NOT_PRESENT_ON_LHS(arg) ::=
164  "reference to rewrite element <arg> without reference on left of ->"
165UNDEFINED_LABEL_REF_IN_REWRITE(arg) ::=
166  "reference to undefined label in rewrite rule: $<arg>"
167NO_GRAMMAR_START_RULE (arg) ::=
168  "grammar <arg>: no start rule (no rule can obviously be followed by EOF)"
169EMPTY_COMPLEMENT(arg) ::= <<
170<if(arg)>
171set complement ~<arg> is empty
172<else>
173set complement is empty
174<endif>
175>>
176UNKNOWN_DYNAMIC_SCOPE(arg) ::=
177  "unknown dynamic scope: <arg>"
178UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE(arg,arg2) ::=
179  "unknown dynamically-scoped attribute for scope <arg>: <arg2>"
180RULE_REF_AMBIG_WITH_RULE_IN_ALT(arg) ::=
181  "reference $<arg> is ambiguous; rule <arg> is enclosing rule and referenced in the production (assuming enclosing rule)"
182ISOLATED_RULE_ATTRIBUTE(arg) ::=
183  "reference to locally-defined rule scope attribute without rule name: <arg>"
184INVALID_ACTION_SCOPE(arg,arg2) ::=
185  "unknown or invalid action scope for <arg2> grammar: <arg>"
186ACTION_REDEFINITION(arg) ::=
187  "redefinition of <arg> action"
188DOUBLE_QUOTES_ILLEGAL(arg) ::=
189  "string literals must use single quotes (such as \'begin\'): <arg>"
190INVALID_TEMPLATE_ACTION(arg) ::=
191  "invalid StringTemplate % shorthand syntax: '<arg>'"
192MISSING_ATTRIBUTE_NAME() ::=
193  "missing attribute name on $ reference"
194ARG_INIT_VALUES_ILLEGAL(arg) ::=
195  "rule parameters may not have init values: <arg>"
196REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION(arg) ::=
197  "<if(arg)>rule <arg> uses <endif>rewrite syntax or operator with no output option; setting output=AST"
198AST_OP_WITH_NON_AST_OUTPUT_OPTION(arg) ::=
199  "AST operator with non-AST output option: <arg>"
200NO_RULES(arg) ::= "grammar file <arg> has no rules"
201MISSING_AST_TYPE_IN_TREE_GRAMMAR(arg) ::=
202  "tree grammar <arg> has no ASTLabelType option"
203REWRITE_FOR_MULTI_ELEMENT_ALT(arg) ::=
204  "with rewrite=true, alt <arg> not simple node or obvious tree element; text attribute for rule not guaranteed to be correct"
205RULE_INVALID_SET(arg) ::=
206  "Cannot complement rule <arg>; not a simple set or element"
207HETERO_ILLEGAL_IN_REWRITE_ALT(arg) ::=
208  "alts with rewrites can't use heterogeneous types left of ->"
209NO_SUCH_GRAMMAR_SCOPE(arg,arg2) ::=
210  "reference to undefined grammar in rule reference: <arg>.<arg2>"
211NO_SUCH_RULE_IN_SCOPE(arg,arg2) ::=
212  "rule <arg2> is not defined in grammar <arg>"
213TOKEN_ALIAS_CONFLICT(arg,arg2) ::=
214  "cannot alias <arg>; string already assigned to <arg2>"
215TOKEN_ALIAS_REASSIGNMENT(arg,arg2) ::=
216  "cannot alias <arg>; token name already assigned to <arg2>"
217TOKEN_VOCAB_IN_DELEGATE(arg,arg2) ::=
218  "tokenVocab option ignored in imported grammar <arg>"
219INVALID_IMPORT(arg,arg2) ::=
220  "<arg.grammarTypeString> grammar <arg.name> cannot import <arg2.grammarTypeString> grammar <arg2.name>"
221IMPORTED_TOKENS_RULE_EMPTY(arg,arg2) ::=
222  "no lexer rules contributed to <arg> from imported grammar <arg2>"
223IMPORT_NAME_CLASH(arg,arg2) ::=
224  "combined grammar <arg.name> and imported <arg2.grammarTypeString> grammar <arg2.name> both generate <arg2.recognizerName>; import ignored"
225AST_OP_IN_ALT_WITH_REWRITE(arg,arg2) ::=
226  "rule <arg> alt <arg2> uses rewrite syntax and also an AST operator"
227WILDCARD_AS_ROOT(arg) ::= "Wildcard invalid as root; wildcard can itself be a tree"
228CONFLICTING_OPTION_IN_TREE_FILTER(arg,arg2) ::= "option <arg>=<arg2> conflicts with tree grammar filter mode"
229ILLEGAL_OPTION_VALUE(arg, arg2) ::= "value '<arg2>' invalid for option <arg>"
230ALL_OPS_NEED_SAME_ASSOC(arg) ::= "all operators of alt <alt> of left-recursive rule must have same associativity"
231
232// GRAMMAR WARNINGS
233
234GRAMMAR_NONDETERMINISM(input,conflictingAlts,paths,disabled,hasPredicateBlockedByAction) ::=
235<<
236<if(paths)>
237Decision can match input such as "<input>" using multiple alternatives:
238<paths:{ it |  alt <it.alt> via NFA path <it.states; separator=","><\n>}>
239<else>
240Decision can match input such as "<input>" using multiple alternatives: <conflictingAlts; separator=", ">
241<endif>
242<if(disabled)><\n>As a result, alternative(s) <disabled; separator=","> were disabled for that input<endif><if(hasPredicateBlockedByAction)><\n>Semantic predicates were present but were hidden by actions.<endif>
243>>
244
245DANGLING_STATE(danglingAlts,input) ::= <<
246the decision cannot distinguish between alternative(s) <danglingAlts; separator=","> for input such as "<input>"
247>>
248
249UNREACHABLE_ALTS(alts) ::= <<
250The following alternatives can never be matched: <alts; separator=","><\n>
251>>
252
253INSUFFICIENT_PREDICATES(upon,altToLocations,hasPredicateBlockedByAction) ::= <<
254Input such as "<upon>" is insufficiently covered with predicates at locations: <altToLocations.keys:{alt|alt <alt>: <altToLocations.(alt):{loc| line <loc.line>:<loc.column> at <loc.text>}; separator=", ">}; separator=", "><if(hasPredicateBlockedByAction)><\n>Semantic predicates were present but were hidden by actions.<endif>
255>>
256
257DUPLICATE_SET_ENTRY(arg) ::=
258	"duplicate token type <arg> when collapsing subrule into set"
259
260ANALYSIS_ABORTED(enclosingRule) ::= <<
261ANTLR could not analyze this decision in rule <enclosingRule>; often this is because of recursive rule references visible from the left edge of alternatives.  ANTLR will re-analyze the decision with a fixed lookahead of k=1.  Consider using "options {k=1;}" for that decision and possibly adding a syntactic predicate.
262>>
263
264RECURSION_OVERLOW(alt,input,targetRules,callSiteStates) ::= <<
265Alternative <alt>: after matching input such as <input> decision cannot predict what comes next due to recursion overflow <targetRules,callSiteStates:{t,c|to <t> from <c:{s|<s.enclosingRule.name>};separator=", ">}; separator=" and ">
266>>
267
268LEFT_RECURSION(targetRules,alt,callSiteStates) ::= <<
269Alternative <alt> discovers infinite left-recursion <targetRules,callSiteStates:{t,c|to <t> from <c:{s|<s.enclosingRule>};separator=", ">}; separator=" and ">
270>>
271
272UNREACHABLE_TOKENS(tokens) ::= <<
273The following token definitions can never be matched because prior tokens match the same input: <tokens; separator=",">
274>>
275
276TOKEN_NONDETERMINISM(input,conflictingTokens,paths,disabled,hasPredicateBlockedByAction) ::=
277<<
278<if(paths)>
279Decision can match input such as "<input>" using multiple alternatives:
280<paths:{ it | alt <it.alt> via NFA path <it.states; separator=","><\n>}>
281<else>
282Multiple token rules can match input such as "<input>": <conflictingTokens; separator=", "><\n>
283<endif>
284<if(disabled)><\n>As a result, token(s) <disabled; separator=","> were disabled for that input<endif><if(hasPredicateBlockedByAction)><\n>Semantic predicates were present but were hidden by actions.<endif>
285>>
286
287LEFT_RECURSION_CYCLES(listOfCycles) ::= <<
288The following sets of rules are mutually left-recursive <listOfCycles:{c| [<c:{r|<r.name>}; separator=", ">]}; separator=" and ">
289>>
290
291NONREGULAR_DECISION(ruleName,alts) ::= <<
292[fatal] rule <ruleName> has non-LL(*) decision due to recursive rule invocations reachable from alts <alts; separator=",">.  Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
293>>
294
295/* l10n for message levels */
296warning() ::= "warning"
297error() ::= "error"
298