To illustrate the grammar, some examples are given next:
Phone number required for passenger with a given id:
passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130002].detail.contact.phoneNumber
First name and last name required with a given id:
passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130004].detail.firstName AND passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130004].detail.lastName
More complex example:
passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130006].detail.firstName AND passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130006].detail.lastName AND (passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130006].detail.contact.email OR passengerSpecifications[ee764ee0-55a1-11eb-ae93-0242ac130006].detail.contact.phoneNumber)
Here is the grammar in ANTLR notation.
grammar RequestedInformation; And_Operator : 'AND'; Or_Operator : 'OR'; Opening_Index_Bracket: '['; Closing_Index_Bracket: ']'; Opening_Bracket: '('; Closing_Bracket: ')'; Point: '.'; requested_informations: requested_information+ EOF; requested_information : class_index_attribute | requested_information And_Operator requested_information | requested_information Or_Operator requested_information | Opening_Bracket requested_information Closing_Bracket ; class_index_attribute : Attribute Opening_Index_Bracket Identifier Closing_Index_Bracket (Point Attribute)+ ; Attribute : [a-zA-Z_]+ ; Identifier : 'ANY' ; boolean_operator : And_Operator | Or_Operator ; WS : [ \t\r\n]+ -> skip ;