[fpc-pascal] machine readable grammar of object pascal?

noreply at z505.com noreply at z505.com
Mon May 8 05:26:58 CEST 2017


On 2017-05-03 04:37, Michael Van Canneyt wrote:
> On Wed, 3 May 2017, denisgolovan wrote:
> 
>>> On 2017-05-03 00:53, Marc Santhoff wrote:
>>>>  Does such grammar exist?
>> 
>> Well, it depends on what you are trying to solve.
>> If you want to parse Pascal using FPC - that's one way. If you want to 
>> get some king of AST using any available [command-line] tools - that's 
>> another one.
>> 
>> Talking about latter - I would take LPEG (Lua+PEG) and create a parser 
>> myself. It comes quite simple and intuitive (contrary to 
>> LL,LR,LALR,...).
>> Most of Object Pascal is done right (minus sets/open arrays),
> 
> Add generics to the 'minus' list.

Does it take into account little bizarre things like writable consts 
(assignable consts)

like

const
   i: integer = 0;

which is like a variable, but called a const ;-)



More information about the fpc-pascal mailing list