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.