Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-12

inherited

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

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

Reply by email