
Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: eiffel/cordy/extracted
Source used for this grammar: James R. Cordy, A complete TXL grammar for Eiffel, Version 3, March 2006
program, Class_declaration, Indexing, Index_list, Index_clause_Separator, Index_clause, Index, Index_terms, Index_value, Class_header, Header_mark, Class_name, Formal_generics, Formal_generic_list, Formal_generic, Formal_generic_name, Constraint, Obsolete, Message, Features, feature_Feature_clause, Feature_clause, Feature_declaration_list, Feature_declaration_Separator, Header_comment, Feature_declaration, Declaration_body, is_Constant, Feature_value, Routine_feature_declaration, Routine_declaration_body, is_Routine, New_feature_list, New_feature, Feature_name, Prefix, Infix, Prefix_name, Infix_name, Unary, Binary, Inheritance, Parent_list, Parent_Separator, Parent, Feature_adaptation, Rename, Rename_list, Rename_pair, Clients, Class_list, New_exports, New_export_list, New_export_item_Separator, New_export_item, Feature_set, Feature_list, Formal_arguments, Formal_entity_declaration_list, Formal_entity_declaration_group_Separator, Entity_declaration_list, Entity_declaration_group_Separator, Entity_declaration_group, Identifier_list, Type_mark, Routine, Routine_body, Effective, Internal, Routine_mark, Deferred, Local_declarations, Instruction, Precondition, Postcondition, Invariant, Assertion, Assertion_clause_Separator, Assertion_clause, Unlabeled_assertion_clause, Tag_mark, Tag, Old, Check, Variant, Redefine, Undefine, Select, Type, Class_type, Actual_generics, Type_list, Class_type_expanded, Bit_type, Anchored, Anchor, Restricted_type, Restricted_class_type, Restricted_actual_generics, Restricted_type_list, Compound, Instruction_Separator, Separator, Null, Conditional, Then_part_list, elseif_Then_part, Then_part, Else_part, Multi_branch, When_part_list, when_When_part, When_part, Choices, Choice, Interval, Loop, Initialization, Loop_body, Exit, Debug, Debug_keys, Debug_key_list, Debug_key, Rescue, Retry, Unique, Entity, Writable, Attribute, Local, Read_only, Formal, Creators, creation_Creation_clause, Creation_clause, Creation, Creation_call, Assignment, Assignment_attempt, Call, Parenthesized_qualifier, Call_chain, dot_Unqualified_call, Unqualified_call, Actuals, Actual_list, Actual, Address, Address_mark, Expression, Primitive_expression, Boolean_expression, Equality, Comparison_Operator_expression, Comparison, Operator_expression, Parenthesized, Unary_expression, Binary_expression, Infix_operator_Unary_expression, Prefix_operator, Infix_operator, Constant, Constant_attribute, Manifest_constant, Sign, Integer_constant, Real_constant, Boolean_constant, Bit_constant, Manifest_array, Expression_list, Strip, Attribute_list, External, Language_name, External_name, Identifier, Manifest_string, Comment, Character_constant, Integer, Real, Bit_sequence, Free_operator), 0 root (—), 1 top (program), 11 bottom (comment, NL 27, integer, id, character_constant, free_operator, bit_sequence, EX 10, string, real_number, IN 10).program ::=
Class_declarationClass_declaration ::= Indexing NL Class_header Formal_generics NL IN Obsolete Inheritance Creators Features Invariant EX "end"
Indexing ::=
NL "indexing" Index_listIndex_list ::= NL IN Index_clause_Separator EX
Index_clause_Separator ::= Index_clause Separator
Index_clause ::=
Index Index_termsIndex ::=
Identifier ":"Index_terms ::= Index_value ","
Index_value ::=
Identifier
Manifest_constantClass_header ::= Header_mark "class" Class_name
Header_mark ::= "deferred" "expanded"
Class_name ::= Identifier
Formal_generics ::= "[" Formal_generic_list "]"
Formal_generic_list ::= Formal_generic ","
Formal_generic ::=
Formal_generic_name ConstraintFormal_generic_name ::= Identifier
Constraint ::=
"->" Restricted_typeObsolete ::=
"obsolete" Message NLMessage ::= Manifest_string
Features ::=
feature_Feature_clausefeature_Feature_clause ::= NL "feature" Clients Feature_clause
Feature_clause ::=
Header_comment Feature_declaration_listFeature_declaration_list ::= IN NL Feature_declaration_Separator EX
Feature_declaration_Separator ::= Feature_declaration Separator Routine_feature_declaration Separator
Header_comment ::= Comment
Feature_declaration ::= New_feature_list Declaration_body
Declaration_body ::= Formal_arguments Type_mark is_Constant
is_Constant ::=
"is" Feature_valueFeature_value ::= Manifest_constant Unique
Routine_feature_declaration ::= NL New_feature_list Routine_declaration_body
Routine_declaration_body ::= Formal_arguments Type_mark is_Routine
is_Routine ::=
"is" NL RoutineNew_feature_list ::=
New_featureNew_feature ::= "frozen" Feature_name
Feature_name ::= Identifier Prefix Infix
Prefix ::=
"prefix" Prefix_nameInfix ::=
"infix" Infix_namePrefix_name ::= Manifest_string
Infix_name ::= Manifest_string
Unary ::= "not" "+" "-"
Binary ::= "+" "-" "*" "/" "<" ">" "<=" ">=" "//" "\\" "^" "and" "or" "xor" "and" "then" "or" "else" "implies"
Inheritance ::= "inherit" NL IN Parent_list EX
Parent_list ::=
Parent_SeparatorParent_Separator ::= Parent Separator
Parent ::=
Restricted_class_type Feature_adaptationFeature_adaptation ::= NL IN Rename New_exports Undefine Redefine Select EX "end"
Rename ::=
"rename" Rename_list NLRename_list ::= Rename_pair ","
Rename_pair ::=
Feature_name "as" Feature_nameClients ::= "{" Class_list "}"
Class_list ::= Class_name ","
New_exports ::=
"export" New_export_list NLNew_export_list ::=
New_export_item_SeparatorNew_export_item_Separator ::= New_export_item Separator
New_export_item ::= Clients Feature_set
Feature_set ::=
Feature_list
"all"Feature_list ::= IN NL Feature_name "," EX
Formal_arguments ::= "(" Formal_entity_declaration_list ")"
Formal_entity_declaration_list ::=
Formal_entity_declaration_group_SeparatorFormal_entity_declaration_group_Separator ::= Entity_declaration_group ";"
Entity_declaration_list ::= IN NL Entity_declaration_group_Separator EX
Entity_declaration_group_Separator ::= Entity_declaration_group Separator
Entity_declaration_group ::= Identifier_list Type_mark
Identifier_list ::=
IdentifierType_mark ::=
":" TypeRoutine ::= Obsolete Header_comment Precondition Local_declarations Routine_body Postcondition Rescue "end"
Routine_body ::= Effective Deferred
Effective ::= Internal External
Internal ::= Routine_mark Compound
Routine_mark ::= "do" "once"
Deferred ::= IN "deferred" NL EX
Local_declarations ::=
"local" Entity_declaration_listInstruction ::= Creation Call Assignment Assignment_attempt Conditional Multi_branch Loop Debug Check Retry Null
Precondition ::= "require" "else" Assertion
Postcondition ::= "ensure" "then" Assertion
Invariant ::=
"invariant" AssertionAssertion ::= NL IN Assertion_clause_Separator EX
Assertion_clause_Separator ::= Assertion_clause Separator
Assertion_clause ::=
Tag_mark Unlabeled_assertion_clauseUnlabeled_assertion_clause ::= Boolean_expression Comment
Tag_mark ::=
Tag ":"Tag ::= Identifier
Old ::=
"old" ExpressionCheck ::= "check" Assertion "end"
Variant ::= "variant" Tag_mark Expression
Redefine ::=
"redefine" Feature_list NLUndefine ::=
"undefine" Feature_list NLSelect ::=
"select" Feature_list NLType ::= Class_type Class_type_expanded Formal_generic_name Anchored Bit_type
Class_type ::=
Class_name Actual_genericsActual_generics ::= "[" Type_list "]"
Type_list ::= Type ","
Class_type_expanded ::=
"expanded" Class_typeBit_type ::=
"BIT" ConstantAnchored ::=
"like" AnchorAnchor ::=
Identifier
"Current"Restricted_type ::= Restricted_class_type Formal_generic_name
Restricted_class_type ::=
Class_name Restricted_actual_genericsRestricted_actual_generics ::= "[" Restricted_type_list "]"
Restricted_type_list ::= Restricted_type ","
Compound ::= IN NL Instruction_Separator EX
Instruction_Separator ::= Instruction Separator
Separator ::= ";" NL
Null ::=
";" NLConditional ::= "if" Then_part_list Else_part "end"
Then_part_list ::=
Then_part elseif_Then_partelseif_Then_part ::=
"elseif" Then_partThen_part ::=
Boolean_expression "then" CompoundElse_part ::=
"else" CompoundMulti_branch ::= "inspect" Expression When_part_list Else_part "end"
When_part_list ::=
when_When_partwhen_When_part ::=
"when" When_partWhen_part ::=
Choices "then" CompoundChoices ::= Choice ","
Choice ::= Constant Interval
Interval ::=
Constant ".." ConstantLoop ::= Initialization Invariant Variant Loop_body "end"
Initialization ::=
"from" CompoundLoop_body ::=
Exit NL "loop" CompoundExit ::=
"until" Boolean_expressionDebug ::= "debug" Debug_keys Compound "end"
Debug_keys ::= "(" Debug_key_list ")"
Debug_key_list ::= Debug_key ","
Debug_key ::= Manifest_string
Rescue ::=
"rescue" CompoundRetry ::=
"retry"Unique ::=
"unique"Entity ::= Writable Read_only
Writable ::= Attribute Local
Attribute ::= Identifier
Local ::=
Identifier
"Result"Read_only ::=
Formal
"Current"Formal ::= Identifier
Creators ::=
creation_Creation_clausecreation_Creation_clause ::=
NL "creation" Creation_clauseCreation_clause ::= Clients Header_comment Feature_list NL
Creation ::= "!!" Writable Creation_call "!" Type "!" Writable Creation_call
Creation_call ::=
"." Unqualified_callAssignment ::=
Writable ":=" ExpressionAssignment_attempt ::=
Writable "?=" ExpressionCall ::=
Parenthesized_qualifier Call_chainParenthesized_qualifier ::=
Parenthesized "."Call_chain ::=
Unqualified_call dot_Unqualified_calldot_Unqualified_call ::=
"." Unqualified_callUnqualified_call ::=
Entity ActualsActuals ::= "(" Actual_list ")"
Actual_list ::= Actual ","
Actual ::= Expression Address
Address ::=
"$" Address_markAddress_mark ::= Feature_name "Current" "Result"
Expression ::= Equality
Primitive_expression ::= Call Manifest_constant Manifest_array Old Strip Parenthesized
Boolean_expression ::= Expression
Equality ::=
Operator_expression Comparison_Operator_expressionComparison_Operator_expression ::= Comparison Operator_expression
Comparison ::= "=" "/="
Operator_expression ::= Parenthesized Binary_expression
Parenthesized ::= "(" Expression ")"
Unary_expression ::=
Prefix_operator Primitive_expressionBinary_expression ::=
Unary_expression Infix_operator_Unary_expressionInfix_operator_Unary_expression ::= Infix_operator Unary_expression
Prefix_operator ::= Unary Free_operator
Infix_operator ::= Binary Free_operator
Constant ::= Manifest_constant Constant_attribute
Constant_attribute ::= Entity
Manifest_constant ::= Boolean_constant Character_constant Integer_constant Real_constant Manifest_string Bit_constant
Sign ::= "+" "-"
Integer_constant ::=
Sign IntegerReal_constant ::=
Sign RealBoolean_constant ::= "true" "false"
Bit_constant ::= Bit_sequence
Manifest_array ::= "<<" Expression_list ">>"
Expression_list ::= Expression ","
Strip ::= "strip" "(" Attribute_list ")"
Attribute_list ::= Identifier ","
External ::= "external" Language_name External_name NL
Language_name ::= Manifest_string
External_name ::=
"alias" Manifest_stringIdentifier ::= id
Manifest_string ::= string
Comment ::= comment
Character_constant ::= character_constant
Integer ::= integer
Real ::= real_number
Bit_sequence ::= bit_sequence
Free_operator ::= free_operator