Sections 5.5.2 and 6.6.8 of the FreePascal Language Reference discuss the "inherited" keyword, but I couldn't find it in the syntax diagrams. Sections 12.2 and 13.1.2. have

procedure-statement = ( procedure-identifier | method-identifier | qualified-method-identifier | variable-reference ) [ actual-parameter-list ] . function-call = ( function-identifier | method-designator | qualified-method-designator | variable-reference ) [ actual-parameter-list ] .

This can be changed to

        procedure-reference = qualified-identifier | procedure-identifier | 
variable-reference .
        function-reference = qualified-identifier | function-identifier | 
variable-reference .
procedure-statement = ( "inherited" [ procedure-reference ] | procedure-reference ) [ actual-parameter-list ] . function-call = ( "inherited" [ function-reference ] | function-reference ) [ actual-parameter-list ] .

That adds the "inherited" keyword, but doesn't include, for example, identifier-casts. The problem with identifier casts is that, grammatically, a cast can not be distinguished from a function call. Therefore, the cast has to be treated, in the grammar, as a (one-parameter) function call.

So, things are more complex that indicated above. A solution may be along the line of what UCSD-Pascal defines ....

        selector = "[" expression { "," expression } "]" | "." identifier | "^" 
.
        variable = identifier { selector } .

Regards,

Adriaan van Os

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to