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_declaration
Class_declaration ::= Indexing"end"NL Class_header Formal_generics NL IN Obsolete Inheritance Creators Features Invariant EX
Indexing ::=
NL "indexing" Index_list
Index_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 Constraint
Formal_generic_name ::= Identifier
Constraint ::=
"->" Restricted_type
Obsolete ::=
"obsolete" Message NL
Message ::= Manifest_string
Features ::=
feature_Feature_clause
feature_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_argumentsType_mark is_Constant
is_Constant ::=
"is" Feature_value
Feature_value ::= Manifest_constant Unique
Routine_feature_declaration ::= NL New_feature_list Routine_declaration_body
Routine_declaration_body ::= Formal_argumentsType_mark is_Routine
is_Routine ::=
"is" NL Routine
New_feature_list ::=
New_feature
New_feature ::= "frozen" Feature_name
Feature_name ::= Identifier Prefix Infix
Prefix ::=
"prefix" Prefix_name
Infix ::=
"infix" Infix_name
Prefix_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_Separator
Parent_Separator ::= Parent Separator
Parent ::=
Restricted_class_type Feature_adaptation
Feature_adaptation ::= "end"NL IN Rename New_exports Undefine Redefine Select EX
Rename ::=
"rename" Rename_list NL
Rename_list ::= ","Rename_pair
Rename_pair ::=
Feature_name "as" Feature_name
Clients ::= "{" Class_list "}"
Class_list ::= ","Class_name
New_exports ::=
"export" New_export_list NL
New_export_list ::=
New_export_item_Separator
New_export_item_Separator ::= New_export_item Separator
New_export_item ::= Clients Feature_set
Feature_set ::=
Feature_list
"all"
Feature_list ::= "," EXIN NL Feature_name
Formal_arguments ::= "(" Formal_entity_declaration_list ")"
Formal_entity_declaration_list ::=
Formal_entity_declaration_group_Separator
Formal_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 ::=
Identifier
Type_mark ::=
":" Type
Routine ::= Obsolete"end"Header_comment Precondition Local_declarations Routine_body Postcondition Rescue
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_list
Instruction ::= Creation Call Assignment Assignment_attempt Conditional Multi_branch Loop Debug Check Retry Null
Precondition ::= "require" "else" Assertion
Postcondition ::= "ensure" "then" Assertion
Invariant ::=
"invariant" Assertion
Assertion ::=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" Expression
Check ::= "check" Assertion "end"
Variant ::= "variant" Tag_mark Expression
Redefine ::=
"redefine" Feature_list NL
Undefine ::=
"undefine" Feature_list NL
Select ::=
"select" Feature_list NL
Type ::= Class_type Class_type_expanded Formal_generic_name Anchored Bit_type
Class_type ::=
Class_name Actual_generics
Actual_generics ::= "[" Type_list "]"
Type_list ::= ","Type
Class_type_expanded ::=
"expanded" Class_type
Bit_type ::=
"BIT" Constant
Anchored ::=
"like" Anchor
Anchor ::=
Identifier
"Current"
Restricted_type ::= Restricted_class_type Formal_generic_name
Restricted_class_type ::=
Class_name Restricted_actual_generics
Restricted_actual_generics ::= "[" Restricted_type_list "]"
Restricted_type_list ::= ","Restricted_type
Compound ::=IN NL Instruction_Separator EX
Instruction_Separator ::= Instruction Separator
Separator ::= ";" NL
Null ::=
";" NL
Conditional ::= "if" Then_part_list Else_part "end"
Then_part_list ::=
Then_part elseif_Then_part
elseif_Then_part ::=
"elseif" Then_part
Then_part ::=
Boolean_expression "then" Compound
Else_part ::=
"else" Compound
Multi_branch ::= "inspect" Expression When_part_list Else_part "end"
When_part_list ::=
when_When_part
when_When_part ::=
"when" When_part
When_part ::=
Choices "then" Compound
Choices ::= ","Choice
Choice ::= Constant Interval
Interval ::=
Constant ".." Constant
Loop ::= Initialization Invariant"end"Variant Loop_body
Initialization ::=
"from" Compound
Loop_body ::=
Exit NL "loop" Compound
Exit ::=
"until" Boolean_expression
Debug ::= "debug" Debug_keys Compound "end"
Debug_keys ::= "(" Debug_key_list ")"
Debug_key_list ::= ","Debug_key
Debug_key ::= Manifest_string
Rescue ::=
"rescue" Compound
Retry ::=
"retry"
Unique ::=
"unique"
Entity ::= Writable Read_only
Writable ::= Attribute Local
Attribute ::= Identifier
Local ::=
Identifier
"Result"
Read_only ::=
Formal
"Current"
Formal ::= Identifier
Creators ::=
creation_Creation_clause
creation_Creation_clause ::=
NL "creation" Creation_clause
Creation_clause ::= ClientsHeader_comment Feature_list NL
Creation ::= "!!" Writable Creation_call "!" Type "!" Writable Creation_call
Creation_call ::=
"." Unqualified_call
Assignment ::=
Writable ":=" Expression
Assignment_attempt ::=
Writable "?=" Expression
Call ::=
Parenthesized_qualifier
Call_chainParenthesized_qualifier ::=
Parenthesized "."
Call_chain ::=
Unqualified_call dot_Unqualified_call
dot_Unqualified_call ::=
"." Unqualified_call
Unqualified_call ::=
Entity Actuals
Actuals ::= "(" Actual_list ")"
Actual_list ::= ","Actual
Actual ::= Expression Address
Address ::=
"$" Address_mark
Address_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_expression
Comparison_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_expression
Infix_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_string
Identifier ::= id
Manifest_string ::= string
Comment ::= comment
Character_constant ::= character_constant
Integer ::= integer
Real ::= real_number
Bit_sequence ::= bit_sequence
Free_operator ::= free_operator