/[eiffelstudio]/branches/CAT_mono/Src/framework/parser/parser/eiffel.y
ViewVC logotype

Contents of /branches/CAT_mono/Src/framework/parser/parser/eiffel.y

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69687 - (show annotations)
Wed Jul 25 18:55:08 2007 UTC (12 years, 4 months ago) by martins
File size: 89988 byte(s)
* monomorph for formals
* covaraince for generics (syntax only)
1
2 %{
3 indexing
4
5 description: "Eiffel parsers"
6 legal: "See notice at end of class."
7 status: "See notice at end of class."
8 date: "$Date$"
9 revision: "$Revision$"
10
11 class EIFFEL_PARSER
12
13 inherit
14
15 EIFFEL_PARSER_SKELETON
16
17 create
18 make,
19 make_with_factory
20 %}
21
22 %start Eiffel_parser
23
24 %nonassoc TE_ASSIGNMENT
25 %nonassoc TE_DOTDOT
26 %left TE_IMPLIES
27 %left TE_OR
28 %left TE_XOR
29 %left TE_AND
30 %left TE_NE TE_EQ TE_LT TE_GT TE_LE TE_GE
31 %left TE_PLUS TE_MINUS
32 %left TE_STAR TE_SLASH TE_MOD TE_DIV
33 %right TE_POWER
34 %left TE_FREE
35 %right TE_NOT
36 %nonassoc TE_STRIP
37 %left TE_OLD
38 %left TE_DOT
39 %right TE_LPARAN
40
41 %token <ID_AS> TE_FREE TE_ID TE_TUPLE TE_A_BIT
42 %token TE_INTEGER
43 %token TE_REAL
44 %token <CHAR_AS>TE_CHAR
45
46 %token <SYMBOL_AS> TE_LSQURE TE_RSQURE
47 %token <SYMBOL_AS> TE_ACCEPT TE_ADDRESS TE_ASSIGNMENT
48 %token <SYMBOL_AS> TE_CURLYTILDE
49 %token <SYMBOL_AS> TE_LARRAY TE_RARRAY TE_RPARAN TE_LPARAN
50 %token <SYMBOL_AS> TE_LCURLY TE_RCURLY
51 %token <SYMBOL_AS> TE_BANG TE_SEMICOLON
52 %token <SYMBOL_AS> TE_COLON TE_COMMA
53 %token <SYMBOL_AS> TE_CONSTRAIN TE_QUESTION
54 %token <SYMBOL_AS> TE_DOTDOT TE_TILDE TE_DOT
55 %token <SYMBOL_AS> TE_EQ TE_LT TE_GT TE_LE TE_GE TE_NE
56 %token <SYMBOL_AS> TE_PLUS TE_MINUS TE_STAR TE_SLASH TE_POWER
57 %token <SYMBOL_AS> TE_DIV TE_MOD
58
59 %token <BOOL_AS> TE_FALSE TE_TRUE
60 %token <RESULT_AS> TE_RESULT
61 %token <RETRY_AS> TE_RETRY
62 %token <UNIQUE_AS> TE_UNIQUE
63 %token <CURRENT_AS> TE_CURRENT
64 %token <DEFERRED_AS> TE_DEFERRED
65 %token <VOID_AS> TE_VOID
66
67 %token <KEYWORD_AS> TE_END
68 %token <KEYWORD_AS> TE_FROZEN
69 %token <KEYWORD_AS> TE_PARTIAL_CLASS
70 %token <KEYWORD_AS> TE_INFIX
71 %token <KEYWORD_AS> TE_CREATION
72 %token <KEYWORD_AS> TE_PRECURSOR
73 %token <KEYWORD_AS> TE_PREFIX
74
75 %token <KEYWORD_AS> TE_IS
76 %token <KEYWORD_AS> TE_AGENT TE_ALIAS TE_ALL TE_AND TE_AS
77 %token <KEYWORD_AS> TE_ASSIGN TE_BIT TE_CHECK TE_CLASS TE_CONVERT
78 %token <KEYWORD_AS> TE_CREATE TE_DEBUG TE_DO TE_ELSE TE_ELSEIF
79 %token <KEYWORD_AS> TE_ENSURE TE_EXPANDED TE_EXPORT TE_EXTERNAL TE_FEATURE
80 %token <KEYWORD_AS> TE_FROM TE_IF TE_IMPLIES TE_INDEXING TE_INHERIT
81 %token <KEYWORD_AS> TE_INSPECT TE_INVARIANT TE_LIKE TE_LOCAL
82 %token <KEYWORD_AS> TE_LOOP TE_NOT TE_OBSOLETE TE_OLD TE_ONCE
83 %token <KEYWORD_AS> TE_ONCE_STRING TE_OR TE_REDEFINE TE_REFERENCE TE_RENAME
84 %token <KEYWORD_AS> TE_REQUIRE TE_RESCUE TE_SELECT TE_SEPARATE TE_STRIP
85 %token <KEYWORD_AS> TE_THEN TE_UNDEFINE TE_UNTIL TE_VARIANT TE_WHEN
86 %token <KEYWORD_AS> TE_XOR
87
88 %token TE_STRING TE_EMPTY_STRING TE_VERBATIM_STRING TE_EMPTY_VERBATIM_STRING
89 %token TE_STR_LT TE_STR_LE TE_STR_GT TE_STR_GE TE_STR_MINUS
90 %token TE_STR_PLUS TE_STR_STAR TE_STR_SLASH TE_STR_MOD
91 %token TE_STR_DIV TE_STR_POWER TE_STR_AND TE_STR_AND_THEN
92 %token TE_STR_IMPLIES TE_STR_OR TE_STR_OR_ELSE TE_STR_XOR
93 %token TE_STR_NOT TE_STR_FREE TE_STR_BRACKET
94
95 %type <SYMBOL_AS>ASemi
96 %type <KEYWORD_AS> Alias_mark Is_keyword
97 %type <ALIAS_TRIPLE>Alias
98 %type <PAIR[KEYWORD_AS, EIFFEL_LIST [INSTRUCTION_AS]]> Else_part Rescue
99
100 %type <PAIR[KEYWORD_AS, ID_AS]> Assigner_mark_opt
101 %type <PAIR[KEYWORD_AS, STRING_AS]> External_name Obsolete
102 %type <IDENTIFIER_LIST> Identifier_list Strip_identifier_list
103 %type <PAIR [KEYWORD_AS, EIFFEL_LIST [TAGGED_AS]]> Invariant
104 %type <AGENT_TARGET_TRIPLE> Agent_target
105
106 %type <ACCESS_AS> A_feature Creation_target
107 %type <ACCESS_FEAT_AS> Feature_access
108 %type <ACCESS_INV_AS> Creation_call
109 %type <ARRAY_AS> Manifest_array
110 %type <ASSIGN_AS> Assignment
111 %type <ASSIGNER_CALL_AS> Assigner_call
112 %type <ATOMIC_AS> Index_value Manifest_constant Expression_constant
113 %type <BINARY_AS> Qualified_binary_expression
114 %type <BIT_CONST_AS> Bit_constant
115 %type <BODY_AS> Declaration_body
116 %type <BOOL_AS> Boolean_constant
117 %type <CALL_AS> Call Remote_call Qualified_call
118 %type <CASE_AS> When_part
119 %type <CHAR_AS> Character_constant
120 %type <CHECK_AS> Check
121 %type <KEYWORD_AS> Class_mark
122 %type <CLIENT_AS> Clients Feature_client_clause
123 %type <CONSTANT_AS> Constant_attribute
124 %type <CONVERT_FEAT_AS> Convert_feature
125 %type <CREATE_AS> Creation_clause
126 %type <CREATION_AS> Creation
127 %type <CREATION_EXPR_AS> Creation_expression
128 %type <DEBUG_AS> Debug
129 %type <ELSIF_AS> Elseif_part
130 %type <ENSURE_AS> Postcondition
131 %type <EXPORT_ITEM_AS> New_export_item
132 %type <EXPR_AS> Bracket_target Expression Factor Qualified_expression Qualified_factor Typed_expression
133 %type <EXTERNAL_AS> External
134 %type <EXTERNAL_LANG_AS> External_language
135 %type <FEATURE_AS> Feature_declaration
136 %type <FEATURE_CLAUSE_AS> Feature_clause
137 %type <FEATURE_SET_AS> Feature_set
138 %type <FORMAL_AS> Formal_parameter
139 %type <FORMAL_DEC_AS> Formal_generic
140 %type <ID_AS> Class_or_tuple_identifier Class_identifier Identifier_as_lower Free_operator Feature_name_for_call
141 %type <IF_AS> Conditional
142 %type <INDEX_AS> Index_clause Index_clause_impl
143 %type <INSPECT_AS> Multi_branch
144 %type <INSTRUCTION_AS> Instruction Instruction_impl
145 %type <INTEGER_AS> Integer_constant Signed_integer Nosigned_integer Typed_integer Typed_nosigned_integer Typed_signed_integer
146 %type <INTERNAL_AS> Internal
147 %type <INTERVAL_AS> Choice
148 %type <INVARIANT_AS> Class_invariant
149 %type <LOOP_AS> Loop
150 %type <NESTED_AS> Call_on_feature_access
151 %type <OPERAND_AS> Delayed_actual
152 %type <PARENT_AS> Parent Parent_clause
153 %type <PRECURSOR_AS> A_precursor
154 %type <STATIC_ACCESS_AS> A_static_call Old_a_static_call New_a_static_call
155 %type <REAL_AS> Real_constant Signed_real Nosigned_real Typed_real Typed_nosigned_real Typed_signed_real
156 %type <RENAME_AS> Rename_pair
157 %type <REQUIRE_AS> Precondition
158 %type <REVERSE_AS> Reverse_assignment
159 %type <ROUT_BODY_AS> Routine_body
160 %type <ROUTINE_AS> Routine Optional_attribute_or_routine
161 %type <ROUTINE_CREATION_AS> Agent_call
162 %type <PAIR[ROUTINE_CREATION_AS, LOCATION_AS]> Tilda_agent_call
163 %type <STRING_AS> Manifest_string Non_empty_string Default_manifest_string Typed_manifest_string Infix_operator Prefix_operator Alias_name
164 %type <TAGGED_AS> Assertion_clause
165 %type <TUPLE_AS> Manifest_tuple
166 %type <TYPE_AS> Type Non_class_type Typed Class_or_tuple_type Class_type Tuple_type Type_no_id Constraint_type Actual_generic_type
167 %type <PAIR [SYMBOL_AS, TYPE_AS]> Type_mark
168 %type <CLASS_TYPE_AS> Parent_class_type
169 %type <TYPE_DEC_AS> Entity_declaration_group
170 %type <VARIANT_AS> Variant
171 %type <FEATURE_NAME> Infix Prefix Feature_name Extended_feature_name New_feature
172
173 %type <EIFFEL_LIST [ATOMIC_AS]> Index_terms
174 %type <EIFFEL_LIST [CASE_AS]> When_part_list_opt When_part_list
175 %type <CONVERT_FEAT_LIST_AS> Convert_list Convert_clause
176 %type <EIFFEL_LIST [CREATE_AS]> Creators Creation_clause_list
177 %type <EIFFEL_LIST [ELSIF_AS]> Elseif_list Elseif_part_list
178 %type <EIFFEL_LIST [EXPORT_ITEM_AS]> New_export_list
179 %type <EXPORT_CLAUSE_AS> New_exports New_exports_opt
180 %type <EIFFEL_LIST [EXPR_AS]> Expression_list
181 %type <PARAMETER_LIST_AS> Parameters
182 %type <EIFFEL_LIST [FEATURE_AS]> Feature_declaration_list
183 %type <EIFFEL_LIST [FEATURE_CLAUSE_AS]> Features Feature_clause_list
184 %type <EIFFEL_LIST [FEATURE_NAME]> Feature_list Feature_list_impl New_feature_list
185 %type <CREATION_CONSTRAIN_TRIPLE> Creation_constraint
186 %type <UNDEFINE_CLAUSE_AS> Undefine Undefine_opt
187 %type <REDEFINE_CLAUSE_AS> Redefine Redefine_opt
188 %type <SELECT_CLAUSE_AS> Select Select_opt
189 %type <FORMAL_GENERIC_LIST_AS> Formal_generics Formal_generic_list
190 %type <CLASS_LIST_AS> Client_list Class_list
191
192 %type <INDEXING_CLAUSE_AS> Indexing Index_list Dotnet_indexing
193 %type <EIFFEL_LIST [INSTRUCTION_AS]> Compound Instruction_list
194 %type <EIFFEL_LIST [INTERVAL_AS]> Choices
195 %type <EIFFEL_LIST [OPERAND_AS]> Delayed_actual_list
196 %type <DELAYED_ACTUAL_LIST_AS> Delayed_actuals
197 %type <PARENT_LIST_AS> Inheritance Parent_list
198 %type <EIFFEL_LIST [RENAME_AS]> Rename_list
199 %type <RENAME_CLAUSE_AS> Rename
200 %type <EIFFEL_LIST [STRING_AS]> String_list
201 %type <DEBUG_KEY_LIST_AS> Debug_keys
202 %type <EIFFEL_LIST [TAGGED_AS]> Assertion Assertion_list
203 %type <TYPE_LIST_AS> Generics Generics_opt Type_list Type_list_impl Actual_parameter_list Generic_type_list Generic_type_list_impl
204 %type <TYPE_DEC_LIST_AS> Entity_declaration_list Named_parameter_list
205 %type <LOCAL_DEC_LIST_AS> Local_declarations
206 %type <FORMAL_ARGU_DEC_LIST_AS> Formal_arguments Optional_formal_arguments
207 %type <CONSTRAINT_TRIPLE> Constraint
208 %type <CONSTRAINT_LIST_AS> Multiple_constraint_list
209 %type <CONSTRAINING_TYPE_AS> Single_constraint
210
211 %expect 125
212
213 %%
214
215 --###################################################################
216 --# Root rule actually divided in 4 different parsers:
217 --# 1 - parsing Eiffel classes
218 --# 2 - parsing Eiffel types (differentiated by reading first a
219 --# random Identifier
220 --# 3 - parsing Eiffel expression (differentiated by reading first
221 --# the TE_FEATURE token)
222 --# 4 - parsing Eiffel indexing clause (needed for reading
223 --# `indexing.txt' file used to describe a cluster)
224 --# 5 - parsing Eiffel entity declaration list (to get correct type for
225 --# locals or arguments or attributes.
226 --###################################################################
227 Eiffel_parser:
228 Class_declaration
229 {
230 if type_parser or expression_parser or feature_parser or indexing_parser or entity_declaration_parser or invariant_parser then
231 raise_error
232 end
233 }
234 | Identifier_as_lower Type
235 {
236 if not type_parser or expression_parser or feature_parser or indexing_parser or entity_declaration_parser or invariant_parser then
237 raise_error
238 end
239 type_node := $2
240 }
241 | TE_FEATURE Feature_declaration
242 {
243 if not feature_parser or type_parser or expression_parser or indexing_parser or entity_declaration_parser or invariant_parser then
244 raise_error
245 end
246 feature_node := $2
247 }
248 | TE_CHECK Expression
249 {
250 if not expression_parser or type_parser or feature_parser or indexing_parser or entity_declaration_parser or invariant_parser then
251 raise_error
252 end
253 expression_node := $2
254 }
255 | Indexing
256 {
257 if not indexing_parser or type_parser or expression_parser or feature_parser or entity_declaration_parser or invariant_parser then
258 raise_error
259 end
260 indexing_node := $1
261 }
262 | TE_INVARIANT Class_invariant
263 {
264 if not invariant_parser or type_parser or expression_parser or feature_parser or indexing_parser or entity_declaration_parser then
265 raise_error
266 end
267 invariant_node := $2
268 }
269 | TE_LOCAL
270 {
271 if not entity_declaration_parser or type_parser or expression_parser or feature_parser or indexing_parser or invariant_parser then
272 raise_error
273 end
274 entity_declaration_node := Void
275 }
276 | TE_LOCAL Add_counter Entity_declaration_list Remove_counter
277 {
278 if not entity_declaration_parser or type_parser or expression_parser or feature_parser or indexing_parser or invariant_parser then
279 raise_error
280 end
281 entity_declaration_node := $3
282 }
283 ;
284
285 Class_declaration:
286 Indexing -- $1
287 Header_mark -- $2
288 Class_mark -- $3
289 Class_or_tuple_identifier -- $4
290 Formal_generics -- $5
291 External_name -- $6
292 Obsolete -- $7
293 Inheritance End_inheritance_pos -- $8 $9
294 Creators -- $10
295 Convert_clause -- $11
296 Features End_features_pos -- $12 $13
297 Class_invariant -- $14
298 Indexing -- $15
299 TE_END -- $16
300 {
301 if $6 /= Void then
302 temp_string_as1 := $6.second
303 else
304 temp_string_as1 := Void
305 end
306 if $7 /= Void then
307 temp_string_as2 := $7.second
308 else
309 temp_string_as2 := Void
310 end
311
312 root_node := new_class_description ($4, temp_string_as1,
313 is_deferred, is_expanded, is_separate, is_frozen_class, is_external_class, is_partial_class,
314 $1, $15, $5, $8, $10, $11, $12, $14, suppliers, temp_string_as2, $16)
315 if root_node /= Void then
316 root_node.set_text_positions (
317 formal_generics_end_position,
318 inheritance_end_position,
319 features_end_position)
320 if $6 /= Void then
321 root_node.set_alias_keyword ($6.first)
322 end
323 if $7 /= Void then
324 root_node.set_obsolete_keyword ($7.first)
325 end
326 root_node.set_header_mark (frozen_keyword, expanded_keyword, deferred_keyword, separate_keyword, external_keyword)
327 root_node.set_class_keyword ($3)
328 end
329 }
330 ;
331
332 End_inheritance_pos: { inheritance_end_position := position } ;
333 End_features_pos: { features_end_position := position } ;
334 End_feature_clause_pos: { feature_clause_end_position := position };
335 -- Indexing
336
337
338 Indexing: -- Empty
339 -- { $$ := Void }
340 | TE_INDEXING Add_indexing_counter Index_list Remove_counter
341 {
342 $$ := $3
343 if $$ /= Void then
344 $$.set_indexing_keyword ($1)
345 end
346 set_has_old_verbatim_strings_warning (initial_has_old_verbatim_strings_warning)
347 }
348 | TE_INDEXING
349 --- { $$ := Void }
350 {
351 $$ := ast_factory.new_indexing_clause_as (0)
352 if $$ /= Void then
353 $$.set_indexing_keyword ($1)
354 end
355 }
356 ;
357
358 Dotnet_indexing: -- Empty
359 -- { $$ := Void }
360 | TE_INDEXING TE_END
361 --- { $$ := Void }
362 {
363 $$ := ast_factory.new_indexing_clause_as (0)
364 if $$ /= Void then
365 $$.set_indexing_keyword ($1)
366 $$.set_end_keyword ($2)
367 end
368 }
369 | TE_INDEXING Add_indexing_counter Index_list Remove_counter TE_END
370 {
371 $$ := $3
372 if $$ /= Void then
373 if $1 /= Void then
374 $$.set_indexing_keyword ($1)
375 end
376 if $5 /= Void then
377 $$.set_end_keyword ($5)
378 end
379 end
380 set_has_old_verbatim_strings_warning (initial_has_old_verbatim_strings_warning)
381 }
382 ;
383
384 Index_list: Index_clause
385 {
386 $$ := ast_factory.new_indexing_clause_as (counter_value + 1)
387 if $$ /= Void and $1 /= Void then
388 $$.reverse_extend ($1)
389 $$.update_lookup ($1)
390 end
391 }
392 | Index_clause Increment_counter Index_list
393 {
394 $$ := $3
395 if $$ /= Void and $1 /= Void then
396 $$.reverse_extend ($1)
397 $$.update_lookup ($1)
398 end
399 }
400 ;
401
402 Index_clause: Add_counter Index_clause_impl Remove_counter
403 { $$ := $2 }
404 ;
405
406 Index_clause_impl: Identifier_as_lower TE_COLON Index_terms ASemi
407 {
408 $$ := ast_factory.new_index_as ($1, $3, $2)
409 }
410 | Index_terms ASemi
411 {
412 $$ := ast_factory.new_index_as (Void, $1, Void)
413 if has_syntax_warning and $1 /= Void then
414 Error_handler.insert_warning (
415 create {SYNTAX_WARNING}.make ($1.start_location.line,
416 $1.start_location.column, filename,
417 once "Missing `Index' part of `Index_clause'."))
418 end
419 }
420 ;
421
422 Index_terms: Index_value
423 {
424 $$ := ast_factory.new_eiffel_list_atomic_as (counter_value + 1)
425 if $$ /= Void and $1 /= Void then
426 $$.reverse_extend ($1)
427 end
428 }
429 | Index_value TE_COMMA Increment_counter Index_terms
430 {
431 $$ := $4
432 if $$ /= Void and $1 /= Void then
433 $$.reverse_extend ($1)
434 ast_factory.reverse_extend_separator ($$, $2)
435 end
436 }
437 | TE_SEMICOLON
438 {
439 -- TO DO: remove this TE_SEMICOLON (see: INDEX_AS.index_list /= Void)
440 $$ := ast_factory.new_eiffel_list_atomic_as (0)
441 }
442 ;
443
444 Index_value: Identifier_as_lower
445 { $$ := $1 }
446 | Manifest_constant
447 { $$ := $1 }
448 | Disable_supplier_recording_only_for_classic Creation_expression TE_END Enable_supplier_recording_only_for_classic
449 { $$ := ast_factory.new_custom_attribute_as ($2, Void, $3) }
450 | Disable_supplier_recording_only_for_classic Creation_expression Manifest_tuple TE_END Enable_supplier_recording_only_for_classic
451 { $$ := ast_factory.new_custom_attribute_as ($2, $3, $4) }
452 ;
453
454 Disable_supplier_recording:
455 {
456 is_supplier_recorded := False
457 }
458 ;
459
460 Enable_supplier_recording:
461 {
462 is_supplier_recorded := True
463 }
464 ;
465
466 Disable_supplier_recording_only_for_classic:
467 {
468 if not il_parser then
469 is_supplier_recorded := False
470 end
471 }
472 ;
473
474 Enable_supplier_recording_only_for_classic:
475 {
476 if not il_parser then
477 is_supplier_recorded := True
478 end
479 }
480 ;
481
482 Header_mark: Frozen_mark External_mark
483 {
484 is_deferred := False
485 is_expanded := False
486 is_separate := False
487
488 deferred_keyword := Void
489 expanded_keyword := Void
490 separate_keyword := Void
491 }
492 | TE_DEFERRED External_mark
493 {
494 is_frozen_class := False
495 is_deferred := True
496 is_expanded := False
497 is_separate := False
498
499 frozen_keyword := Void
500 deferred_keyword := $1
501 expanded_keyword := Void
502 separate_keyword := Void
503 }
504 | Frozen_mark TE_EXPANDED External_mark
505 {
506 is_deferred := False
507 is_expanded := True
508 is_separate := False
509
510 deferred_keyword := Void
511 expanded_keyword := $2
512 separate_keyword := Void
513 }
514 | Frozen_mark TE_SEPARATE External_mark
515 {
516 is_deferred := False
517 is_expanded := False
518 is_separate := True
519
520 deferred_keyword := Void
521 expanded_keyword := Void
522 separate_keyword := $2
523 }
524 ;
525
526 Frozen_mark: -- Empty
527 {
528 is_frozen_class := False
529 frozen_keyword := Void
530 }
531 | TE_FROZEN
532 {
533 -- I'm adding a few comments line
534 -- here because otherwise the generated
535 -- parser is very different from the
536 -- previous one, since line numbers are
537 -- emitted.
538 is_frozen_class := True
539 frozen_keyword := $1
540 }
541 ;
542
543 External_mark: -- Empty
544 {
545 is_external_class := False
546 external_keyword := Void
547 }
548 | TE_EXTERNAL
549 {
550 if il_parser then
551 is_external_class := True
552 external_keyword := $1
553 else
554 -- Trigger a syntax error.
555 raise_error
556 end
557 }
558 ;
559
560 Class_mark: TE_CLASS
561 {
562 $$ := $1;
563 is_partial_class := false;
564 }
565 | TE_PARTIAL_CLASS
566 {
567 $$ := $1;
568 is_partial_class := true;
569 }
570 ;
571
572 -- Obsolete
573
574
575 Obsolete: -- Empty
576 -- { $$ := Void }
577 | TE_OBSOLETE Manifest_string
578 {
579 $$ := ast_factory.new_keyword_string_pair ($1, $2)
580 }
581 ;
582
583
584 -- Features
585
586 Features: -- Empty
587 -- { $$ := Void }
588 | Add_counter Feature_clause_list Remove_counter
589 {
590 $$ := $2
591 if $$ /= Void and then $$.is_empty then
592 $$ := Void
593 end
594 }
595 ;
596
597 Feature_clause_list: Feature_clause
598 {
599 $$ := ast_factory.new_eiffel_list_feature_clause_as (counter_value + 1)
600 if $$ /= Void and $1 /= Void then
601 $$.reverse_extend ($1)
602 end
603 }
604 | Feature_clause Increment_counter Feature_clause_list
605 {
606 $$ := $3
607 if $$ /= Void and $1 /= Void then
608 $$.reverse_extend ($1)
609 end
610 }
611 ;
612
613 Feature_clause: Feature_client_clause End_feature_clause_pos
614 { $$ := ast_factory.new_feature_clause_as ($1,
615 ast_factory.new_eiffel_list_feature_as (0), fclause_pos, feature_clause_end_position) }
616 | Feature_client_clause Add_counter Feature_declaration_list Remove_counter End_feature_clause_pos
617 { $$ := ast_factory.new_feature_clause_as ($1, $3, fclause_pos, feature_clause_end_position) }
618 ;
619
620 Feature_client_clause: TE_FEATURE
621 {
622 fclause_pos := $1
623 if $1 /= Void then
624 -- Originally, it was 8, I changed it to 7, delete the following line when fully tested. (Jason)
625 fclause_pos.set_position (line, column, position, 7)
626 else
627 -- Originally, it was 8, I changed it to 7 (Jason)
628 fclause_pos := ast_factory.new_feature_keyword_as (line, column, position, 7, Current)
629 end
630
631 }
632 Clients
633 { $$ := $3 }
634 ;
635
636 Clients: -- Empty
637 -- { $$ := Void }
638 | Client_list
639 { $$ := ast_factory.new_client_as ($1) }
640 ;
641
642 Client_list: TE_LCURLY TE_RCURLY
643 {
644 $$ := ast_factory.new_class_list_as (1)
645 if $$ /= Void then
646 $$.reverse_extend (new_none_id)
647 $$.set_lcurly_symbol ($1)
648 $$.set_rcurly_symbol ($2)
649 end
650 }
651 | TE_LCURLY Add_counter Class_list Remove_counter TE_RCURLY
652 {
653 $$ := $3
654 if $$ /= Void then
655 $$.set_lcurly_symbol ($1)
656 $$.set_rcurly_symbol ($5)
657 end
658 }
659 ;
660
661 Class_list: Class_or_tuple_identifier
662 {
663 $$ := ast_factory.new_class_list_as (counter_value + 1)
664 if $$ /= Void and $1 /= Void then
665 $$.reverse_extend ($1)
666 suppliers.insert_light_supplier_id ($1)
667 end
668 }
669 | Class_or_tuple_identifier TE_COMMA Increment_counter Class_list
670 {
671 $$ := $4
672 if $$ /= Void and $1 /= Void then
673 $$.reverse_extend ($1)
674 suppliers.insert_light_supplier_id ($1)
675 ast_factory.reverse_extend_separator ($$, $2)
676 end
677 }
678 ;
679
680 Feature_declaration_list: Feature_declaration
681 {
682 $$ := ast_factory.new_eiffel_list_feature_as (counter_value + 1)
683 if $$ /= Void and $1 /= Void then
684 $$.reverse_extend ($1)
685 end
686 }
687 | Feature_declaration Increment_counter Feature_declaration_list
688 {
689 $$ := $3
690 if $$ /= Void and $1 /= Void then
691 $$.reverse_extend ($1)
692 end
693 }
694 ;
695
696 ASemi: -- Empty
697 | TE_SEMICOLON { $$ := $1 }
698 ;
699
700 Feature_declaration: Add_counter New_feature_list Remove_counter Declaration_body Optional_semicolons
701 {
702 $$ := ast_factory.new_feature_as ($2, $4, feature_indexes, position)
703 feature_indexes := Void
704 }
705 ;
706
707 New_feature_list: New_feature
708 {
709 $$ := ast_factory.new_eiffel_list_feature_name (counter_value + 1)
710 if $$ /= Void and $1 /= Void then
711 $$.reverse_extend ($1)
712 end
713 }
714 | New_feature TE_COMMA Increment_counter New_feature_list
715 {
716 $$ := $4
717 if $$ /= Void and $1 /= Void then
718 $$.reverse_extend ($1)
719 ast_factory.reverse_extend_separator ($$, $2)
720 end
721 }
722 ;
723
724 New_feature: Extended_feature_name
725 { $$ := $1 }
726 | TE_FROZEN Extended_feature_name
727 {
728 $$ := $2
729 if $$ /= Void then
730 $$.set_frozen_keyword ($1)
731 end
732 }
733 ;
734
735 Extended_feature_name: Feature_name
736 { $$ := $1 }
737 | Identifier_as_lower Alias
738 {
739 if $2 /= Void then
740 $$ := ast_factory.new_feature_name_alias_as ($1, $2.alias_name, has_convert_mark, $2.alias_keyword, $2.convert_keyword)
741 else
742 $$ := ast_factory.new_feature_name_alias_as ($1, Void, has_convert_mark, Void, Void)
743 end
744
745 }
746 ;
747
748 Feature_name: Identifier_as_lower
749 { $$ := ast_factory.new_feature_name_id_as ($1) }
750 | Infix
751 { $$ := $1 }
752 | Prefix
753 { $$ := $1 }
754 ;
755
756 Infix: TE_INFIX Infix_operator
757 { $$ := ast_factory.new_infix_as ($2, $1) }
758 ;
759
760
761 Prefix: TE_PREFIX Prefix_operator
762 { $$ := ast_factory.new_prefix_as ($2, $1) }
763 ;
764
765 Alias: TE_ALIAS Alias_name Alias_mark
766 {
767 $$ := ast_factory.new_alias_triple ($1, $2, $3)
768 }
769 ;
770
771 Alias_name: Infix_operator
772 { $$ := $1 }
773 | TE_STR_NOT
774 {
775 $$ := ast_factory.new_string_as ("not", line, column, position, 5, token_buffer2)
776 }
777 | TE_STR_BRACKET
778 {
779 $$ := ast_factory.new_string_as ("[]", line, column, position, 4, token_buffer2)
780 }
781 ;
782
783 Alias_mark: -- Empty
784 { has_convert_mark := False }
785 | TE_CONVERT
786 { has_convert_mark := True
787 $$ := $1
788 }
789 ;
790
791 Is_keyword: -- Empty
792 { $$ := Void }
793 | TE_IS
794 { $$ := $1 }
795 ;
796
797 Declaration_body: TE_COLON Type Assigner_mark_opt Dotnet_indexing
798 {
799 -- Attribute case
800 if $3 = Void then
801 $$ := ast_factory.new_body_as (Void, $2, Void, Void, $1, Void, Void, $4)
802 else
803 $$ := ast_factory.new_body_as (Void, $2, $3.second, Void, $1, Void, $3.first, $4)
804 end
805 feature_indexes := $4
806 }
807 | TE_COLON Type Assigner_mark_opt TE_EQ Constant_attribute Dotnet_indexing
808 {
809 -- Constant case
810 if $3 = Void then
811 $$ := ast_factory.new_body_as (Void, $2, Void, $5, $1, $4, Void, $6)
812 else
813 $$ := ast_factory.new_body_as (Void, $2, $3.second, $5, $1, $4, $3.first, $6)
814 end
815
816 feature_indexes := $6
817 }
818 | TE_COLON Type Assigner_mark_opt TE_IS Constant_attribute Dotnet_indexing
819 {
820 -- Constant case
821 if $3 = Void then
822 $$ := ast_factory.new_body_as (Void, $2, Void, $5, $1, $4, Void, $6)
823 else
824 $$ := ast_factory.new_body_as (Void, $2, $3.second, $5, $1, $4, $3.first, $6)
825 end
826
827 feature_indexes := $6
828 }
829 | Is_keyword Indexing Routine
830 {
831 -- procedure without arguments
832 $$ := ast_factory.new_body_as (Void, Void, Void, $3, Void, $1, Void, $2)
833 feature_indexes := $2
834 }
835 | TE_COLON Type Assigner_mark_opt TE_IS Indexing Routine
836 {
837 -- Function without arguments
838 if $3 = Void then
839 $$ := ast_factory.new_body_as (Void, $2, Void, $6, $1, $4, Void, $5)
840 else
841 $$ := ast_factory.new_body_as (Void, $2, $3.second, $6, $1, $4, $3.first, $5)
842 end
843
844 feature_indexes := $5
845 }
846 | TE_COLON Type Assigner_mark_opt Indexing Routine
847 {
848 -- Function without arguments
849 if $3 = Void then
850 $$ := ast_factory.new_body_as (Void, $2, Void, $5, $1, Void, Void, $4)
851 else
852 $$ := ast_factory.new_body_as (Void, $2, $3.second, $5, $1, Void, $3.first, $4)
853 end
854
855 feature_indexes := $4
856 }
857 | Formal_arguments Is_keyword Indexing Routine
858 {
859 -- procedure with arguments
860 $$ := ast_factory.new_body_as ($1, Void, Void, $4, Void, $2, Void, $3)
861 feature_indexes := $3
862 }
863 | Formal_arguments TE_COLON Type Assigner_mark_opt Is_keyword Indexing Routine
864 {
865 -- Function with arguments
866 if $4 = Void then
867 $$ := ast_factory.new_body_as ($1, $3, Void, $7, $2, $5, Void, $6)
868 else
869 $$ := ast_factory.new_body_as ($1, $3, $4.second, $7, $2, $5, $4.first, $6)
870 end
871 feature_indexes := $6
872 }
873 ;
874
875 Assigner_mark_opt: -- Empty
876 {
877 $$ := ast_factory.new_assigner_mark_as (Void, Void)
878 }
879 | TE_ASSIGN Identifier_as_lower
880 {
881 $$ := ast_factory.new_assigner_mark_as ($1, $2)
882 }
883 ;
884
885 Constant_attribute: Manifest_constant
886 { $$ := ast_factory.new_constant_as ($1) }
887 | TE_UNIQUE
888 { $$ := ast_factory.new_constant_as ($1) }
889 ;
890
891 -- Inheritance
892
893
894 Inheritance: -- Empty
895 -- { $$ := Void }
896 | TE_INHERIT ASemi
897 {
898 if has_syntax_warning then
899 Error_handler.insert_warning (
900 create {SYNTAX_WARNING}.make (line, column, filename,
901 once "Use `inherit ANY' or do not specify an empty inherit clause"))
902 end
903 --- $$ := Void
904 $$ := ast_factory.new_eiffel_list_parent_as (0)
905 if $$ /= Void then
906 $$.set_inherit_keyword ($1)
907 end
908 }
909 | TE_INHERIT Add_counter Parent_list Remove_counter
910 {
911 $$ := $3
912 if $$ /= Void then
913 $$.set_inherit_keyword ($1)
914 end
915 }
916 ;
917
918 Parent_list: Parent
919 {
920 $$ := ast_factory.new_eiffel_list_parent_as (counter_value + 1)
921 if $$ /= Void and $1 /= Void then
922 $$.reverse_extend ($1)
923 end
924 }
925 | Parent Increment_counter Parent_list
926 {
927 $$ := $3
928 if $$ /= Void and $1 /= Void then
929 $$.reverse_extend ($1)
930 end
931 }
932 ;
933
934 Parent: Parent_clause ASemi
935 { $$ := $1 }
936 ;
937
938 Parent_class_type: Class_identifier Generics_opt
939 { $$ := ast_factory.new_class_type_as ($1, $2) }
940 ;
941
942 Parent_clause: Parent_class_type
943 {
944 $$ := ast_factory.new_parent_as ($1, Void, Void, Void, Void, Void, Void)
945 }
946 | Parent_class_type Select TE_END
947 {
948 $$ := ast_factory.new_parent_as ($1, Void, Void, Void, Void, $2, $3)
949 }
950 | Parent_class_type Redefine Select_opt TE_END
951 {
952 $$ := ast_factory.new_parent_as ($1, Void, Void, Void, $2, $3, $4)
953 }
954 | Parent_class_type Undefine Redefine_opt Select_opt TE_END
955 {
956 $$ := ast_factory.new_parent_as ($1, Void, Void, $2, $3, $4, $5)
957 }
958 | Parent_class_type New_exports Undefine_opt Redefine_opt Select_opt TE_END
959 {
960 $$ := ast_factory.new_parent_as ($1, Void, $2, $3, $4, $5, $6)
961 }
962 | Parent_class_type Rename New_exports_opt Undefine_opt Redefine_opt Select_opt TE_END
963 {
964 $$ := ast_factory.new_parent_as ($1, $2, $3, $4, $5, $6, $7)
965 }
966 ;
967
968 Rename: TE_RENAME
969 {
970 $$ := ast_factory.new_rename_clause_as (Void, $1)
971 if is_constraint_renaming then
972 error_handler.insert_error (
973 create {SYNTAX_ERROR}.make ($1.line, $1.column, filename, "Empty rename clause.", False))
974 error_handler.raise_error
975 else
976 error_handler.insert_warning (
977 create {SYNTAX_WARNING}.make ($1.line, $1.column, filename,
978 "Remove empty rename clauses."))
979 end
980 }
981 | TE_RENAME Add_counter Rename_list Remove_counter
982 { $$ := ast_factory.new_rename_clause_as ($3, $1) }
983 ;
984
985 Rename_list: Rename_pair
986 {
987 $$ := ast_factory.new_eiffel_list_rename_as (counter_value + 1)
988 if $$ /= Void and $1 /= Void then
989 $$.reverse_extend ($1)
990 end
991 }
992 | Rename_pair TE_COMMA Increment_counter Rename_list
993 {
994 $$ := $4
995 if $$ /= Void and $1 /= Void then
996 $$.reverse_extend ($1)
997 ast_factory.reverse_extend_separator ($$, $2)
998 end
999 }
1000 ;
1001
1002 Rename_pair: Feature_name TE_AS Extended_feature_name
1003 { $$ := ast_factory.new_rename_as ($1, $3, $2) }
1004 ;
1005
1006 New_exports_opt: -- Empty
1007 -- { $$ := Void }
1008 | New_exports
1009 { $$ := $1 }
1010 ;
1011
1012 New_exports: TE_EXPORT Add_counter New_export_list Remove_counter
1013 { $$ := ast_factory.new_export_clause_as ($3, $1) }
1014 | TE_EXPORT ASemi
1015 { $$ := ast_factory.new_export_clause_as (Void, $1) }
1016 ;
1017
1018 New_export_list: New_export_item
1019 {
1020 $$ := ast_factory.new_eiffel_list_export_item_as (counter_value + 1)
1021 if $$ /= Void and $1 /= Void then
1022 $$.reverse_extend ($1)
1023 end
1024 }
1025 | New_export_item Increment_counter New_export_list
1026 {
1027 $$ := $3
1028 if $$ /= Void and $1 /= Void then
1029 $$.reverse_extend ($1)
1030 end
1031 }
1032 ;
1033
1034 New_export_item: Client_list Feature_set ASemi
1035 {
1036 $$ := ast_factory.new_export_item_as (ast_factory.new_client_as ($1), $2)
1037 }
1038 ;
1039
1040 Feature_set: -- Empty
1041 -- { $$ := Void }
1042 | TE_ALL
1043 { $$ := ast_factory.new_all_as ($1) }
1044 | Feature_list
1045 { $$ := ast_factory.new_feature_list_as ($1) }
1046 ;
1047
1048 Convert_clause: -- Empty
1049 -- { $$ := Void }
1050 | TE_CONVERT Add_counter Convert_list Remove_counter
1051 {
1052 $$ := $3
1053 if $$ /= Void then
1054 $$.set_convert_keyword ($1)
1055 end
1056 }
1057 ;
1058
1059 Convert_list: Convert_feature
1060 {
1061 $$ := ast_factory.new_eiffel_list_convert (counter_value + 1)
1062 if $$ /= Void and $1 /= Void then
1063 $$.reverse_extend ($1)
1064 end
1065 }
1066 | Convert_feature TE_COMMA Increment_counter Convert_list
1067 {
1068 $$ := $4
1069 if $$ /= Void and $1 /= Void then
1070 $$.reverse_extend ($1)
1071 ast_factory.reverse_extend_separator ($$, $2)
1072 end
1073 }
1074 ;
1075
1076
1077 Convert_feature: Feature_name TE_LPARAN TE_LCURLY Type_list TE_RCURLY TE_RPARAN
1078 {
1079 -- True because this is a conversion feature used as a creation
1080 -- procedure in current class.
1081 $$ := ast_factory.new_convert_feat_as (True, $1, $4, $2, $6, Void, $3, $5)
1082 }
1083 | Feature_name TE_COLON TE_LCURLY Type_list TE_RCURLY
1084 {
1085 -- False because this is not a conversion feature used as a creation
1086 -- procedure.
1087 $$ := ast_factory.new_convert_feat_as (False, $1, $4, Void, Void, $2, $3, $5)
1088 }
1089 ;
1090
1091 Feature_list: Add_counter Feature_list_impl Remove_counter
1092 { $$ := $2 }
1093 ;
1094
1095 Feature_list_impl: Feature_name
1096 {
1097 $$ := ast_factory.new_eiffel_list_feature_name (counter_value + 1)
1098 if $$ /= Void and $1 /= Void then
1099 $$.reverse_extend ($1)
1100 end
1101 }
1102 | Feature_name TE_COMMA Increment_counter Feature_list_impl
1103 {
1104 $$ := $4
1105 if $$ /= Void and $1 /= Void then
1106 $$.reverse_extend ($1)
1107 ast_factory.reverse_extend_separator ($$, $2)
1108 end
1109 }
1110 ;
1111
1112 Undefine_opt: -- Empty
1113 -- { $$ := Void }
1114 | Undefine
1115 { $$ := $1 }
1116 ;
1117
1118 Undefine: TE_UNDEFINE
1119 --- { $$ := Void }
1120 {
1121 $$ := ast_factory.new_undefine_clause_as (Void, $1)
1122 }
1123 | TE_UNDEFINE Feature_list
1124 {
1125 $$ := ast_factory.new_undefine_clause_as ($2, $1)
1126 }
1127 ;
1128
1129 Redefine_opt: -- Empty
1130 -- { $$ := Void }
1131 | Redefine
1132 { $$ := $1 }
1133 ;
1134
1135 Redefine: TE_REDEFINE
1136 --- { $$ := Void }
1137 {
1138 $$ := ast_factory.new_redefine_clause_as (Void, $1)
1139 }
1140 | TE_REDEFINE Feature_list
1141 {
1142 $$ := ast_factory.new_redefine_clause_as ($2, $1)
1143 }
1144 ;
1145
1146 Select_opt: -- Empty
1147 -- { $$ := Void }
1148 | Select
1149 { $$ := $1 }
1150 ;
1151
1152 Select: TE_SELECT
1153 --- { $$ := Void }
1154 {
1155 $$ := ast_factory.new_select_clause_as (Void, $1)
1156 }
1157 | TE_SELECT Feature_list
1158 {
1159 $$ := ast_factory.new_select_clause_as ($2, $1)
1160 }
1161 ;
1162
1163
1164 -- Feature declaration
1165
1166
1167 Formal_arguments: TE_LPARAN TE_RPARAN
1168 { $$ := ast_factory.new_formal_argu_dec_list_as (Void, $1, $2) }
1169 | TE_LPARAN Add_counter Entity_declaration_list Remove_counter TE_RPARAN
1170 { $$ := ast_factory.new_formal_argu_dec_list_as ($3, $1, $5) }
1171 ;
1172
1173 Entity_declaration_list: Entity_declaration_group
1174 {
1175 $$ := ast_factory.new_eiffel_list_type_dec_as (counter_value + 1)
1176 if $$ /= Void and $1 /= Void then
1177 $$.reverse_extend ($1)
1178 end
1179 }
1180 | Entity_declaration_group Increment_counter Entity_declaration_list
1181 {
1182 $$ := $3
1183 if $$ /= Void and $1 /= Void then
1184 $$.reverse_extend ($1)
1185 end
1186 }
1187 ;
1188
1189 Entity_declaration_group: Add_counter Identifier_list Remove_counter TE_COLON Type ASemi
1190 { $$ := ast_factory.new_type_dec_as ($2, $5, $4) }
1191 ;
1192
1193 Identifier_list: Identifier_as_lower
1194 {
1195 $$ := ast_factory.new_identifier_list (counter_value + 1)
1196 if $$ /= Void and $1 /= Void then
1197 $$.reverse_extend ($1.name_id)
1198 ast_factory.reverse_extend_identifier ($$.id_list, $1)
1199 end
1200 }
1201 | Identifier_as_lower TE_COMMA Increment_counter Identifier_list
1202 {
1203 $$ := $4
1204 if $$ /= Void and $1 /= Void then
1205 $$.reverse_extend ($1.name_id)
1206 ast_factory.reverse_extend_identifier ($$.id_list, $1)
1207 ast_factory.reverse_extend_separator ($$.id_list, $2)
1208 end
1209 }
1210 ;
1211
1212 Strip_identifier_list: -- Empty
1213 { $$ := ast_factory.new_identifier_list (0) }
1214 | Add_counter Identifier_list Remove_counter
1215 { $$ := $2 }
1216 ;
1217
1218 Routine:
1219 Obsolete
1220 { set_fbody_pos (position) }
1221 Precondition
1222 Local_declarations
1223 Routine_body
1224 Postcondition
1225 Rescue
1226 TE_END
1227 {
1228 if $1 /= Void then
1229 temp_string_as1 := $1.second
1230 temp_keyword_as := $1.first
1231 else
1232 temp_string_as1 := Void
1233 temp_keyword_as := Void
1234 end
1235 if $7 /= Void then
1236 $$ := ast_factory.new_routine_as (temp_string_as1, $3, $4, $5, $6, $7.second, $8, once_manifest_string_count, fbody_pos, temp_keyword_as, $7.first)
1237 else
1238 $$ := ast_factory.new_routine_as (temp_string_as1, $3, $4, $5, $6, Void, $8, once_manifest_string_count, fbody_pos, temp_keyword_as, Void)
1239 end
1240 once_manifest_string_count := 0
1241 }
1242 ;
1243
1244 Routine_body: Internal
1245 { $$ := $1 }
1246 | External
1247 { $$ := $1 }
1248 | TE_DEFERRED
1249 { $$ := $1 }
1250 ;
1251
1252 External: TE_EXTERNAL
1253 {
1254 -- To avoid warnings for manifest string used to represent external data.
1255 initial_has_old_verbatim_strings_warning := has_old_verbatim_strings_warning
1256 set_has_old_verbatim_strings_warning (false)
1257 }
1258 External_language External_name
1259 {
1260 if $3 /= Void and then $3.is_built_in then
1261 if $4 /= Void then
1262 $$ := ast_factory.new_built_in_as ($3, $4.second, $1, $4.first)
1263 else
1264 $$ := ast_factory.new_built_in_as ($3, Void, $1, Void)
1265 end
1266 elseif $4 /= Void then
1267 $$ := ast_factory.new_external_as ($3, $4.second, $1, $4.first)
1268 else
1269 $$ := ast_factory.new_external_as ($3, Void, $1, Void)
1270 end
1271 set_has_old_verbatim_strings_warning (initial_has_old_verbatim_strings_warning)
1272 }
1273 ;
1274
1275 External_language:
1276 Non_empty_string
1277 { $$ := ast_factory.new_external_lang_as ($1) }
1278 ;
1279
1280 External_name: -- Empty
1281 -- { $$ := Void }
1282 | TE_ALIAS Default_manifest_string
1283 {
1284 $$ := ast_factory.new_keyword_string_pair ($1, $2)
1285 }
1286 ;
1287
1288 Internal: TE_DO Compound
1289 { $$ := ast_factory.new_do_as ($2, $1) }
1290 | TE_ONCE Compound
1291 { $$ := ast_factory.new_once_as ($2, $1) }
1292 ;
1293
1294 Local_declarations: -- Empty
1295 -- { $$ := Void }
1296 | TE_LOCAL
1297 { $$ := ast_factory.new_local_dec_list_as (ast_factory.new_eiffel_list_type_dec_as (0), $1) }
1298 | TE_LOCAL Add_counter Entity_declaration_list Remove_counter
1299 { $$ := ast_factory.new_local_dec_list_as ($3, $1) }
1300 ;
1301
1302 Compound: Optional_semicolons
1303 -- { $$ := Void }
1304 | Optional_semicolons Add_counter Instruction_list Remove_counter
1305 { $$ := $3 }
1306 ;
1307
1308 Instruction_list: Instruction
1309 {
1310 $$ := ast_factory.new_eiffel_list_instruction_as (counter_value + 1)
1311 if $$ /= Void and $1 /= Void then
1312 $$.reverse_extend ($1)
1313 end
1314 }
1315 | Instruction Increment_counter Instruction_list
1316 {
1317 $$ := $3
1318 if $$ /= Void and $1 /= Void then
1319 $$.reverse_extend ($1)
1320 end
1321 }
1322 ;
1323
1324 Instruction: Instruction_impl Optional_semicolons
1325 {
1326 $$ := $1
1327 if $$ /= Void then
1328 $$.set_line_pragma (last_line_pragma)
1329 end
1330 }
1331 ;
1332
1333 Optional_semicolons: -- Empty
1334 | Optional_semicolons TE_SEMICOLON
1335 ;
1336
1337 Instruction_impl: Creation
1338 { $$ := $1 }
1339 | Expression
1340 {
1341 -- Call production should be used instead,
1342 -- but this complicates the grammar.
1343 if has_type then
1344 error_handler.insert_error (create {SYNTAX_ERROR}.make (line, column, filename, "Expression cannot be used as an instruction", False))
1345 error_handler.raise_error
1346 else
1347 $$ := new_call_instruction_from_expression ($1)
1348 end
1349 }
1350 | Assigner_call
1351 { $$ := $1 }
1352 | Assignment
1353 { $$ := $1 }
1354 | Reverse_assignment
1355 { $$ := $1 }
1356 | Conditional
1357 { $$ := $1 }
1358 | Multi_branch
1359 { $$ := $1 }
1360 | Loop
1361 { $$ := $1 }
1362 | Debug
1363 { $$ := $1 }
1364 | Check
1365 { $$ := $1 }
1366 | TE_RETRY
1367 { $$ := $1 }
1368 ;
1369
1370 Precondition: -- Empty
1371 -- { $$ := Void }
1372 | TE_REQUIRE
1373 { set_id_level (Assert_level) }
1374 Assertion
1375 {
1376 set_id_level (Normal_level)
1377 $$ := ast_factory.new_require_as ($3, $1)
1378 }
1379 | TE_REQUIRE TE_ELSE
1380 { set_id_level (Assert_level) }
1381 Assertion
1382 {
1383 set_id_level (Normal_level)
1384 $$ := ast_factory.new_require_else_as ($4, $1, $2)
1385 }
1386 ;
1387
1388 Postcondition: -- Empty
1389 -- { $$ := Void }
1390 | TE_ENSURE
1391 { set_id_level (Assert_level) }
1392 Assertion
1393 {
1394 set_id_level (Normal_level)
1395 $$ := ast_factory.new_ensure_as ($3, $1)
1396 }
1397 | TE_ENSURE TE_THEN
1398 { set_id_level (Assert_level) }
1399 Assertion
1400 {
1401 set_id_level (Normal_level)
1402 $$ := ast_factory.new_ensure_then_as ($4, $1, $2)
1403 }
1404 ;
1405
1406 Assertion: -- Empty
1407 -- { $$ := Void }
1408 | Add_counter Assertion_list Remove_counter
1409 {
1410 $$ := $2
1411 if $$ /= Void and then $$.is_empty then
1412 $$ := Void
1413 end
1414 }
1415 ;
1416
1417 Assertion_list: Assertion_clause
1418 {
1419 -- Special list treatment here as we do not want Void
1420 -- element in `Assertion_list'.
1421 if $1 /= Void then
1422 $$ := ast_factory.new_eiffel_list_tagged_as (counter_value + 1)
1423 if $$ /= Void then
1424 $$.reverse_extend ($1)
1425 end
1426 else
1427 $$ := ast_factory.new_eiffel_list_tagged_as (counter_value)
1428 end
1429 }
1430 | Assertion_clause
1431 {
1432 -- Only increment counter when clause is not Void.
1433 if $1 /= Void then
1434 increment_counter
1435 end
1436 }
1437 Assertion_list
1438 {
1439 $$ := $3
1440 if $$ /= Void and $1 /= Void then
1441 $$.reverse_extend ($1)
1442 end
1443 }
1444 ;
1445
1446 Assertion_clause: Expression ASemi
1447 { $$ := ast_factory.new_tagged_as (Void, $1, Void) }
1448 | Identifier_as_lower TE_COLON Expression ASemi
1449 { $$ := ast_factory.new_tagged_as ($1, $3, $2) }
1450 | Identifier_as_lower TE_COLON ASemi
1451 --- { $$ := Void }
1452 {
1453 -- Always create an object here for roundtrip parser.
1454 -- This "fake" assertion will be filtered out later.
1455 $$ := ast_factory.new_tagged_as ($1, Void, $2)
1456 }
1457 ;
1458
1459
1460 -- Type
1461
1462
1463 Type: Class_or_tuple_type
1464 { $$ := $1 }
1465 | TE_INVARIANT Class_or_tuple_type
1466 {
1467 $$ := $2
1468 ast_factory.set_monomorph_type ($$, True, $1)
1469 }
1470 | TE_FROZEN Class_or_tuple_type
1471 {
1472 $$ := $2
1473 ast_factory.set_monomorph_type ($$, True, $1)
1474 }
1475 | Non_class_type
1476 { $$ := $1 }
1477 ;
1478
1479 Type_no_id:
1480 Class_identifier Generics
1481 { $$ := new_class_type ($1, $2) }
1482 | Tuple_type
1483 { $$ := $1 }
1484 | Non_class_type
1485 { $$ := $1 }
1486 ;
1487
1488 Non_class_type: TE_EXPANDED Class_type
1489 {
1490 $$ := $2
1491 ast_factory.set_expanded_class_type ($$, True, $1)
1492 if has_syntax_warning and $2 /= Void then
1493 Error_handler.insert_warning (
1494 create {SYNTAX_WARNING}.make ($1.line, $1.column, filename,
1495 once "Make an expanded version of the base class associated with this type."))
1496 end
1497 }
1498 | TE_SEPARATE Class_or_tuple_type
1499 {
1500 last_class_type ?= $2
1501 if last_class_type /= Void then
1502 last_class_type.set_is_separate (True, $1)
1503 last_class_type := Void
1504 end
1505 $$ := $2
1506 }
1507 | TE_BIT Integer_constant
1508 { $$ := ast_factory.new_bits_as ($2, $1) }
1509 | TE_BIT Identifier_as_lower
1510 { $$ := ast_factory.new_bits_symbol_as ($2, $1) }
1511 | TE_LIKE Identifier_as_lower
1512 { $$ := ast_factory.new_like_id_as ($2, $1) }
1513 | TE_LIKE TE_CURRENT
1514 { $$ := ast_factory.new_like_current_as ($2, $1) }
1515 ;
1516
1517 Class_or_tuple_type: Class_type
1518 { $$ := $1 }
1519 | Tuple_type
1520 { $$ := $1 }
1521 ;
1522
1523 Class_type: Class_identifier Generics_opt
1524 { $$ := new_class_type ($1, $2) }
1525 ;
1526
1527 Generics_opt: -- Empty
1528 -- { $$ := Void }
1529 | Generics
1530 {
1531 $$ := $1
1532 }
1533 ;
1534
1535 Generics: TE_LSQURE Generic_type_list TE_RSQURE
1536 {
1537 $$ := $2
1538 if $$ /= Void then
1539 $$.set_positions ($1, $3)
1540 end
1541 }
1542 | TE_LSQURE TE_RSQURE
1543 {
1544 $$ := ast_factory.new_eiffel_list_type (0)
1545 if $$ /= Void then
1546 $$.set_positions ($1, $2)
1547 end
1548 }
1549 ;
1550
1551 Type_list: Add_counter Type_list_impl Remove_counter
1552 { $$ := $2 }
1553 ;
1554
1555 Type_list_impl: Type
1556 {
1557 $$ := ast_factory.new_eiffel_list_type (counter_value + 1)
1558 if $$ /= Void and $1 /= Void then
1559 $$.reverse_extend ($1)
1560 end
1561 }
1562 | Type TE_COMMA Increment_counter Type_list_impl
1563 {
1564 $$ := $4
1565 if $$ /= Void and $1 /= Void then
1566 $$.reverse_extend ($1)
1567 ast_factory.reverse_extend_separator ($$, $2)
1568 end
1569 }
1570 ;
1571
1572 Generic_type_list: Add_counter Generic_type_list_impl Remove_counter
1573 { $$ := $2 }
1574 ;
1575
1576 Generic_type_list_impl: Actual_generic_type
1577 {
1578 $$ := ast_factory.new_eiffel_list_type (counter_value + 1)
1579 if $$ /= Void and then $1 /= Void then
1580 $$.reverse_extend ($1)
1581 end
1582 }
1583 | Actual_generic_type TE_COMMA Increment_counter Generic_type_list_impl
1584 {
1585 $$ := $4
1586 if $$ /= Void and then $1 /= Void then
1587 $$.reverse_extend ($1)
1588 ast_factory.reverse_extend_separator ($$, $2)
1589 end
1590 }
1591 ;
1592
1593 Actual_generic_type: Type
1594 {
1595 $$ := $1
1596 }
1597 | TE_VARIANT Type
1598 {
1599 $$ := $2
1600 $$.set_covariant_keyword ($1)
1601 }
1602 ;
1603
1604
1605 Tuple_type: TE_TUPLE
1606 { $$ := ast_factory.new_class_type_as ($1, Void) }
1607 | TE_TUPLE Add_counter Add_counter2 TE_LSQURE TE_RSQURE
1608 {
1609 last_type_list := ast_factory.new_eiffel_list_type (0)
1610 if last_type_list /= Void then
1611 last_type_list.set_positions ($4, $5)
1612 end
1613 $$ := ast_factory.new_class_type_as ($1, last_type_list)
1614 last_type_list := Void
1615 remove_counter
1616 remove_counter2
1617 }
1618 | TE_TUPLE Add_counter Add_counter2 TE_LSQURE Actual_parameter_list
1619 {
1620 if $5 /= Void then
1621 $5.set_positions ($4, last_rsqure.item)
1622 end
1623 $$ := ast_factory.new_class_type_as ($1, $5)
1624 last_rsqure.remove
1625 remove_counter
1626 remove_counter2
1627 }
1628 | TE_TUPLE Add_counter Add_counter2 TE_LSQURE Named_parameter_list
1629 {
1630 $$ := ast_factory.new_named_tuple_type_as (
1631 $1, ast_factory.new_formal_argu_dec_list_as ($5, $4, last_rsqure.item))
1632 last_rsqure.remove
1633 remove_counter
1634 remove_counter2
1635 }
1636 ;
1637
1638 Actual_parameter_list: Type TE_RSQURE
1639 {
1640 $$ := ast_factory.new_eiffel_list_type (counter_value + 1)
1641 if $$ /= Void and $1 /= Void then
1642 $$.reverse_extend ($1)
1643 end
1644 last_rsqure.force ($2)
1645 }
1646 | TE_ID TE_COMMA Increment_counter Actual_parameter_list
1647 {
1648 $$ := $4
1649 if $$ /= Void and $1 /= Void then
1650 $1.to_upper
1651 $$.reverse_extend (new_class_type ($1, Void))
1652 ast_factory.reverse_extend_separator ($$, $2)
1653 end
1654 }
1655 | Type_no_id TE_COMMA Increment_counter Actual_Parameter_List
1656 {
1657 $$ := $4
1658 if $$ /= Void and $1 /= Void then
1659 $$.reverse_extend ($1)
1660 ast_factory.reverse_extend_separator ($$, $2)
1661 end
1662 }
1663 ;
1664
1665 Named_parameter_list: TE_ID TE_COLON Type TE_RSQURE
1666 {
1667 $$ := ast_factory.new_eiffel_list_type_dec_as (counter2_value + 1)
1668 last_identifier_list := ast_factory.new_identifier_list (counter_value + 1)
1669
1670 if $$ /= Void and last_identifier_list /= Void and $1 /= Void then
1671 $1.to_lower
1672 last_identifier_list.reverse_extend ($1.name_id)
1673 ast_factory.reverse_extend_identifier (last_identifier_list.id_list, $1)
1674 end
1675 $$.reverse_extend (ast_factory.new_type_dec_as (last_identifier_list, $3, $2))
1676 last_identifier_list := Void
1677 last_rsqure.force ($4)
1678 }
1679 | TE_ID TE_COMMA Increment_counter Named_parameter_list
1680
1681 {
1682 $$ := $4
1683 if $$ /= Void then
1684 last_identifier_list := $$.reversed_first.id_list
1685 if last_identifier_list /= Void then
1686 $1.to_lower
1687 last_identifier_list.reverse_extend ($1.name_id)
1688 ast_factory.reverse_extend_identifier (last_identifier_list.id_list, $1)
1689 ast_factory.reverse_extend_separator (last_identifier_list.id_list, $2)
1690 end
1691 last_identifier_list := Void
1692 end
1693 }
1694 | TE_ID TE_COLON Type ASemi Increment_counter2 Add_counter Named_parameter_list
1695 {
1696 remove_counter
1697 $$ := $7
1698 last_identifier_list := ast_factory.new_identifier_list (counter_value + 1)
1699
1700 if $$ /= Void and $1 /= Void and $3 /= Void and last_identifier_list /= Void then
1701 $1.to_lower
1702 last_identifier_list.reverse_extend ($1.name_id)
1703 ast_factory.reverse_extend_identifier (last_identifier_list.id_list, $1)
1704
1705 $$.reverse_extend (ast_factory.new_type_dec_as (last_identifier_list, $3, $2))
1706 end
1707 last_identifier_list := Void
1708 }
1709 ;
1710
1711
1712 -- Formal generics
1713
1714 Formal_generics:
1715 {
1716 -- $$ := Void
1717 formal_generics_end_position := 0
1718 }
1719 | TE_LSQURE TE_RSQURE
1720 {
1721 formal_generics_end_position := position
1722 --- $$ := Void
1723 $$ := ast_factory.new_eiffel_list_formal_dec_as (0)
1724 if $$ /= Void then
1725 $$.set_squre_symbols ($1, $2)
1726 end
1727 }
1728 | TE_LSQURE Add_counter Disable_supplier_recording Formal_generic_list Enable_supplier_recording Remove_counter TE_RSQURE
1729 {
1730 formal_generics_end_position := position
1731 $$ := $4
1732 $$.transform_class_types_to_formals_and_record_suppliers (ast_factory, suppliers, formal_parameters)
1733 if $$ /= Void then
1734 $$.set_squre_symbols ($1, $7)
1735 end
1736 }
1737 ;
1738
1739 Formal_generic_list: Formal_generic
1740 {
1741 $$ := ast_factory.new_eiffel_list_formal_dec_as (counter_value + 1)
1742 if $$ /= Void and $1 /= Void then
1743 $$.reverse_extend ($1)
1744 end
1745 }
1746 | Formal_generic TE_COMMA Increment_counter Formal_generic_list
1747 {
1748 $$ := $4
1749 if $$ /= Void and $1 /= Void then
1750 $$.reverse_extend ($1)
1751 ast_factory.reverse_extend_separator ($$, $2)
1752 end
1753 }
1754 ;
1755
1756 Formal_parameter: TE_REFERENCE Class_identifier
1757 {
1758 if $2 /= Void and then none_class_name_id = $2.name_id then
1759 -- Trigger an error when constraint is NONE.
1760 -- Needs to be done manually since current test for
1761 -- checking that `$2' is not a class name
1762 -- will fail for NONE, whereas before there were some
1763 -- syntactic conflict since `NONE' was a keyword and
1764 -- therefore not part of `TE_ID'.
1765 raise_error
1766 else
1767 $$ := ast_factory.new_formal_as ($2, True, False, False, $1)
1768 end
1769 }
1770 | TE_EXPANDED Class_identifier
1771 {
1772 if $2 /= Void and then none_class_name_id = $2.name_id then
1773 -- Trigger an error when constraint is NONE.
1774 -- Needs to be done manually since current test for
1775 -- checking that `$2' is not a class name
1776 -- will fail for NONE, whereas before there were some
1777 -- syntactic conflict since `NONE' was a keyword and
1778 -- therefore not part of `TE_ID'.
1779 raise_error
1780 else
1781 $$ := ast_factory.new_formal_as ($2, False, True, False, $1)
1782 end
1783 }
1784 | TE_FROZEN Class_identifier
1785 {
1786 if $2 /= Void and then none_class_name_id = $2.name_id then
1787 -- Trigger an error when constraint is NONE.
1788 -- Needs to be done manually since current test for
1789 -- checking that `$2' is not a class name
1790 -- will fail for NONE, whereas before there were some
1791 -- syntactic conflict since `NONE' was a keyword and
1792 -- therefore not part of `TE_ID'.
1793 raise_error
1794 else
1795 $$ := ast_factory.new_formal_as ($2, False, False, True, $1)
1796 end
1797 }
1798
1799 | TE_INVARIANT Class_identifier
1800 {
1801 if $2 /= Void and then none_class_name_id = $2.name_id then
1802 -- Trigger an error when constraint is NONE.
1803 -- Needs to be done manually since current test for
1804 -- checking that `$2' is not a class name
1805 -- will fail for NONE, whereas before there were some
1806 -- syntactic conflict since `NONE' was a keyword and
1807 -- therefore not part of `TE_ID'.
1808 raise_error
1809 else
1810 $$ := ast_factory.new_formal_as ($2, False, False, True, $1)
1811 end
1812 }
1813
1814
1815
1816 | Class_identifier
1817 {
1818 if $1 /= Void and then none_class_name_id = $1.name_id then
1819 -- Trigger an error when constraint is NONE.
1820 -- Needs to be done manually since current test for
1821 -- checking that `$1' is not a class name
1822 -- will fail for NONE, whereas before there were some
1823 -- syntactic conflict since `NONE' was a keyword and
1824 -- therefore not part of `TE_ID'.
1825 raise_error
1826 else
1827 $$ := ast_factory.new_formal_as ($1, False, False, False, Void)
1828 end
1829 }
1830 ;
1831
1832 Formal_generic: Formal_parameter
1833 {
1834 if $1 /= Void then
1835 -- Needs to be done here, in case current formal is used in
1836 -- Constraint.
1837 formal_parameters.extend ($1)
1838 $1.set_position (formal_parameters.count)
1839 end
1840 }
1841 Constraint
1842 {
1843 if $3 /= Void then
1844 if $3.creation_constrain /= Void then
1845 $$ := ast_factory.new_formal_dec_as ($1, $3.type, $3.creation_constrain.feature_list, $3.constrain_symbol, $3.creation_constrain.create_keyword, $3.creation_constrain.end_keyword)
1846 else
1847 $$ := ast_factory.new_formal_dec_as ($1, $3.type, Void, $3.constrain_symbol, Void, Void)
1848 end
1849 else
1850 $$ := ast_factory.new_formal_dec_as ($1, Void, Void, Void, Void, Void)
1851 end
1852 }
1853 ;
1854
1855 Constraint: -- Empty
1856 -- { $$ := Void }
1857 | TE_CONSTRAIN Single_constraint Creation_constraint
1858 {
1859 constraining_type_list := ast_factory.new_eiffel_list_constraining_type_as (1)
1860 if $1 /= Void then
1861 constraining_type_list.reverse_extend ($2)
1862 end
1863
1864 $$ := ast_factory.new_constraint_triple ($1, constraining_type_list, $3)
1865 }
1866 | TE_CONSTRAIN TE_LCURLY Add_counter Multiple_constraint_list Remove_counter TE_RCURLY Creation_constraint
1867 {
1868 $$ := ast_factory.new_constraint_triple ($1, $4, $7)
1869 }
1870 ;
1871
1872 Single_constraint: -- Empty
1873 -- { $$ := Void }
1874 | Constraint_type {is_constraint_renaming := True} Rename {is_constraint_renaming := False} TE_END
1875 {
1876 $$ := ast_factory.new_constraining_type ($1, $3, $5)
1877 }
1878 | Constraint_type
1879 {
1880 $$ := ast_factory.new_constraining_type ($1, Void, Void)
1881 }
1882 ;
1883
1884 Constraint_type:
1885 Class_or_tuple_type
1886 { $$ := $1 }
1887 | TE_LIKE Identifier_as_lower
1888 {
1889 error_handler.insert_error (ast_factory.new_vtgc1_error (line, column, filename, $2, Void))
1890 error_handler.raise_error
1891 }
1892 | TE_LIKE TE_CURRENT
1893 {
1894 error_handler.insert_error (ast_factory.new_vtgc1_error (line, column, filename, Void, $2))
1895 error_handler.raise_error
1896 }
1897 ;
1898
1899 Multiple_constraint_list: Single_constraint
1900 {
1901 $$ := ast_factory.new_eiffel_list_constraining_type_as (counter_value + 1)
1902 if $$ /= Void and $1 /= Void then
1903 $$.reverse_extend ($1)
1904 end
1905 }
1906 | Single_constraint TE_COMMA Increment_counter Multiple_constraint_list
1907 {
1908 $$ := $4
1909 if $$ /= Void and $1 /= Void then
1910 $$.reverse_extend ($1)
1911 ast_factory.reverse_extend_separator ($$, $2)
1912 end
1913
1914 -- error_handler.insert_error (ast_factory.new_vtgc1_error (line, column, filename, Void, $2))
1915 -- error_handler.raise_error
1916
1917 }
1918 ;
1919
1920 Creation_constraint: -- Empty
1921 -- { $$ := Void }
1922 | TE_CREATE Feature_list TE_END
1923 {
1924 $$ := ast_factory.new_creation_constrain_triple ($2, $1, $3)
1925 }
1926 ;
1927
1928
1929 -- Instructions
1930
1931
1932 Conditional: TE_IF Expression TE_THEN Compound TE_END
1933 { $$ := ast_factory.new_if_as ($2, $4, Void, Void, $5, $1, $3, Void) }
1934 | TE_IF Expression TE_THEN Compound Else_part TE_END
1935 {
1936 if $5 /= Void then
1937 $$ := ast_factory.new_if_as ($2, $4, Void, $5.second, $6, $1, $3, $5.first)
1938 else
1939 $$ := ast_factory.new_if_as ($2, $4, Void, Void, $6, $1, $3, Void)
1940
1941 end
1942 }
1943 | TE_IF Expression TE_THEN Compound Elseif_list TE_END
1944 { $$ := ast_factory.new_if_as ($2, $4, $5, Void, $6, $1, $3, Void) }
1945 | TE_IF Expression TE_THEN Compound Elseif_list Else_part TE_END
1946 {
1947 if $6 /= Void then
1948 $$ := ast_factory.new_if_as ($2, $4, $5, $6.second, $7, $1, $3, $6.first)
1949 else
1950 $$ := ast_factory.new_if_as ($2, $4, $5, Void, $7, $1, $3, Void)
1951 end
1952 }
1953 ;
1954
1955 Elseif_list: Add_counter Elseif_part_list Remove_counter
1956 { $$ := $2 }
1957 ;
1958
1959 Elseif_part_list: Elseif_part
1960 {
1961 $$ := ast_factory.new_eiffel_list_elseif_as (counter_value + 1)
1962 if $$ /= Void and $1 /= Void then
1963 $$.reverse_extend ($1)
1964 end
1965 }
1966 | Elseif_part Increment_counter Elseif_part_list
1967 {
1968 $$ := $3
1969 if $$ /= Void and $1 /= Void then
1970 $$.reverse_extend ($1)
1971 end
1972 }
1973 ;
1974
1975 Elseif_part: TE_ELSEIF Expression TE_THEN Compound
1976 { $$ := ast_factory.new_elseif_as ($2, $4, $1, $3) }
1977 ;
1978
1979 Else_part: TE_ELSE Compound
1980 { $$ := ast_factory.new_keyword_instruction_list_pair ($1, $2) }
1981 ;
1982
1983 Multi_branch: TE_INSPECT Expression When_part_list_opt TE_END
1984 { $$ := ast_factory.new_inspect_as ($2, $3, Void, $4, $1, Void) }
1985 | TE_INSPECT Expression When_part_list_opt TE_ELSE Compound TE_END
1986 {
1987 if $5 /= Void then
1988 $$ := ast_factory.new_inspect_as ($2, $3, $5, $6, $1, $4)
1989 else
1990 $$ := ast_factory.new_inspect_as ($2, $3,
1991 ast_factory.new_eiffel_list_instruction_as (0), $6, $1, $4)
1992 end
1993 }
1994 ;
1995
1996 When_part_list_opt: -- Empty
1997 -- { $$ := Void }
1998 | Add_counter When_part_list Remove_counter
1999 { $$ := $2 }
2000 ;
2001
2002 When_part_list: When_part
2003 {
2004 $$ := ast_factory.new_eiffel_list_case_as (counter_value + 1)
2005 if $$ /= Void and $1 /= Void then
2006 $$.reverse_extend ($1)
2007 end
2008 }
2009 | When_part Increment_counter When_part_list
2010 {
2011 $$ := $3
2012 if $$ /= Void and $1 /= Void then
2013 $$.reverse_extend ($1)
2014 end
2015 }
2016 ;
2017
2018 When_part: TE_WHEN Add_counter Choices Remove_counter TE_THEN Compound
2019 { $$ := ast_factory.new_case_as ($3, $6, $1, $5) }
2020 ;
2021
2022 Choices: Choice
2023 {
2024 $$ := ast_factory.new_eiffel_list_interval_as (counter_value + 1)
2025 if $$ /= Void and $1 /= Void then
2026 $$.reverse_extend ($1)
2027 end
2028 }
2029 | Choice TE_COMMA Increment_counter Choices
2030 {
2031 $$ := $4
2032 if $$ /= Void and $1 /= Void then
2033 $$.reverse_extend ($1)
2034 ast_factory.reverse_extend_separator ($$, $2)
2035 end
2036 }
2037 ;
2038
2039 Choice: Integer_constant
2040 { $$ := ast_factory.new_interval_as ($1, Void, Void) }
2041 | Integer_constant TE_DOTDOT Integer_constant
2042 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2043 | Character_constant
2044 { $$ := ast_factory.new_interval_as ($1, Void, Void) }
2045 | Character_constant TE_DOTDOT Character_constant
2046 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2047 | Identifier_as_lower
2048 { $$ := ast_factory.new_interval_as ($1, Void, Void) }
2049 | Identifier_as_lower TE_DOTDOT Identifier_as_lower
2050 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2051 | Identifier_as_lower TE_DOTDOT Integer_constant
2052 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2053 | Integer_constant TE_DOTDOT Identifier_as_lower
2054 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2055 | Identifier_as_lower TE_DOTDOT Character_constant
2056 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2057 | Character_constant TE_DOTDOT Identifier_as_lower
2058 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2059 | A_static_call
2060 { $$ := ast_factory.new_interval_as ($1, Void, Void) }
2061 | A_static_call TE_DOTDOT Identifier_as_lower
2062 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2063 | Identifier_as_lower TE_DOTDOT A_static_call
2064 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2065 | A_static_call TE_DOTDOT A_static_call
2066 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2067 | A_static_call TE_DOTDOT Integer_constant
2068 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2069 | Integer_constant TE_DOTDOT A_static_call
2070 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2071 | A_static_call TE_DOTDOT Character_constant
2072 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2073 | Character_constant TE_DOTDOT A_static_call
2074 { $$ := ast_factory.new_interval_as ($1, $3, $2) }
2075
2076 ;
2077
2078 Loop: TE_FROM Compound Invariant Variant TE_UNTIL Expression TE_LOOP Compound TE_END
2079 {
2080 if $3 /= Void then
2081 $$ := ast_factory.new_loop_as ($2, $3.second, $4, $6, $8, $9, $1, $3.first, $5, $7)
2082 else
2083 $$ := ast_factory.new_loop_as ($2, Void, $4, $6, $8, $9, $1, Void, $5, $7)
2084 end
2085 }
2086 ;
2087
2088 Invariant: -- Empty
2089 -- { $$ := Void }
2090 | TE_INVARIANT Assertion
2091 { $$ := ast_factory.new_invariant_pair ($1, $2) }
2092 ;
2093
2094 Class_invariant: -- Empty
2095 -- { $$ := Void }
2096 | TE_INVARIANT
2097 { set_id_level (Invariant_level) }
2098 Assertion
2099 {
2100 set_id_level (Normal_level)
2101 $$ := ast_factory.new_invariant_as ($3, once_manifest_string_count, $1)
2102 once_manifest_string_count := 0
2103 }
2104 ;
2105
2106 Variant: -- Empty
2107 -- { $$ := Void }
2108 | TE_VARIANT Identifier_as_lower TE_COLON Expression
2109 { $$ := ast_factory.new_variant_as ($2, $4, $1, $3) }
2110 | TE_VARIANT Expression
2111 { $$ := ast_factory.new_variant_as (Void, $2, $1, Void) }
2112 ;
2113
2114 Debug: TE_DEBUG Debug_keys Compound TE_END
2115 { $$ := ast_factory.new_debug_as ($2, $3, $1, $4) }
2116 ;
2117
2118 Debug_keys: -- Empty
2119 -- { $$ := Void }
2120 | TE_LPARAN TE_RPARAN
2121 { $$ := ast_factory.new_debug_key_list_as (Void, $1, $2) }
2122 | TE_LPARAN Add_counter String_list Remove_counter TE_RPARAN
2123 { $$ := ast_factory.new_debug_key_list_as ($3, $1, $5) }
2124 ;
2125
2126 String_list: Non_empty_string
2127 {
2128 $$ := ast_factory.new_eiffel_list_string_as (counter_value + 1)
2129 if $$ /= Void and $1 /= Void then
2130 $$.reverse_extend ($1)
2131 end
2132 }
2133 | Non_empty_string TE_COMMA Increment_counter String_list
2134 {
2135 $$ := $4
2136 if $$ /= Void and $1 /= Void then
2137 $$.reverse_extend ($1)
2138 ast_factory.reverse_extend_separator ($$, $2)
2139 end
2140 }
2141 ;
2142
2143 Rescue: -- Empty
2144 -- { $$ := Void }
2145 | TE_RESCUE Compound
2146 {
2147 if $2 = Void then
2148 $$ := ast_factory.new_keyword_instruction_list_pair ($1, ast_factory.new_eiffel_list_instruction_as (0))
2149 else
2150 $$ := ast_factory.new_keyword_instruction_list_pair ($1, $2)
2151 end
2152 }
2153 ;
2154
2155 Qualified_expression:
2156 Qualified_binary_expression
2157 { $$ := $1 }
2158 | Qualified_factor
2159 { $$ := $1 }
2160 | Qualified_call
2161 { $$ := ast_factory.new_expr_call_as ($1) }
2162 | A_static_call
2163 { $$ := $1 }
2164 ;
2165
2166 Assigner_call: Qualified_expression TE_ASSIGNMENT Expression
2167 { $$ := ast_factory.new_assigner_call_as ($1, $3, $2) }
2168 ;
2169
2170 Assignment: Identifier_as_lower TE_ASSIGNMENT Expression
2171 { $$ := ast_factory.new_assign_as (ast_factory.new_access_id_as ($1, Void), $3, $2) }
2172 | TE_RESULT TE_ASSIGNMENT Expression
2173 { $$ := ast_factory.new_assign_as ($1, $3, $2) }
2174 ;
2175
2176 Reverse_assignment: Identifier_as_lower TE_ACCEPT Expression
2177 { $$ := ast_factory.new_reverse_as (ast_factory.new_access_id_as ($1, Void), $3, $2) }
2178 | TE_RESULT TE_ACCEPT Expression
2179 { $$ := ast_factory.new_reverse_as ($1, $3, $2) }
2180 ;
2181
2182 Creators: -- Empty
2183 -- { $$ := Void }
2184 | Add_counter Creation_clause_list Remove_counter
2185 { $$ := $2 }
2186 ;
2187
2188 Creation_clause_list: Creation_clause
2189 {
2190 $$ := ast_factory.new_eiffel_list_create_as (counter_value + 1)
2191 if $$ /= Void and $1 /= Void then
2192 $$.reverse_extend ($1)
2193 end
2194 }
2195 | Creation_clause Increment_counter Creation_clause_list
2196 {
2197 $$ := $3
2198 if $$ /= Void and $1 /= Void then
2199 $$.reverse_extend ($1)
2200 end
2201 }
2202 ;
2203
2204 Creation_clause:
2205 TE_CREATE
2206 {
2207 $$ := ast_factory.new_create_as (Void, Void, $1)
2208 }
2209 | TE_CREATE Clients Feature_list
2210 {
2211 $$ := ast_factory.new_create_as ($2, $3, $1)
2212 }
2213 | TE_CREATE Client_list
2214 {
2215 $$ := ast_factory.new_create_as (ast_factory.new_client_as ($2), Void, $1)
2216 }
2217 | TE_CREATION
2218 {
2219 $$ := ast_factory.new_create_as (Void, Void, $1)
2220 if has_syntax_warning and $1 /= Void then
2221 Error_handler.insert_warning (
2222 create {SYNTAX_WARNING}.make ($1.line, $1.column, filename,
2223 once "Use keyword `create' instead."))
2224 end
2225 }
2226 | TE_CREATION Clients Feature_list
2227 {
2228 $$ := ast_factory.new_create_as ($2, $3, $1)
2229 if has_syntax_warning and $1 /= Void then
2230 Error_handler.insert_warning (
2231 create {SYNTAX_WARNING}.make ($1.line, $1.column, filename,
2232 once "Use keyword `create' instead."))
2233 end
2234 }
2235 | TE_CREATION Client_list
2236 {
2237 $$ := ast_factory.new_create_as (ast_factory.new_client_as ($2), Void, $1)
2238 if has_syntax_warning and $1 /= Void then
2239 Error_handler.insert_warning (
2240 create {SYNTAX_WARNING}.make ($1.line, $1.column, filename,
2241 once "Use keyword `create' instead."))
2242 end
2243 }
2244 ;
2245
2246 Agent_call:
2247 TE_AGENT Optional_formal_arguments Type_mark {add_feature_frame} Optional_attribute_or_routine {remove_feature_frame} Delayed_actuals
2248 {
2249 if $3 /= Void then
2250 last_type := $3.second
2251 last_symbol := $3.first
2252 else
2253 last_type := Void
2254 last_symbol := Void
2255 end
2256
2257 $$ := ast_factory.new_inline_agent_creation_as (
2258 ast_factory.new_body_as ($2, last_type, Void, $5, last_symbol, Void, Void, Void), $7, $1)
2259 }
2260 |
2261 TE_AGENT Feature_name_for_call Delayed_actuals
2262 {
2263 $$ := ast_factory.new_agent_routine_creation_as (
2264 Void, $2, $3, False, $1, Void)
2265 }
2266 |
2267 TE_AGENT Agent_target TE_DOT Feature_name_for_call Delayed_actuals
2268 {
2269 if $2 /= Void then
2270 $$ := ast_factory.new_agent_routine_creation_as ($2.operand, $4, $5, True, $1, $3)
2271 if $$ /= Void then
2272 $$.set_lparan_symbol ($2.lparan_symbol)
2273 $$.set_rparan_symbol ($2.rparan_symbol)
2274 end
2275 else
2276 $$ := ast_factory.new_agent_routine_creation_as (Void, $4, $5, True, $1, $3)
2277 end
2278 }
2279 | Tilda_agent_call
2280 {
2281 if $1 /= Void then
2282 $$ := $1.first
2283 if has_syntax_warning and $1.second /= Void then
2284 Error_handler.insert_warning (
2285 create {SYNTAX_WARNING}.make ($1.second.line,
2286 $1.second.column, filename, once "Use keyword `agent' instead."))
2287 end
2288 end
2289 }
2290 ;
2291
2292 Optional_formal_arguments:
2293 | Formal_arguments
2294 {
2295 $$ := $1
2296 }
2297 ;
2298
2299 Type_mark:
2300 | TE_COLON Type
2301 {
2302 create $$.make ($1, $2)
2303 }
2304 ;
2305
2306 Optional_attribute_or_routine:
2307 Routine
2308 {
2309 $$ := $1
2310 }
2311 ;
2312
2313 --Note: Manu 02/07/2004: we need to expand `Agent_target' otherwise it causes some
2314 -- Reduce/Reduce conflict. `Tilda_agent_call' should be written as:
2315 --Tilda_agent_call: TE_TILDE Identifier_as_lower Delayed_actuals
2316 -- { $$ := ast_factory.new_old_routine_creation_as ($2, ast_factory.new_operand_as (Void, Void, Void), $2, $3, False) }
2317 -- | Agent_targt TE_TILDE Identifier_as_lower Delayed_actuals
2318 -- { $$ := ast_factory.new_old_routine_creation_as ($3, $1, $3, $4, True) }
2319 -- ;
2320 Tilda_agent_call: TE_TILDE Identifier_as_lower Delayed_actuals
2321 {
2322 $$ := ast_factory.new_old_routine_creation_as ($2, Void, $2, $3, False, $1)
2323 }
2324 | Identifier_as_lower TE_TILDE Identifier_as_lower Delayed_actuals
2325 {
2326 $$ := ast_factory.new_old_routine_creation_as ($1, ast_factory.new_operand_as (Void, ast_factory.new_access_id_as ($1, Void), Void), $3, $4, True, $2)
2327 }
2328 | TE_LPARAN Expression TE_RPARAN TE_TILDE Identifier_as_lower Delayed_actuals
2329 {
2330 $$ := ast_factory.new_old_routine_creation_as ($2, ast_factory.new_operand_as (Void, Void, $2), $5, $6, True, $4)
2331 if $$ /= Void and then $$.first /= Void then
2332 $$.first.set_lparan_symbol ($1)
2333 $$.first.set_rparan_symbol ($3)
2334 end
2335 }
2336 | TE_RESULT TE_TILDE Identifier_as_lower Delayed_actuals
2337 {
2338 $$ := ast_factory.new_old_routine_creation_as ($3, ast_factory.new_operand_as (Void, $1, Void), $3, $4, True, $2)
2339 }
2340 | TE_CURRENT TE_TILDE Identifier_as_lower Delayed_actuals
2341 {
2342 $$ := ast_factory.new_old_routine_creation_as ($3, ast_factory.new_operand_as (Void, $1, Void), $3, $4, True, $2)
2343 }
2344 | TE_LCURLY Type TE_CURLYTILDE Identifier_as_lower Delayed_actuals
2345 {
2346 if $2 /= Void then
2347 $2.set_lcurly_symbol ($1)
2348 end
2349 $$ := ast_factory.new_old_routine_creation_as ($2, ast_factory.new_operand_as ($2, Void, Void), $4, $5, True, $3)
2350 }
2351 | TE_QUESTION TE_TILDE Identifier_as_lower Delayed_actuals
2352 {
2353 temp_operand_as := ast_factory.new_operand_as (Void, Void, Void)
2354 if temp_operand_as /= Void then
2355 temp_operand_as.set_question_mark_symbol ($1)
2356 end
2357 $$ := ast_factory.new_old_routine_creation_as ($3, temp_operand_as, $3, $4, True, $2)
2358 }
2359 ;
2360
2361 Agent_target: Identifier_as_lower
2362 { $$ := ast_factory.new_agent_target_triple (Void, Void, ast_factory.new_operand_as (Void, ast_factory.new_access_id_as ($1, Void), Void)) }
2363 | TE_LPARAN Add_counter Add_counter Expression Remove_counter Remove_counter TE_RPARAN
2364 { $$ := ast_factory.new_agent_target_triple ($1, $7, ast_factory.new_operand_as (Void, Void, $4)) }
2365 | TE_RESULT
2366 { $$ := ast_factory.new_agent_target_triple (Void, Void, ast_factory.new_operand_as (Void, $1, Void)) }
2367 | TE_CURRENT
2368 { $$ := ast_factory.new_agent_target_triple (Void, Void, ast_factory.new_operand_as (Void, $1, Void)) }
2369 | Typed
2370 { $$ := ast_factory.new_agent_target_triple (Void, Void, ast_factory.new_operand_as ($1, Void, Void))}
2371 | TE_QUESTION
2372 {
2373 temp_operand_as := ast_factory.new_operand_as (Void, Void, Void)
2374 if temp_operand_as /= Void then
2375 temp_operand_as.set_question_mark_symbol ($1)
2376 end
2377 $$ := ast_factory.new_agent_target_triple (Void, Void, temp_operand_as)
2378 }
2379 ;
2380
2381 Delayed_actuals: -- Empty
2382 -- { $$ := Void }
2383 | TE_LPARAN TE_RPARAN
2384 { $$ := ast_factory.new_delayed_actual_list_as (Void, $1, $2) }
2385 | TE_LPARAN Add_counter Delayed_actual_list Remove_counter TE_RPARAN
2386 { $$ := ast_factory.new_delayed_actual_list_as ($3, $1, $5) }
2387 ;
2388
2389 Delayed_actual_list: Delayed_actual
2390 {
2391 $$ := ast_factory.new_eiffel_list_operand_as (counter_value + 1)
2392 if $$ /= Void and $1 /= Void then
2393 $$.reverse_extend ($1)
2394 end
2395 }
2396 | Delayed_actual TE_COMMA Increment_counter Delayed_actual_list
2397 {
2398 $$ := $4
2399 if $$ /= Void and $1 /= Void then
2400 $$.reverse_extend ($1)
2401 ast_factory.reverse_extend_separator ($$, $2)
2402 end
2403 }
2404 ;
2405
2406 Delayed_actual: TE_QUESTION
2407 { $$ := ast_factory.new_operand_as (Void, Void, Void)
2408 if $$ /= Void then
2409 $$.set_question_mark_symbol ($1)
2410 end
2411 }
2412 -- Manu: 01/19/2005: Due to syntax ambiguity we cannot have `Typed' only
2413 -- as there will be no way to distinguish it from a Manifest type expression.
2414 -- To preserve this feature in case it is needed by some of our customers
2415 -- we have invented the new syntax ? Typed.
2416 | Typed TE_QUESTION
2417 { $$ := ast_factory.new_operand_as ($1, Void, Void)
2418 if $$ /= Void then
2419 $$.set_question_mark_symbol ($2)
2420 end
2421 }
2422 | Expression
2423 { $$ := ast_factory.new_operand_as (Void, Void, $1) }
2424 ;
2425
2426 Creation: TE_BANG TE_BANG Creation_target Creation_call
2427 {
2428 $$ := ast_factory.new_bang_creation_as (Void, $3, $4, $1, $2)
2429 if has_syntax_warning and $3 /= Void then
2430 Error_handler.insert_warning (
2431 create {SYNTAX_WARNING}.make ($3.start_location.line,
2432 $3.start_location.column, filename, "Use keyword `create' instead."))
2433 end
2434 }
2435 | TE_BANG Type TE_BANG Creation_target Creation_call
2436 {
2437 $$ := ast_factory.new_bang_creation_as ($2, $4, $5, $1, $3)
2438 if has_syntax_warning and $4 /= Void then
2439 Error_handler.insert_warning (
2440 create {SYNTAX_WARNING}.make ($4.start_location.line,
2441 $4.start_location.column, filename, "Use keyword `create' instead."))
2442 end
2443 }
2444 | TE_CREATE Creation_target Creation_call
2445 { $$ := ast_factory.new_create_creation_as (Void, $2, $3, $1) }
2446 | TE_CREATE Typed Creation_target Creation_call
2447 { $$ := ast_factory.new_create_creation_as ($2, $3, $4, $1) }
2448 ;
2449
2450 Creation_expression: TE_CREATE Typed Creation_call
2451 { $$ := ast_factory.new_create_creation_expr_as ($2, $3, $1) }
2452 | TE_BANG Type TE_BANG Creation_call
2453 {
2454 $$ := ast_factory.new_bang_creation_expr_as ($2, $4, $1, $3)
2455 if has_syntax_warning and $2 /= Void then
2456 Error_handler.insert_warning (
2457 create {SYNTAX_WARNING}.make ($2.start_location.line,
2458 $2.start_location.column, filename, "Use keyword `create' instead."))
2459 end
2460 }
2461 ;
2462
2463 Creation_target: Identifier_as_lower
2464 { $$ := ast_factory.new_access_id_as ($1, Void) }
2465 | TE_RESULT
2466 { $$ := $1 }
2467 ;
2468
2469 Creation_call: -- Empty
2470 -- { $$ := Void }
2471 | TE_DOT Identifier_as_lower Parameters
2472 { $$ := ast_factory.new_access_inv_as ($2, $3, $1) }
2473 ;
2474
2475
2476 -- Instruction call
2477
2478
2479 Call: A_feature
2480 { $$ := $1 }
2481 | A_precursor
2482 { $$ := $1 }
2483 | A_static_call
2484 { $$ := $1 }
2485 | Qualified_call
2486 { $$ := $1 }
2487 ;
2488
2489 Check: TE_CHECK Assertion TE_END
2490 { $$ := ast_factory.new_check_as ($2, $1, $3) }
2491 ;
2492
2493
2494 -- Expression
2495
2496 Typed: TE_LCURLY Type TE_RCURLY
2497 { $$ := $2
2498 if $$ /= Void then
2499 $$.set_lcurly_symbol ($1)
2500 $$.set_rcurly_symbol ($3)
2501 end
2502 }
2503 ;
2504
2505 Expression:
2506 Nosigned_integer
2507 { $$ := $1; has_type := True }
2508 | Nosigned_real
2509 { $$ := $1; has_type := True }
2510 | Factor
2511 { $$ := $1 }
2512 | Typed_expression
2513 { $$ := $1; has_type := True }
2514 | Expression TE_EQ Expression
2515 { $$ := ast_factory.new_bin_eq_as ($1, $3, $2); has_type := True }
2516 | Expression TE_NE Expression
2517 { $$ := ast_factory.new_bin_ne_as ($1, $3, $2); has_type := True }
2518 | Qualified_binary_expression
2519 { $$ := $1; has_type := True }
2520 ;
2521
2522 Qualified_binary_expression:
2523 Expression TE_PLUS Expression
2524 { $$ := ast_factory.new_bin_plus_as ($1, $3, $2) }
2525 | Expression TE_MINUS Expression
2526 { $$ := ast_factory.new_bin_minus_as ($1, $3, $2) }
2527 | Expression TE_STAR Expression
2528 { $$ := ast_factory.new_bin_star_as ($1, $3, $2) }
2529 | Expression TE_SLASH Expression
2530 { $$ := ast_factory.new_bin_slash_as ($1, $3, $2) }
2531 | Expression TE_MOD Expression
2532 { $$ := ast_factory.new_bin_mod_as ($1, $3, $2) }
2533 | Expression TE_DIV Expression
2534 { $$ := ast_factory.new_bin_div_as ($1, $3, $2) }
2535 | Expression TE_POWER Expression
2536 { $$ := ast_factory.new_bin_power_as ($1, $3, $2) }
2537 | Expression TE_AND Expression
2538 { $$ := ast_factory.new_bin_and_as ($1, $3, $2) }
2539 | Expression TE_AND TE_THEN Expression %prec TE_AND
2540 { $$ := ast_factory.new_bin_and_then_as ($1, $4, $2, $3) }
2541 | Expression TE_OR Expression
2542 { $$ := ast_factory.new_bin_or_as ($1, $3, $2) }
2543 | Expression TE_OR TE_ELSE Expression %prec TE_OR
2544 { $$ := ast_factory.new_bin_or_else_as ($1, $4,$2, $3) }
2545 | Expression TE_IMPLIES Expression
2546 { $$ := ast_factory.new_bin_implies_as ($1, $3, $2) }
2547 | Expression TE_XOR Expression
2548 { $$ := ast_factory.new_bin_xor_as ($1, $3, $2) }
2549 | Expression TE_GE Expression
2550 { $$ := ast_factory.new_bin_ge_as ($1, $3, $2) }
2551 | Expression TE_GT Expression
2552 { $$ := ast_factory.new_bin_gt_as ($1, $3, $2) }
2553 | Expression TE_LE Expression
2554 { $$ := ast_factory.new_bin_le_as ($1, $3, $2) }
2555 | Expression TE_LT Expression
2556 { $$ := ast_factory.new_bin_lt_as ($1, $3, $2) }
2557 | Expression Free_operator Expression %prec TE_FREE
2558 { $$ := ast_factory.new_bin_free_as ($1, $2, $3) }
2559 ;
2560
2561 Factor: TE_VOID
2562 { $$ := $1; has_type := True }
2563 | Manifest_array
2564 { $$ := $1; has_type := True }
2565 | Agent_call
2566 { $$ := $1; has_type := False }
2567 | TE_OLD Expression
2568 { $$ := ast_factory.new_un_old_as ($2, $1); has_type := True }
2569 | TE_STRIP TE_LPARAN Strip_identifier_list TE_RPARAN
2570 {
2571 $$ := ast_factory.new_un_strip_as ($3, $1, $2, $4); has_type := True
2572 }
2573 | TE_ADDRESS Feature_name
2574 { $$ := ast_factory.new_address_as ($2, $1); has_type := True }
2575 | TE_ADDRESS TE_LPARAN Expression TE_RPARAN
2576 {
2577 $$ := ast_factory.new_expr_address_as ($3, $1, $2, $4); has_type := True
2578 }
2579 | TE_ADDRESS TE_CURRENT
2580 {
2581 $$ := ast_factory.new_address_current_as ($2, $1); has_type := True
2582 }
2583 | TE_ADDRESS TE_RESULT
2584 {
2585 $$ := ast_factory.new_address_result_as ($2, $1); has_type := True
2586 }
2587 | Bracket_target
2588 { $$ := $1 }
2589 | Qualified_factor
2590 { $$ := $1; has_type := True }
2591 ;
2592
2593 Qualified_factor:
2594 Bracket_target TE_LSQURE Add_counter Expression_list Remove_counter TE_RSQURE
2595 { $$ := ast_factory.new_bracket_as ($1, $4, $2, $6) }
2596 | TE_MINUS Factor
2597 { $$ := ast_factory.new_un_minus_as ($2, $1) }
2598 | TE_PLUS Factor
2599 { $$ := ast_factory.new_un_plus_as ($2, $1) }
2600 | TE_NOT Expression
2601 { $$ := ast_factory.new_un_not_as ($2, $1) }
2602 | Free_operator Expression %prec TE_NOT
2603 { $$ := ast_factory.new_un_free_as ($1, $2) }
2604 ;
2605
2606 Typed_expression: Typed
2607
2608 { $$ := ast_factory.new_type_expr_as ($1) }
2609 | Typed_nosigned_integer
2610 { $$ := $1 }
2611 | Typed_nosigned_real
2612 { $$ := $1 }
2613 ;
2614
2615 Free_operator: TE_FREE
2616 {
2617 if $1 /= Void then
2618 $1.to_lower
2619 end
2620 $$ := $1
2621 }
2622 ;
2623
2624
2625 -- Expression call
2626
2627 Qualified_call:
2628 TE_CURRENT TE_DOT Remote_call
2629 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2630 | TE_RESULT TE_DOT Remote_call
2631 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2632 | A_feature TE_DOT Remote_call
2633 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2634 | TE_LPARAN Expression TE_RPARAN TE_DOT Remote_call
2635 { $$ := ast_factory.new_nested_expr_as ($2, $5, $4, $1, $3) }
2636 | Bracket_target TE_LSQURE Add_counter Expression_list Remove_counter TE_RSQURE TE_DOT Remote_call
2637 { $$ := ast_factory.new_nested_expr_as (ast_factory.new_bracket_as ($1, $4, $2, $6), $8, $7, Void, Void) }
2638 | A_precursor TE_DOT Remote_call
2639 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2640 | A_static_call TE_DOT Remote_call
2641 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2642 ;
2643
2644 A_precursor: TE_PRECURSOR Parameters
2645 { $$ := ast_factory.new_precursor_as ($1, Void, $2) }
2646 | TE_PRECURSOR TE_LCURLY Class_identifier TE_RCURLY Parameters
2647 {
2648 temp_class_type_as := ast_factory.new_class_type_as ($3, Void)
2649 if temp_class_type_as /= Void then
2650 temp_class_type_as.set_lcurly_symbol ($2)
2651 temp_class_type_as.set_rcurly_symbol ($4)
2652 end
2653 $$ := ast_factory.new_precursor_as ($1, temp_class_type_as, $5)
2654 }
2655 ;
2656
2657 A_static_call: New_a_static_call
2658 { $$ := $1 }
2659 | Old_a_static_call
2660 { $$ := $1 }
2661 ;
2662
2663 New_a_static_call:
2664 Typed TE_DOT Identifier_as_lower Parameters
2665 { $$ := ast_factory.new_static_access_as ($1, $3, $4, Void, $2); }
2666 ;
2667
2668 Old_a_static_call:
2669 TE_FEATURE Typed TE_DOT Identifier_as_lower Parameters
2670 {
2671 $$ := ast_factory.new_static_access_as ($2, $4, $5, $1, $3);
2672 if has_syntax_warning and ($1 /= Void or $2 /= Void) then
2673 if $1 /= Void then
2674 ast_location := $1.start_location
2675 else
2676 ast_location := $2.start_location
2677 end
2678 Error_handler.insert_warning (
2679 create {SYNTAX_WARNING}.make (ast_location.line,
2680 ast_location.column, filename, once "Remove the `feature' keyword."))
2681 end
2682 }
2683 ;
2684
2685 Remote_call: Call_on_feature_access
2686 { $$ := $1 }
2687 | Feature_access
2688 { $$ := $1 }
2689 ;
2690
2691 Call_on_feature_access: Feature_access TE_DOT Feature_access
2692 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2693 | Feature_access TE_DOT Call_on_feature_access
2694 { $$ := ast_factory.new_nested_as ($1, $3, $2) }
2695 ;
2696
2697 Feature_name_for_call: Identifier_as_lower
2698 { $$ := $1}
2699 | Infix
2700 {
2701 if $1 /= Void then
2702 $$ := $1.internal_name
2703 end
2704 }
2705 | Prefix
2706 {
2707 if $1 /= Void then
2708 $$ := $1.internal_name
2709 end
2710 }
2711 ;
2712
2713 A_feature: Feature_name_for_call Parameters
2714 {
2715 inspect id_level
2716 when Normal_level then
2717 $$ := ast_factory.new_access_id_as ($1, $2)
2718 when Assert_level then
2719 $$ := ast_factory.new_access_assert_as ($1, $2)
2720 when Invariant_level then
2721 $$ := ast_factory.new_access_inv_as ($1, $2, Void)
2722 end
2723 }
2724 ;
2725
2726 Feature_access: Feature_name_for_call Parameters
2727 { $$ := ast_factory.new_access_feat_as ($1, $2) }
2728 ;
2729
2730 Bracket_target:
2731 Expression_constant
2732 { $$ := $1; has_type := True }
2733 | Manifest_tuple
2734 { $$ := $1; has_type := True }
2735 | TE_CURRENT
2736 { $$ := ast_factory.new_expr_call_as ($1); has_type := True }
2737 | TE_RESULT
2738 { $$ := ast_factory.new_expr_call_as ($1); has_type := True }
2739 | Call
2740 { $$ := ast_factory.new_expr_call_as ($1); has_type := False }
2741 | Creation_expression
2742 { $$ := ast_factory.new_expr_call_as ($1); has_type := True }
2743 | TE_LPARAN Expression TE_RPARAN
2744 { $$ := ast_factory.new_paran_as ($2, $1, $3); has_type := True }
2745 ;
2746
2747 Parameters: -- Empty
2748 -- { $$ := Void }
2749 | TE_LPARAN TE_RPARAN
2750 { $$ := ast_factory.new_parameter_list_as (Void, $1, $2) }
2751 | TE_LPARAN Add_counter Expression_list Remove_counter TE_RPARAN
2752 { $$ := ast_factory.new_parameter_list_as ($3, $1, $5) }
2753 ;
2754
2755 Expression_list: Expression
2756 {
2757 $$ := ast_factory.new_eiffel_list_expr_as (counter_value + 1)
2758 if $$ /= Void and $1 /= Void then
2759 $$.reverse_extend ($1)
2760 end
2761 }
2762 | Expression TE_COMMA Increment_counter Expression_list
2763 {
2764 $$ := $4
2765 if $$ /= Void and $1 /= Void then
2766 $$.reverse_extend ($1)
2767 ast_factory.reverse_extend_separator ($$, $2)
2768 end
2769 }
2770 ;
2771
2772 Class_or_tuple_identifier: TE_TUPLE
2773 {
2774 if $1 /= Void then
2775 $1.to_upper
2776 end
2777 $$ := $1
2778 }
2779 | Class_identifier
2780 {
2781 $$ := $1;
2782 }
2783 ;
2784
2785 Class_identifier: TE_ID
2786 {
2787 if $1 /= Void then
2788 $1.to_upper
2789 end
2790 $$ := $1
2791 }
2792 | TE_ASSIGN
2793 {
2794 -- Keyword used as identifier
2795 process_id_as_with_existing_stub (last_keyword_as_id_index)
2796 if has_syntax_warning then
2797 Error_handler.insert_warning (
2798 create {SYNTAX_WARNING}.make (line, column, filename,
2799 once "Use of `assign', possibly a new keyword in future definition of `Eiffel'."))
2800 end
2801
2802 if last_id_as_value /= Void then
2803 last_id_as_value.to_upper
2804 end
2805 $$ := last_id_as_value
2806 }
2807 ;
2808
2809 Identifier_as_lower: TE_ID
2810 {
2811 if $1 /= Void then
2812 $1.to_lower
2813 end
2814 $$ := $1
2815 }
2816 | TE_TUPLE
2817 {
2818 if $1 /= Void then
2819 $1.to_lower
2820 end
2821 $$ := $1
2822 }
2823 | TE_ASSIGN
2824 {
2825 -- Keyword used as identifier
2826 process_id_as_with_existing_stub (last_keyword_as_id_index)
2827 if has_syntax_warning then
2828 Error_handler.insert_warning (
2829 create {SYNTAX_WARNING}.make (line, column, filename,
2830 once "Use of `assign', possibly a new keyword in future definition of `Eiffel'."))
2831 end
2832 if last_id_as_value /= Void then
2833 last_id_as_value.to_lower
2834 end
2835 $$ := last_id_as_value
2836 }
2837 ;
2838
2839 Manifest_constant: Boolean_constant
2840 { $$ := $1 }
2841 | Character_constant
2842 { $$ := $1 }
2843 | Integer_constant
2844 { $$ := $1 }
2845 | Real_constant
2846 { $$ := $1 }
2847 | Bit_constant
2848 { $$ := $1 }
2849 | Manifest_string
2850 { $$ := $1 }
2851 ;
2852
2853 -- It contains all constants except the Integer/Real one without a sign mark.
2854 Expression_constant:
2855 Boolean_constant
2856 { $$ := $1 }
2857 | Signed_integer
2858 { $$ := $1 }
2859 | Typed_signed_integer
2860 { $$ := $1 }
2861 | Signed_real
2862 { $$ := $1 }
2863 | Typed_signed_real
2864 { $$ := $1 }
2865 | Character_constant
2866 { $$ := $1 }
2867 | Bit_constant
2868 { $$ := $1 }
2869 | Manifest_string
2870 { $$ := $1 }
2871 | TE_ONCE_STRING Manifest_string
2872 {
2873 if $2 /= Void then
2874 $2.set_is_once_string (True)
2875 $2.set_once_string_keyword ($1)
2876 end
2877 once_manifest_string_count := once_manifest_string_count + 1
2878 $$ := $2
2879 }
2880 ;
2881
2882 Boolean_constant: TE_FALSE
2883 { $$ := $1 }
2884 | TE_TRUE
2885 { $$ := $1 }
2886 ;
2887
2888 Character_constant: TE_CHAR
2889 {
2890 check is_character: not token_buffer.is_empty end
2891
2892 $$ := ast_factory.new_character_value (Current, Void, token_buffer, token_buffer2)
2893
2894 }
2895 | Typed TE_CHAR
2896 {
2897 check is_character: not token_buffer.is_empty end
2898 fixme (once "We should handle `Type' instead of ignoring it.")
2899
2900 $$ := ast_factory.new_character_value (Current, $1, token_buffer, token_buffer2)
2901 }
2902 ;
2903
2904 --###################################################################
2905 --# Integer constants
2906 --###################################################################
2907 Integer_constant:
2908 Signed_integer
2909 { $$ := $1 }
2910 | Nosigned_integer
2911 { $$ := $1 }
2912 | Typed_integer
2913 { $$ := $1 }
2914 ;
2915
2916 Signed_integer: TE_PLUS TE_INTEGER
2917 {
2918 $$ := ast_factory.new_integer_value (Current, '+', Void, token_buffer, $1)
2919 }
2920 | TE_MINUS TE_INTEGER
2921 {
2922 $$ := ast_factory.new_integer_value (Current, '-', Void, token_buffer, $1)
2923 }
2924 ;
2925
2926 Nosigned_integer: TE_INTEGER
2927 {
2928 $$ := ast_factory.new_integer_value (Current, '%U', Void, token_buffer, Void)
2929 }
2930 ;
2931
2932 Typed_integer: Typed_nosigned_integer
2933 { $$ := $1 }
2934 | Typed_signed_integer
2935 { $$ := $1 }
2936 ;
2937
2938 Typed_nosigned_integer: Typed TE_INTEGER
2939 {
2940 $$ := ast_factory.new_integer_value (Current, '%U', $1, token_buffer, Void)
2941 }
2942 ;
2943
2944 Typed_signed_integer: Typed TE_PLUS TE_INTEGER
2945 {
2946 $$ := ast_factory.new_integer_value (Current, '+', $1, token_buffer, $2)
2947 }
2948 | Typed TE_MINUS TE_INTEGER
2949 {
2950 $$ := ast_factory.new_integer_value (Current, '-', $1, token_buffer, $2)
2951 }
2952 ;
2953
2954 --###################################################################
2955 --# Real constants
2956 --###################################################################
2957 Real_constant: Signed_real
2958 { $$ := $1 }
2959 | Nosigned_real
2960 { $$ := $1 }
2961 | Typed_real
2962 { $$ := $1 }
2963 ;
2964
2965 Nosigned_real: TE_REAL
2966 {
2967 $$ := ast_factory.new_real_value (Current, False, '%U', Void, token_buffer, Void)
2968 }
2969 ;
2970
2971 Signed_real: TE_PLUS TE_REAL
2972 {
2973 $$ := ast_factory.new_real_value (Current, True, '+', Void, token_buffer, $1)
2974 }
2975 | TE_MINUS TE_REAL
2976 {
2977 $$ := ast_factory.new_real_value (Current, True, '-', Void, token_buffer, $1)
2978 }
2979 ;
2980
2981 Typed_real: Typed_nosigned_real
2982 { $$ := $1 }
2983 | Typed_signed_real
2984 { $$ := $1 }
2985 ;
2986
2987 Typed_nosigned_real: Typed TE_REAL
2988 {
2989 $$ := ast_factory.new_real_value (Current, False, '%U', $1, token_buffer, Void)
2990 }
2991 ;
2992
2993 Typed_signed_real: Typed TE_PLUS TE_REAL
2994 {
2995 $$ := ast_factory.new_real_value (Current, True, '+', $1, token_buffer, $2)
2996 }
2997 | Typed TE_MINUS TE_REAL
2998 {
2999 $$ := ast_factory.new_real_value (Current, True, '-', $1, token_buffer, $2)
3000 }
3001 ;
3002
3003 --###################################################################
3004 --# Bit constants
3005 --###################################################################
3006 Bit_constant: TE_A_BIT
3007 { $$ := ast_factory.new_bit_const_as ($1) }
3008 ;
3009
3010 --###################################################################
3011 --# Manifest string constants
3012 --###################################################################
3013 Manifest_string: Default_manifest_string
3014 { $$ := $1 }
3015 | Typed_manifest_string
3016 { $$ := $1 }
3017 ;
3018
3019 Default_manifest_string: Non_empty_string
3020 { $$ := $1 }
3021 | TE_EMPTY_STRING
3022 {
3023 $$ := ast_factory.new_string_as ("", line, column, string_position, position + text_count - string_position, token_buffer2)
3024 }
3025 | TE_EMPTY_VERBATIM_STRING
3026 {
3027 $$ := ast_factory.new_verbatim_string_as ("", verbatim_marker.substring (2, verbatim_marker.count), not has_old_verbatim_strings and then verbatim_marker.item (1) = ']', line, column, string_position, position + text_count - string_position, token_buffer2)
3028 }
3029 ;
3030
3031 Typed_manifest_string: TE_RCURLY Type TE_RCURLY Default_manifest_string
3032 {
3033 fixme (once "We should handle `Type' instead of ignoring it.")
3034 $$ := $4
3035 if $2 /= Void then
3036 $2.set_lcurly_symbol ($1)
3037 $2.set_rcurly_symbol ($3)
3038 end
3039 if $$ /= Void then
3040 $$.set_type ($2)
3041 end
3042 }
3043 ;
3044
3045 Non_empty_string: TE_STRING
3046 {
3047 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, string_position, position + text_count - string_position, token_buffer2)
3048 }
3049 | TE_VERBATIM_STRING
3050 {
3051 $$ := ast_factory.new_verbatim_string_as (cloned_string (token_buffer), verbatim_marker.substring (2, verbatim_marker.count), not has_old_verbatim_strings and then verbatim_marker.item (1) = ']', line, column, string_position, position + text_count - string_position, token_buffer2)
3052 }
3053 | TE_STR_LT
3054 {
3055 $$ := ast_factory.new_string_as ("<", line, column, position, 3, token_buffer2)
3056 }
3057 | TE_STR_LE
3058 {
3059 $$ := ast_factory.new_string_as ("<=", line, column, position, 4, token_buffer2)
3060 }
3061 | TE_STR_GT
3062 {
3063 $$ := ast_factory.new_string_as (">", line, column, position, 3, token_buffer2)
3064 }
3065 | TE_STR_GE
3066 {
3067 $$ := ast_factory.new_string_as (">=", line, column, position, 4, token_buffer2)
3068 }
3069 | TE_STR_MINUS
3070 {
3071 $$ := ast_factory.new_string_as ("-", line, column, position, 3, token_buffer2)
3072 }
3073 | TE_STR_PLUS
3074 {
3075 $$ := ast_factory.new_string_as ("+", line, column, position, 3, token_buffer2)
3076 }
3077 | TE_STR_STAR
3078 {
3079 $$ := ast_factory.new_string_as ("*", line, column, position, 3, token_buffer2)
3080 }
3081 | TE_STR_SLASH
3082 {
3083 $$ := ast_factory.new_string_as ("/", line, column, position, 3, token_buffer2)
3084 }
3085 | TE_STR_MOD
3086 {
3087 $$ := ast_factory.new_string_as ("\\", line, column, position, 4, token_buffer2)
3088 }
3089 | TE_STR_DIV
3090 {
3091 $$ := ast_factory.new_string_as ("//", line, column, position, 4, token_buffer2)
3092 }
3093 | TE_STR_POWER
3094 {
3095 $$ := ast_factory.new_string_as ("^", line, column, position, 3, token_buffer2)
3096 }
3097 | TE_STR_BRACKET
3098 {
3099 $$ := ast_factory.new_string_as ("[]", line, column, position, 4, token_buffer2)
3100 }
3101 | TE_STR_AND
3102 {
3103 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 5, token_buffer2)
3104 }
3105 | TE_STR_AND_THEN
3106 {
3107 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 10, token_buffer2)
3108 }
3109 | TE_STR_IMPLIES
3110 {
3111 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 9, token_buffer2)
3112 }
3113 | TE_STR_OR
3114 {
3115 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 4, token_buffer2)
3116 }
3117 | TE_STR_OR_ELSE
3118 {
3119 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 9, token_buffer2)
3120 }
3121 | TE_STR_XOR
3122 {
3123 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 5, token_buffer2)
3124 }
3125 | TE_STR_NOT
3126 {
3127 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, 5, token_buffer2)
3128 }
3129 | TE_STR_FREE
3130 {
3131 $$ := ast_factory.new_string_as (cloned_string (token_buffer), line, column, position, token_buffer.count + 2, token_buffer2)
3132 }
3133 ;
3134
3135 Prefix_operator: TE_STR_MINUS
3136 {
3137 $$ := ast_factory.new_string_as ("-", line, column, position, 3, token_buffer2)
3138 }
3139 | TE_STR_PLUS
3140 {
3141 $$ := ast_factory.new_string_as ("+", line, column, position, 3, token_buffer2)
3142 }
3143 | TE_STR_NOT
3144 {
3145 $$ := ast_factory.new_string_as ("not", line, column, position, 5, token_buffer2)
3146 }
3147 | TE_STR_FREE
3148 {
3149 $$ := ast_factory.new_string_as (cloned_lower_string (token_buffer), line, column, position, token_buffer.count + 2, token_buffer2)
3150 }
3151 ;
3152
3153 Infix_operator: TE_STR_LT
3154 {
3155 $$ := ast_factory.new_string_as ("<", line, column, position, 3, token_buffer2)
3156 }
3157 | TE_STR_LE
3158 {
3159 $$ := ast_factory.new_string_as ("<=", line, column, position, 4, token_buffer2)
3160 }
3161 | TE_STR_GT
3162 {
3163 $$ := ast_factory.new_string_as (">", line, column, position, 3, token_buffer2)
3164 }
3165 | TE_STR_GE
3166 {
3167 $$ := ast_factory.new_string_as (">=", line, column, position, 4, token_buffer2)
3168 }
3169 | TE_STR_MINUS
3170 {
3171 $$ := ast_factory.new_string_as ("-", line, column, position, 3, token_buffer2)
3172 }
3173 | TE_STR_PLUS
3174 {
3175 $$ := ast_factory.new_string_as ("+", line, column, position, 3, token_buffer2)
3176 }
3177 | TE_STR_STAR
3178 {
3179 $$ := ast_factory.new_string_as ("*", line, column, position, 3, token_buffer2)
3180 }
3181 | TE_STR_SLASH
3182 {
3183 $$ := ast_factory.new_string_as ("/", line, column, position, 3, token_buffer2)
3184 }
3185 | TE_STR_MOD
3186 {
3187 $$ := ast_factory.new_string_as ("\\", line, column, position, 4, token_buffer2)
3188 }
3189 | TE_STR_DIV
3190 {
3191 $$ := ast_factory.new_string_as ("//", line, column, position, 4, token_buffer2)
3192 }
3193 | TE_STR_POWER
3194 {
3195 $$ := ast_factory.new_string_as ("^", line, column, position, 3, token_buffer2)
3196 }
3197 | TE_STR_AND
3198 {
3199 $$ := ast_factory.new_string_as ("and", line, column, position, 5, token_buffer2)
3200 }
3201 | TE_STR_AND_THEN
3202 {
3203 $$ := ast_factory.new_string_as ("and then", line, column, position, 10, token_buffer2)
3204 }
3205 | TE_STR_IMPLIES
3206 {
3207 $$ := ast_factory.new_string_as ("implies", line, column, position, 9, token_buffer2)
3208 }
3209 | TE_STR_OR
3210 {
3211 $$ := ast_factory.new_string_as ("or", line, column, position, 4, token_buffer2)
3212 }
3213 | TE_STR_OR_ELSE
3214 {
3215 $$ := ast_factory.new_string_as ("or else", line, column, position, 9, token_buffer2)
3216 }
3217 | TE_STR_XOR
3218 {
3219 $$ := ast_factory.new_string_as ("xor", line, column, position, 5, token_buffer2)
3220 }
3221 | TE_STR_FREE
3222 {
3223 $$ := ast_factory.new_string_as (cloned_lower_string (token_buffer), line, column, position, token_buffer.count + 2, token_buffer2)
3224 }
3225 ;
3226
3227 Manifest_array: TE_LARRAY TE_RARRAY
3228 {
3229 $$ := ast_factory.new_array_as (ast_factory.new_eiffel_list_expr_as (0), $1, $2)
3230 }
3231 | TE_LARRAY Add_counter Expression_list Remove_counter TE_RARRAY
3232 { $$ := ast_factory.new_array_as ($3, $1, $5) }
3233 ;
3234
3235 Manifest_tuple: TE_LSQURE TE_RSQURE
3236 { $$ := ast_factory.new_tuple_as (ast_factory.new_eiffel_list_expr_as (0), $1, $2) }
3237 | TE_LSQURE Add_counter Expression_list Remove_counter TE_RSQURE
3238 { $$ := ast_factory.new_tuple_as ($3, $1, $5) }
3239 ;
3240
3241 Add_indexing_counter:
3242 {
3243 initial_has_old_verbatim_strings_warning := has_old_verbatim_strings_warning
3244 set_has_old_verbatim_strings_warning (false)
3245 add_counter
3246 }
3247 ;
3248
3249 Add_counter: { add_counter }
3250 ;
3251
3252 Add_counter2: { add_counter2 }
3253 ;
3254
3255 Increment_counter: { increment_counter }
3256 ;
3257
3258 Increment_counter2: { increment_counter2 }
3259 ;
3260
3261 Remove_counter: { remove_counter }
3262 ;
3263
3264
3265 %%
3266
3267 indexing
3268 copyright: "Copyright (c) 1984-2006, Eiffel Software"
3269 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
3270 licensing_options: "http://www.eiffel.com/licensing"
3271 copying: "[
3272 This file is part of Eiffel Software's Eiffel Development Environment.
3273
3274 Eiffel Software's Eiffel Development Environment is free
3275 software; you can redistribute it and/or modify it under
3276 the terms of the GNU General Public License as published
3277 by the Free Software Foundation, version 2 of the License
3278 (available at the URL listed under "license" above).
3279
3280 Eiffel Software's Eiffel Development Environment is
3281 distributed in the hope that it will be useful, but
3282 WITHOUT ANY WARRANTY; without even the implied warranty
3283 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3284 See the GNU General Public License for more details.
3285
3286 You should have received a copy of the GNU General Public
3287 License along with Eiffel Software's Eiffel Development
3288 Environment; if not, write to the Free Software Foundation,
3289 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3290 ]"
3291 source: "[
3292 Eiffel Software
3293 356 Storke Road, Goleta, CA 93117 USA
3294 Telephone 805-685-1006, Fax 805-685-6869
3295 Website http://www.eiffel.com
3296 Customer support http://support.eiffel.com
3297 ]"
3298
3299 end -- class EIFFEL_PARSER

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23