Begin identifier: GenericToken = "tokenID" ; numberD: GenericToken = "tokenDECIMAL" ; numberO: GenericToken = "tokenOCTAL" ; numberH: GenericToken = "tokenHEX" ; Rope: GenericToken = "tokenROPE" ; { "ARRAY" "BEGIN" "BOOLEAN" "CARDINAL" "CHOICE" "DEPENDS" "END" "ERROR" "FALSE" "INTEGER" "LONG" "OF" "PROCEDURE" "PROGRAM" "RECORD" "REPORTS" "RETURNS" "SEQUENCE" "SINK" "SOURCE" "STRING" "TRUE" "TYPE" "UNSPECIFIED" "UPON" "VERSION" }: SimpleTokens; { "(" ")" "[" "]" "{" "}" ":" "." ";" "=" "=>" "," "-" }: SimpleTokens; OuterProgram: NonTerminal; Program: NonTerminal; DependencyList: NonTerminal; ReferencedProgramList: NonTerminal; ReferencedProgram: NonTerminal; DeclarationList: NonTerminal; Declaration: NonTerminal; Type: NonTerminal; SimpleType: NonTerminal; PredefinedType: NonTerminal; ConstructedType: NonTerminal; ReferencedType: NonTerminal; CorrespondenceList: NonTerminal; Correspondence: NonTerminal; OptionalNumber: NonTerminal; MandatoryNumber: NonTerminal; CandidateList: NonTerminal; Candidate: NonTerminal; ArgumentList: NonTerminal; ResultList: NonTerminal; ErrorList: NonTerminal; FieldList: NonTerminal; Field: NonTerminal; Constant: NonTerminal; PredefinedConstant: NonTerminal; ConstructedConstant: NonTerminal; ElementList: NonTerminal; ComponentList: NonTerminal; Component: NonTerminal; NameList: NonTerminal; number: NonTerminal; OuterProgram ← Program "." ; Program ← identifier ":" "PROGRAM" numberD "VERSION" numberD "=" "BEGIN" DependencyList DeclarationList "END" ; DependencyList.empty ← ; DependencyList.more ← "DEPENDS" "UPON" ReferencedProgramList ";" ; ReferencedProgramList.one ← ReferencedProgram ; ReferencedProgramList.more ← ReferencedProgramList "," ReferencedProgram ; ReferencedProgram ← identifier "(" numberD ")" "VERSION" numberD ; DeclarationList.a ← ; DeclarationList.b ← DeclarationList Declaration ; Declaration.type ← identifier ":" "TYPE" "=" Type ";" ; Declaration.constant ← identifier ":" Type "=" Constant ";" ; Declaration.id ← identifier ":" Type "=" identifier ";" ; Type.simple ← SimpleType ; Type.ConstructedType ← ConstructedType ; SimpleType.predefinedType ← PredefinedType ; SimpleType.referencedType ← ReferencedType ; PredefinedType.boolean ← "BOOLEAN" ; PredefinedType.Cardinal ← "CARDINAL" ; PredefinedType.longCardinal ← "LONG" "CARDINAL" ; PredefinedType.integer ← "INTEGER" ; PredefinedType.longInteger ← "LONG" "INTEGER" ; PredefinedType.string ← "STRING" ; PredefinedType.unspecified ← "UNSPECIFIED" ; PredefinedType.bulkDataSource ← "SOURCE" ; PredefinedType.bulkDataSink ← "SINK" ; ConstructedType.enumeration ← "{" CorrespondenceList "}" ; ConstructedType.array ← "ARRAY" MandatoryNumber "OF" SimpleType ; ConstructedType.sequence ← "SEQUENCE" OptionalNumber "OF" SimpleType ; ConstructedType.record ← "RECORD" "[" FieldList "]" ; ConstructedType.emptyRecord ← "RECORD" "[" "]" ; ConstructedType.choice ← "CHOICE" ReferencedType "OF" "{" CandidateList "}" ; ConstructedType.procedure ← "PROCEDURE" ArgumentList ResultList ErrorList ; ConstructedType.error ← "ERROR" ArgumentList ; ReferencedType.localReference ← identifier ; ReferencedType.remoteReference ← identifier "." identifier ; CorrespondenceList.one ← Correspondence ; CorrespondenceList.more ← Correspondence "," CorrespondenceList ; Correspondence ← identifier "(" MandatoryNumber ")" ; OptionalNumber.nonEmpty ← Constant ; OptionalNumber.localReference ← identifier ; OptionalNumber.empty ← ; MandatoryNumber.value ← Constant ; MandatoryNumber.localReference ← identifier ; CandidateList.one ← Candidate ; CandidateList.more ← Candidate "," CandidateList ; Candidate.one ← NameList "=>" SimpleType ; Candidate.two ← NameList "(" number ")" "=>" SimpleType ; ArgumentList.a ← ; ArgumentList.b ← "[" FieldList "]" ; ArgumentList.c ← "[" "]" ; ResultList.a ← ; ResultList.b ← "RETURNS" "[" FieldList "]" ; ResultList.c ← "RETURNS" "[" "]" ; ErrorList.a ← ; ErrorList.b ← "REPORTS" "[" NameList "]" ; FieldList.a ← Field ; FieldList.b ← Field "," FieldList ; Field ← NameList ":" SimpleType ; Constant.predefined ← PredefinedConstant ; Constant.constructed ← ConstructedConstant ; Constant.choiceConstant ← identifier Constant ; Constant.choiceIdentifier ← identifier identifier ; Constant.remoteReference ← identifier "." identifier ; PredefinedConstant.true ← "TRUE" ; PredefinedConstant.false ← "FALSE" ; PredefinedConstant.number ← number ; PredefinedConstant.negativeNumber ← "-" number ; PredefinedConstant.string ← Rope ; ConstructedConstant.elementList ← "[" ElementList "]" ; ConstructedConstant.componentlist ← "[" ComponentList "]" ; ConstructedConstant.empty ← "[" "]" ; ElementList.one ← Constant ; ElementList.more ← Constant "," ElementList ; ElementList.id ← identifier ; ElementList.idAndMore ← identifier "," ElementList ; ComponentList.one ← Component ; ComponentList.more ← Component "," ComponentList ; Component.more ← NameList ":" Constant ; Component.one ← NameList ":" identifier ; NameList.one ← identifier ; NameList.more ← identifier "," NameList ; number.a ← numberD ; number.b ← numberO ; number.c ← numberH ; End.