Sign in Join

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

Mailing lists / fpc-pascal / 2013-03

Object Pascal Grammar in EBNF like style

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I'm putting together a EBNF like syntax [not strictly EBNF] for the Object Pascal grammar, as implemented by Free Pascal, using the {$mode objfpc} compiler mode.

I'm basing the work on FPC 2.6.2 (latest released compiler). The Object Pascal grammar starts at line 5374.

https://github.com/graemeg/fpGUI/blob/master/docs/fpc_lang_ref.ipf

Any input or corrections will be much appreciated.

Known omissions I must still add:

* Generics
* Type Helpers

Is there a wiki pages which lists all new language features and syntax for FPC 2.6.2?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Sven Barth
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
Hi, I'm putting together a EBNF like syntax [not strictly EBNF] for the Object Pascal grammar, as implemented by Free Pascal, using the {$mode objfpc} compiler mode. I'm basing the work on FPC 2.6.2 (latest released compiler). The Object Pascal grammar starts at line 5374. https://github.com/graemeg/fpGUI/blob/master/docs/fpc_lang_ref.ipf Any input or corrections will be much appreciated. Known omissions I must still add: * Generics * Type Helpers

If you base the work on 2.6.2 then type helpers don't apply (only record and class helpers). Regarding generic syntax not much has changed in mode objfpc since 2.6 was branched (only Delphi mode was improved and some bugs were squashed).

Is there a wiki pages which lists all new language features and syntax for FPC 2.6.2?

There didn't happen much: http://wiki.freepascal.org/FPC_New_Features_2.6.2

Regards,
Sven

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: I'm putting together a EBNF like syntax [not strictly EBNF] for the Object Pascal…
Graeme Geldenhuys wrote 12 lines
Hi, I'm putting together a EBNF like syntax [not strictly EBNF] for the Object Pascal grammar, as implemented by Free Pascal, using the {$mode objfpc} compiler mode. I'm basing the work on FPC 2.6.2 (latest released compiler). The Object Pascal grammar starts at line 5374. https://github.com/graemeg/fpGUI/blob/master/docs/fpc_lang_ref.ipf Any input or corrections will be much appreciated.

Hm.

That looks dangerously much, almost verbatim, like the appendix A of the Delphi language guide as found in the D7 manual.

Michael.

Reply by email

Graeme Geldenhuys
to Sven Barth: If you base the work on 2.6.2 then type helpers don't apply (only record and class…
Sven Barth wrote
> * Type Helpers If you base the work on 2.6.2 then type helpers don't apply (only record and class helpers).

Good to know, thanks.

Regarding generic syntax not much has changed in mode objfpc since 2.6 was branched (only Delphi mode was improved and some bugs were squashed).

OK. The original EBNF grammar was based on Delphi 7 & Kylix 3 language features. I have since modified it to whatever language syntax has changed and features added for the last few FPC releases. So I'm not strictly comparing only changes between 2.6.0 and 2.6.2. I am looking at earlier FPC versions too.

Thanks for that. I also found the page for 2.6.0, so that will help me a lot.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Hm. That looks dangerously much, almost verbatim, like the appendix A of the Delphi…
Michael Van Canneyt wrote
That looks dangerously much, almost verbatim, like the appendix A of the Delphi language guide as found in the D7 manual.

Umm, I don't have the Delphi manuals, but I do have the Kylix 3 manuals. I see what you mean. I didn't copy it from the Kylix 3 manual though, I got it from the following URL:

http://delphi.wikia.com/wiki/Object_Pascal_Grammar

Would it make a difference though? EBNF for a language grammar should be pretty much identical to any other EBNF of the same language. The order of the definitions might change slightly, but the language grammar would still be the same.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Kenneth Cochran
to Graeme Geldenhuys

Just curious how your efforts turned out?

Graeme Geldenhuys wrote 28 lines
On 2013-03-22 13:29, Michael Van Canneyt wrote: > > That looks dangerously much, almost verbatim, like the appendix A of the > Delphi language guide as found in the D7 manual. Umm, I don't have the Delphi manuals, but I do have the Kylix 3 manuals. I see what you mean. I didn't copy it from the Kylix 3 manual though, I got it from the following URL: http://delphi.wikia.com/wiki/Object_Pascal_Grammar Would it make a difference though? EBNF for a language grammar should be pretty much identical to any other EBNF of the same language. The order of the definitions might change slightly, but the language grammar would still be the same. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Graeme Geldenhuys
to Kenneth Cochran
Kenneth Cochran wrote
Just curious how your efforts turned out?

Not much changed since that post. I've made notes [thanks to the wiki links] of what I still have missing.

The latest Language Reference doc can be downloaded in INF format (viewable with DocView - also downloadable) from this URL:

http://sourceforge.net/projects/fpgui/files/fpGUI/Documentation/docs_2013-04-20.zip/download

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email