FancyPars

Stefan Koch via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Sep 16 13:17:14 PDT 2015


On Monday, 14 September 2015 at 08:50:48 UTC, Bastiaan Veelo 
wrote:

> Understanding the source of FancyPars is challenging because 
> the core source, example vibe.d application source and 
> supporting code, as well as generated lexer/parser code are all 
> contained in the same directory and committed in the repository.

Sorry about that.
The Files that are really interesting are
1. fancy_grammar.d - contains helpers for working with the 
FancyParsGrammar Definition.
2. fancy_genPars.d - generates a function which parses the output 
form the generated lexer
3. fancy_genLex.d generates the lexer function.
4. fancy_genAST.d - generates the AST

> The syntax for the grammar definition is different from Pegged, 
> and seems to be inspired by D. It supports a hierarchical 
> structure. It looks powerful, but is undocumented. The example 
> grammar looks like this:

The Syntax is inspired by D and Pegged.
It is going to be extend though and you should consider it 
unstable.
I will document it as it becomes more stable.

> Its announced support for left-recursion is interesting, and I 
> may decide to play a bit further with it. My objective would be 
> to see if an Extended Pascal to D translating compiler would be 
> feasible.

TransCompilers are what fancyPars is written for.
please show me a few examples of your pascal gramamr.
might be in pegged or EBNF or something similar.

So I can see if there are idioms I should integrate in fp.

Thanks for the interest.

--
Stefan (Uplink_Coder) Koch



More information about the Digitalmars-d-announce mailing list