Goal -> (Program | Package | Library | Unit) Program -> [PROGRAM Ident ['(' IdentList ')'] ';'] ProgramBlock '.' Unit -> UNIT Ident ';' InterfaceSection ImplementationSection InitSection '.' Package -> PACKAGE Ident ';' [RequiresClause] [ContainsClause] END '.' Library -> LIBRARY Ident ';' ProgramBlock '.' ProgramBlock -> [UsesClause] Block UsesClause -> USES IdentList ';' InterfaceSection -> INTERFACE [UsesClause] [InterfaceDecl]... InterfaceDecl -> ConstSection -> TypeSection -> VarSection -> ExportedHeading ExportedHeading -> ProcedureHeading ';' [Directive] -> FunctionHeading ';' [Directive] ImplementationSection -> IMPLEMENTATION [UsesClause] [DeclSection]... Block -> [DeclSection] CompoundStmt DeclSection -> LabelDeclSection -> ConstSection -> TypeSection -> VarSection -> ProcedureDeclSection LabelDeclSection -> LABEL LabelId ConstSection -> CONST (ConstantDecl ';')... ConstantDecl -> Ident '=' ConstExpr -> Ident ':' TypeId '=' TypedConstant TypeSection -> TYPE (TypeDecl ';')... TypeDecl -> Ident '=' Type -> Ident '=' RestrictedType TypedConstant -> (ConstExpr | ArrayConstant | RecordConstant) ArrayConstant -> '(' TypedConstant ','... ')' RecordConstant -> '(' RecordFieldConstant ';'... ')' RecordFieldConstant -> Ident ':' TypedConstant Type -> TypeId -> SimpleType -> StrucType -> PointerType -> StringType -> ProcedureType -> VariantType -> ClassRefType RestrictedType -> ObjectType -> ClassType -> InterfaceType ClassRefType -> CLASS OF TypeId SimpleType -> (OrdinalType | RealType) RealType -> REAL48 -> REAL -> SINGLE -> DOUBLE -> EXTENDED -> CURRENCY -> COMP OrdinalType -> (SubrangeType | EnumeratedType | OrdIdent) OrdIdent -> SHORTINT -> SMALLINT -> INTEGER + -> CARDINAL -> BYTE -> LONGINT -> INT64 -> WORD -> BOOLEAN + -> BYTEBOOL + -> WORDBOOL + -> LONGBOOL + -> BOOL -> CHAR -> WIDECHAR -> LONGWORD -> PCHAR + -> PWIDECHAR VariantType -> VARIANT -> OLEVARIANT SubrangeType -> ConstExpr '..' ConstExpr EnumeratedType -> '(' EnumeratedTypeElement ','... ')' EnumeratedTypeElement -> Ident [ '=' ConstExpr ] StringType -> STRING -> ANSISTRING + -> SHORTSTRING -> WIDESTRING -> STRING '[' ConstExpr ']' StrucType -> [PACKED] (ArrayType | SetType | FileType | RecType) ArrayType -> ARRAY ['[' OrdinalType ','... ']'] OF Type RecType -> RECORD [FieldList] END FieldList -> FieldDecl ';'... [VariantSection] [';'] FieldDecl -> IdentList ':' Type VariantSection -> CASE [Ident ':'] TypeId OF RecVariant ';'... RecVariant -> ConstExpr ','... ':' '(' [FieldList] ')' SetType -> SET OF OrdinalType FileType -> FILE OF TypeId PointerType -> '^' TypeId ProcedureType -> (ProcedureHeading | FunctionHeading) [OF OBJECT] VarSection -> VAR (VarDecl ';')... VarDecl -> IdentList ':' Type [(ABSOLUTE (Ident | ConstExpr)) | '=' ConstExpr] Expression -> SimpleExpression [RelOp SimpleExpression]... SimpleExpression -> ['+' | '-'] Term [AddOp Term]... Term -> Factor [MulOp Factor]... Factor -> Designator ['(' ExprList ')'] -> '@' Designator -> Number -> String -> NIL -> '(' Expression ')' -> NOT Factor -> SetConstructor -> TypeId '(' Expression ')' RelOp -> '>' -> '<' -> '<=' -> '>=' -> '<>' -> IN -> IS -> AS + -> '=' AddOp -> '+' -> '-' -> OR -> XOR MulOp -> '*' -> '/' -> DIV -> MOD -> AND -> SHL -> SHR Designator -> QualId ['.' Ident | '[' ExprList ']' | '^']... SetConstructor -> '[' [SetElement ','...] ']' SetElement -> Expression ['..' Expression] ExprList -> Expression ','... Statement -> [LabelId ':'] [SimpleStatement | StructStmt] StmtList -> Statement ';'... SimpleStatement -> Designator ['(' ExprList ')'] -> Designator ':=' Expression -> INHERITED -> GOTO LabelId StructStmt -> CompoundStmt -> ConditionalStmt -> LoopStmt -> WithStmt CompoundStmt -> BEGIN StmtList END ConditionalStmt -> IfStmt -> CaseStmt IfStmt -> IF Expression THEN Statement [ELSE Statement] CaseStmt -> CASE Expression OF CaseSelector ';'... [ELSE StmtList] [';'] END CaseSelector -> CaseLabel ','... ':' Statement CaseLabel -> ConstExpr ['..' ConstExpr] LoopStmt -> RepeatStmt -> WhileStmt -> ForStmt RepeatStmt -> REPEAT Statement UNTIL Expression WhileStmt -> WHILE Expression DO Statement ForStmt -> FOR QualId ':=' Expression (TO | DOWNTO) Expression DO Statement WithStmt -> WITH IdentList DO Statement ProcedureDeclSection -> ProcedureDecl -> FunctionDecl ProcedureDecl -> ProcedureHeading ';' [Directive] Block ';' FunctionDecl -> FunctionHeading ';' [Directive] Block ';' FunctionHeading -> FUNCTION Ident [FormalParameters] ':' (SimpleType | STRING) ProcedureHeading -> PROCEDURE Ident [FormalParameters] FormalParameters -> '(' FormalParm ';'... ')' FormalParm -> [VAR | CONST | OUT] Parameter Parameter -> IdentList [':' ([ARRAY OF] SimpleType | STRING | FILE)] -> Ident ':' SimpleType '=' ConstExpr Directive -> CDECL -> REGISTER -> DYNAMIC -> VIRTUAL -> EXPORT -> EXTERNAL -> FAR -> FORWARD -> MESSAGE -> OVERRIDE -> OVERLOAD -> PASCAL -> REINTRODUCE -> SAFECALL -> STDCALL ObjectType -> OBJECT [ObjHeritage] [ObjFieldList] [MethodList] END ObjHeritage -> '(' QualId ')' MethodList -> (MethodHeading [';' VIRTUAL]) ';'... MethodHeading * -> [CLASS] ProcedureHeading * -> [CLASS] FunctionHeading -> ConstructorHeading -> DestructorHeading ConstructorHeading -> CONSTRUCTOR Ident [FormalParameters] DestructorHeading -> DESTRUCTOR Ident [FormalParameters] ObjFieldList -> (IdentList ':' Type) ';'... InitSection -> INITIALIZATION StmtList [FINALIZATION StmtList] END -> BEGIN StmtList END -> END ClassType -> CLASS [ClassHeritage] [ClassFieldList] [ClassMethodList] [ClassPropertyList] END ClassHeritage -> '(' IdentList ')' ClassVisibility -> [PUBLIC | PROTECTED | PRIVATE | PUBLISHED] ClassFieldList -> (ClassVisibility ObjFieldList) ';'... ClassMethodList -> (ClassVisibility MethodList) ';'... ClassPropertyList -> (ClassVisibility PropertyList ';')... PropertyList -> PROPERTY Ident [PropertyInterface] PropertySpecifiers PropertyInterface -> [PropertyParameterList] ':' Ident PropertyParameterList -> '[' (IdentList ':' TypeId) ';'... ']' PropertySpecifiers -> [INDEX ConstExpr] [READ Ident] [WRITE Ident] [STORED (Ident | Constant)] [(DEFAULT ConstExpr) | NODEFAULT] [IMPLEMENTS TypeId] InterfaceType -> INTERFACE [InterfaceHeritage] [ClassMethodList] [ClassPropertyList] END InterfaceHeritage -> '(' IdentList ')' RequiresClause -> REQUIRES IdentList... ';' ContainsClause -> CONTAINS IdentList... ';' IdentList -> Ident ','... QualId -> [UnitId '.'] Ident TypeId -> [UnitId '.'] Ident -> ConstExpr -> UnitId -> LabelId -> Number -> String -> * Version FR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - But -> (Programme | Paquet | Bibliothèque | Unité) Programme -> [PROGRAM Ident ['(' ListeIdent ')'] ';'] BlocProgramme '.' Unité -> UNIT Ident [DirectivePortabilité] ';' SectionInterface SectionImplémentation SectionInit '.' Paquet -> PACKAGE Ident ';' [ClauseRequires] [ClauseContains] END '.' Bibliothèque -> LIBRARY Ident ';' BlocProgramme '.' BlocProgramme -> [ClauseUses] Bloc ClauseUses -> USES ListeIdent ';' DirectivePortabilité -> platform -> deprecated -> library SectionInterface -> INTERFACE [ClauseUses] [DéclInterface]... DéclInterface -> SectionConst -> SectionType -> SectionVar -> EnTêteExportation EnTêteExportation -> EnTêteProcédure ';' [Directive] -> EnTêteFonction ';' [Directive] SectionImplémentation -> IMPLEMENTATION [ClauseUses] [SectionDécl]... [InstructionExports]... Bloc -> [SectionDécl] [InstructionExports]... InstructionComposée [InstructionExports]... InstructionExports -> EXPORTS ElémentExports [, ElémentExports]... ElémentExports -> Ident [NOM|INDICE "'" ExprConst "'"] [INDICE|NOM "'" ExprConst "'"] SectionDécl -> SectionDéclLabel -> SectionConst -> SectionType -> SectionVar -> SectionDéclProc SectionDéclLabel -> LABEL IdentLabel SectionConst -> CONST (DéclConstant ';')... DéclConstant -> Ident '=' ExprConst [DirectivePortabilité] -> Ident ':' IdentType '=' ConstanteTypée [DirectivePortabilité] SectionType -> TYPE (DéclType ';'). DéclType -> Ident '=' [TYPE] Type [DirectivePortabilité] -> Ident '=' [TYPE] TypeRestreint [DirectivePortabilité] ConstanteTypée -> (ExprConst | ConstanteTableau | ConstanteEnregistrement) ConstanteTableau -> '(' ConstanteTypée ',' ')' ConstanteEnregistrement -> '(' ConstChampEnreg ';'... ')' ConstChampEnreg -> Ident ':' ConstanteTypée Type -> IdentType -> TypeSimple -> TypeStruc -> TypePointeur -> TypeChaîne -> TypeProcédure -> TypeVariant -> TypeRefClass TypeRestreint -> TypeObjet -> TypeClasse -> TypeInterface TypeRefClass -> CLASS OF IdentType TypeSimple -> (TypeScalaire | TypeRéel) TypeRéel -> REAL48 -> REAL -> SINGLE -> DOUBLE -> EXTENDED -> CURRENCY -> COMP TypeScalaire -> (TypeIntervalle | TypeEnum | IdentScalaire) IdentScalaire -> SHORTINT -> SMALLINT -> INTEGER -> BYTE -> LONGINT -> INT64 -> WORD -> BOOLEAN -> CHAR -> WIDECHAR -> LONGWORD -> PCHAR TypeVariant -> VARIANT -> OLEVARIANT TypeIntervalle -> ExprConst '..' ExprConst TypeEnum -> '(' ElémentTypeEnum ','... ')' ElémentTypeEnum -> Ident [ '=' ExprConst ] TypeChaîne -> STRING -> ANSISTRING -> WIDESTRING -> STRING '[' ExprConst ']' TypeStruc -> [PACKED] (TypeTableau | TypeEnsemble | TypeFichier | TypeEnreg [PACKED]) TypeTableau -> ARRAY ['[' TypeScalaire ','... ']'] OF Type [DirectivePortabilité] TypeEnreg -> RECORD [ListeChamp] END [DirectivePortabilité] ListeChamp -> DéclChamp ';'... [SectionVariable] [';'] DéclChamp -> ListeIdent ':' Type [DirectivePortabilité] SectionVariant -> CASE [Ident ':'] IdentType OF VariantEnreg ';'... VariantEnreg -> ExprConst ','... ':' '(' [ListeChamp] ')' TypeEnsemble -> SET OF TypeScalaire [DirectivePortabilité] TypeFichier -> FILE OF IdentType [DirectivePortabilité] TypePointeur -> '^' IdentType [DirectivePortabilité] TypeProcédure -> (EnTêteProcédure | EnTêteFonction) [OF OBJECT] SectionVar -> VAR (DéclVar ';')... DéclVar Sur Windows -> ListeIdent ':' Type [(ABSOLUTE (Ident | ExprConst)) | '=' ExprConst] [DirectivePortabilité] Sur Linux -> ListeIdent ':' Type [ABSOLUTE (Ident) | '=' ExprConst] [DirectivePortabilité] Expression -> ExpressionSimple [OpRel ExpressionSimple]... ExpressionSimple -> ['+' | '-'] Terme [OpAdd Terme]... Terme -> Facteur [OpMul Facteur]... Facteur -> Désignateur ['(' ListeExpr ')'] -> '@' Désignateur -> Nombre -> Chaîne -> NIL -> '(' Expression ')' -> NOT Facteur -> ConstructeurEnsemble -> IdentType '(' Expression ')' OpRel -> '>' -> '<' -> '<=' -> '>=' -> '<>' -> IN -> IS -> AS OpAdd -> '+' -> '-' -> OR -> XOR OpMul -> '*' -> '/' -> DIV -> MOD -> AND -> SHL -> SHR Désignateur -> IdentQualif ['.' Ident | '[' ListeExpr ']' | '^']... ConstructeurEnsemble -> '[' [ElémentEnsemble ','...] ']' ElémentEnsemble -> Expression ['..' Expression] ListeExpr -> Expression ','... Instruction -> [IdentLabel ':'] [InstructionSimple | InstructionStructurée] ListeInstructions -> Instruction ';' InstructionSimple -> Désignateur ['(' [ListeExpr] ')'] -> Désignateur ':=' Expression -> INHERITED -> GOTO IdentLabel InstructionStructurée -> InstructionComposée -> InstructionCondition -> InstructionBoucle -> InstructionWith -> InstructionTryExcept -> InstructionTryFinally -> InstructionRaise -> InstructionAssembleur InstructionComposée -> BEGIN ListeInstructions END InstructionCondition -> InstructionIf -> InstructionCase InstructionIf -> IF Expression THEN Instruction [ELSE Instruction] InstructionCase -> CASE Expression OF SélecteurCase ';'... [ELSE ListeInstructions] [';'] END SélecteurCase -> LabelCase ','... ':' Instruction LabelCase -> ExprConst ['..' ExprConst] InstructionBoucle -> InstructionRepeat -> InstructionWhile -> InstructionFor InstructionRepeat -> REPEAT Instruction UNTIL Expression InstructionWhile -> WHILE Expression DO Instruction InstructionFor -> FOR IdentQualif ':=' Expression (TO | DOWNTO) Expression DO Instruction InstructionWith -> WITH ListeIdent DO Instruction InstructionTryExcept -> TRY Instruction... EXCEPT BlocException END BlocException -> [ON [Ident ':'] IDType DO Instruction]... [ELSE Instruction...] InstructionTryFinally -> TRY Instruction FINALLY Instruction END InstructionRaise -> RAISE [objet] [AT adresse] InstructionAssembleur -> ASM -> -> END SectionDéclProc -> DéclProcédure -> DéclFonction # # SecDéclProcédure -> DéclProcédure # -> DéclFonction # DéclProcédure -> EnTêteProcédure ';' [Directive] [DirectivePortabilité] Bloc ';' DéclFonction -> EnTêteFonction ';' [Directive] [DirectivePortabilité] Bloc ';' EnTêteFonction -> FUNCTION Ident [ParamètresFormels] ':' (TypeSimple | STRING) EnTêteProcédure -> PROCEDURE Ident [ParamètresFormels] ParamètresFormels -> '(' ParamètreFormel ';'... ')' ParamètreFormel -> [VAR | CONST | OUT] Paramètre Paramètre -> ListeIdent [':' ([ARRAY OF] TypeSimple | STRING | FILE)] -> Ident ':' TypeSimple '=' ExprConst Directive -> CDECL -> REGISTER -> DYNAMIC -> VIRTUAL -> EXPORT -> EXTERNAL -> NEAR -> FAR -> FORWARD -> MESSAGE ConstExpr -> OVERRIDE -> OVERLOAD -> PASCAL -> REINTRODUCE -> SAFECALL -> STDCALL -> VARARGS -> LOCAL -> ABSTRACT TypeObjet -> OBJECT [HéritageObjet] [ListeChampObjet] [ListeMéthode] END HéritageObjet -> '(' IdentQualif ')' ListeMéthode -> (EnTêteMéthode [';' VIRTUAL]) ';'... EnTêteMéthode -> [class] EnTêteProcédure -> [class] EnTêteFonction -> EnTêteConstructeur -> EnTêteDestructeur EnTêteConstructeur -> CONSTRUCTOR Ident [ParamètresFormels] EnTêteDestructeur -> DESTRUCTOR Ident [ParamètresFormels] ListeChampObjet -> (ListeIdent ':' Type) ';' SectionInit -> INITIALIZATION ListeInstructions [FINALIZATION ListeInstructions] END -> BEGIN ListeInstructions END -> END TypeClasse -> CLASS [HéritageClasse] [VisibilitéClasse] [ListeChampClasse] [ListeMéthodeClasse] [ListePropriétéClasse] END HéritageClasse -> '(' ListeIdent ')' VisibilitéClasse -> [PUBLIC | PROTECTED | PRIVATE | PUBLISHED] ListeChampClasse -> (VisibilitéClasse ListeChampObjet) ';'... ListeMéthodeClasse -> (VisibilitéClasse ListeMéthode) ';'... ListePropriétéClasse -> (VisibilitéClasse ListePropriété ';')... ListePropriété -> PROPERTY Ident [InterfacePropriété] [SpécificateursPropriété] [DirectivePortabilité] InterfacePropriété -> [ListesParamètrePropriété] ':' Ident ListesParamètrePropriété-> '[' (ListeIdent ':' IdentType) ';'... ']' SpécificateursPropriété -> [INDEX ExprConst] [READ Ident] [WRITE Ident] [STORED (Ident | Constante)] [(DEFAULT ExprConst) | NODEFAULT] [IMPLEMENTS IdentType] TypeInterface -> INTERFACE [HéritageInterface] [ListeMéthodeClasse] [ListePropriétéClasse]... END HéritageInterface -> '(' ListeIdent ')' ClauseRequires -> REQUIRES ListeIdent... ';' ClauseContains -> CONTAINS ListeIdent... ';' ListeIdent -> Ident ','... IdentQualif -> [IdentUnité '.'] Ident IdentType -> [IdentUnité '.'] Ident -> ExprConst -> IdentUnité -> IdentLabel -> Nombre -> Chaîne ->