digitalmars.D.announce - FancyPars
- Stefan Koch (8/8) Jul 02 2015 Small announcement.
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (2/5) Jul 06 2015 How does its design and use differ from Pegged?
- Stefan Koch (4/10) Jul 16 2015 The use does not really differ.
- Bastiaan Veelo (81/82) Sep 14 2015 FWIW, this is what I learned from my first acquaintance with
- Rory McGuire via Digitalmars-d-announce (11/88) Sep 14 2015 Nice one, thanks for the info.
- Stefan Koch (21/33) Sep 16 2015 Sorry about that.
- Bastiaan Veelo (26/50) Sep 16 2015 Thanks. At first I thought that
- Stefan Koch (8/16) Sep 17 2015 fancyPars has gone through a few iterations.
- Stefan Koch (5/6) Sep 05 2015 Nontheless an unexpected update that makes FancyPars more
- Bastiaan Veelo (10/14) Sep 06 2015 Interesting.
- Stefan Koch (3/5) Sep 06 2015 Ahh yeah it should be 2.066.1
- Bastiaan Veelo (7/8) Sep 16 2015 Sounds like you want to share this, but I can't find a licence.
- Stefan Koch (7/13) Sep 17 2015 I am not sure.
- John Colvin (2/19) Sep 17 2015 Yikes. Are you sure? Are you familiar with open source licensing?
- Stefan Koch (4/6) Sep 17 2015 I would be open to open-source the "base" of fp.
- John Colvin (5/12) Sep 17 2015 Assuming you wrote it all, you can license the code in whatever
- Stefan Koch (13/17) Sep 17 2015 Hmm reading this. No license, is best for now.
- Bastiaan Veelo (26/42) Sep 17 2015 Take your time, but without a license anyone cloning or forking
- Ben Boeckel via Digitalmars-d-announce (4/11) Sep 17 2015 By using public repos, you explicitly allow anyone to view and fork your
- Bastiaan Veelo (5/18) Sep 18 2015 You are correct [1], thanks. But I still will have to delete
- Rory McGuire via Digitalmars-d-announce (6/18) Sep 17 2015 There is also no implicit rights if you provide pull requests for said r...
- Stefan Koch (9/12) Sep 18 2015 No worries!
- Bastiaan Veelo (3/6) Sep 18 2015 Great! Looking forward to that.
- Ben Boeckel via Digitalmars-d-announce (5/8) Sep 17 2015 FYI, that's not FOSS. Please consider using a LICENSE file which
Small announcement. I uploaded my parser-generator onto github. It is work in progress and unfinished! I cannot continue working on it anymore. Because it is quite idiomatic D-code. I hope that it will be suitable to beginners. Unfortunately I will not be available to take any questions. Repo-Location : https://github.com/UplinkCoder/fancypars-lite
Jul 02 2015
On Thursday, 2 July 2015 at 14:25:09 UTC, Stefan Koch wrote:Small announcement. I uploaded my parser-generator onto github. It is work in progress and unfinished!How does its design and use differ from Pegged?
Jul 06 2015
On Monday, 6 July 2015 at 09:22:51 UTC, Per Nordlöw wrote:On Thursday, 2 July 2015 at 14:25:09 UTC, Stefan Koch wrote:The use does not really differ. The Design however is very diffrent. instead of templates it generates CTFEable Functions.Small announcement. I uploaded my parser-generator onto github. It is work in progress and unfinished!How does its design and use differ from Pegged?
Jul 16 2015
On Monday, 6 July 2015 at 09:22:51 UTC, Per Nordlöw wrote:How does its design and use differ from Pegged?FWIW, this is what I learned from my first acquaintance with FancyPars (the OP having signalled not to be available for questions). My conclusions may be wrong though. Running dub produces a vibe.d web server demonstrating the capabilities of FancyPars. This was a bit confusing at first because being a web-app seemed central to the design of FancyPars, but I think it is not. Anyway, the first page shows a large edit field containing an example grammar, and a button "Generate AST". Clicking this button brings up the second page containing D code for the lexer and parser for the given grammar, type definitions for the nodes of the AST, as well as code for printing the AST. 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. 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: ASTNode { Identifier internal { [a-zA-Z_][] identifier } Group parent { Identifier name, ? " " : Identifier[] annotations : " ", "{", PatternElement[] elements : "," / Group[] groups, "}" } PatternElement internal { AlternativeElement noFirst { PatternElement[] alternatives : "/" } LexerElement { StringElement { "\"", char[] string_, "\"" } NamedChar { "char", ? "[]" : bool isArray, Identifier name } CharRange internal { char rangeBegin, ? "-" : char RangeEnd } RangeElement { "[", CharRange[] ranges, "]" } LookbehindElement { "?lb", "(", StringElement str, ")" } NotElement { "!", LexerElement ce } } NamedElement { Identifier type, ? "[]" : bool isArray, Identifier name, ? bool isArray : ? ":" : StringElement lst_sep } ParenElement { "(", PatternElement[] elements : ",", ")" } FlagElement { "bool", Identifier flag_name } QueryElement { "?", "bool", Identifier flag_name, ":", PatternElement elem } OptionalElement { "?", LexerElement[] ce : ",", ":", PatternElement elem } } } 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. Cheers, Bastiaan Veelo.
Sep 14 2015
Nice one, thanks for the info. I just used Pegged to generate an API for a JSON REST service at compile time so I'm still geeking out about the power of D at compile time, but I'm always interested in parsers. On Mon, Sep 14, 2015 at 10:50 AM, Bastiaan Veelo via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:On Monday, 6 July 2015 at 09:22:51 UTC, Per Nordl=C3=B6w wrote:nsHow does its design and use differ from Pegged?FWIW, this is what I learned from my first acquaintance with FancyPars (the OP having signalled not to be available for questions). My conclusio=may be wrong though. Running dub produces a vibe.d web server demonstrating the capabilities o=fFancyPars. This was a bit confusing at first because being a web-app seem=edcentral to the design of FancyPars, but I think it is not. Anyway, the first page shows a large edit field containing an example grammar, and a button "Generate AST". Clicking this button brings up the second page containing D code for the lexer and parser for the given grammar, type definitions for the nodes of the AST, as well as code for printing the AS=T.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. 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: ASTNode { Identifier internal { [a-zA-Z_][] identifier } Group parent { Identifier name, ? " " : Identifier[] annotations : " ", "{", PatternElement[] elements : "," / Group[] groups, "}" } PatternElement internal { AlternativeElement noFirst { PatternElement[] alternatives : "/" } LexerElement { StringElement { "\"", char[] string_, "\"" } NamedChar { "char", ? "[]" : bool isArray, Identifier name } CharRange internal { char rangeBegin, ? "-" : char RangeEnd } RangeElement { "[", CharRange[] ranges, "]" } LookbehindElement { "?lb", "(", StringElement str, ")" } NotElement { "!", LexerElement ce } } NamedElement { Identifier type, ? "[]" : bool isArray, Identifier name, ? bool isArray : ? ":" : StringElement lst_sep } ParenElement { "(", PatternElement[] elements : ",", ")" } FlagElement { "bool", Identifier flag_name } QueryElement { "?", "bool", Identifier flag_name, ":", PatternElement elem } OptionalElement { "?", LexerElement[] ce : ",", ":", PatternElement elem } } } 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 Extende=dPascal to D translating compiler would be feasible. Cheers, Bastiaan Veelo.
Sep 14 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 ASTThe 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
Sep 16 2015
On Wednesday, 16 September 2015 at 20:17:15 UTC, Stefan Koch wrote:On Monday, 14 September 2015 at 08:50:48 UTC, Bastiaan Veelo wrote:Thanks. At first I thought that fancy_[ast|token|lexer|parser|printer].d were generated files because their content is so similar to the code produced in the vibe application. But on closer look I think it is the other way around: that the example grammar in vibe describes its own input format, and that the similarity in the produced output to said files is an illustration that it works the way it should. Am I close?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 ASTThe 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.Wow that is great news! Not so abandoned after all :-)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.Please have a look in https://www.dropbox.com/sh/k0ewq4dkz0q009v/AADq5V6j5lPBfBkmpwIpkMq8a?dl=0 p2d.d is my dance with Pegged, containing a subset of the Extended Pascal grammar. It was only after typing close to 400 lines of grammar that I discovered left-recursions, which are commented out. These put a spanner in the works, but before that I felt this could go somewhere: even comments are translated. There are many recursions in the complete grammar, for which you find the specification in the PDF. (This is the ANSI/IEEE standard; Extended Pascal became an ISO standard a year or so later, with identical text.) Note the alphabetical list of EBNF starting on page 129; the numbers in front refer to the corresponding section.Thanks for the interest.Thanks for finding the time for this. Bastiaan.
Sep 16 2015
On Wednesday, 16 September 2015 at 21:25:40 UTC, Bastiaan Veelo wrote:Thanks. At first I thought that fancy_[ast|token|lexer|parser|printer].d were generated files because their content is so similar to the code produced in the vibe application. But on closer look I think it is the other way around: that the example grammar in vibe describes its own input format, and that the similarity in the produced output to said files is an illustration that it works the way it should. Am I close?fancyPars has gone through a few iterations. I used fancyPars to generate a parser for itself and then fixed up the things that fancyPars cannot yet generate. I eat my own dogfood! Thanks for the pascal specs and your p2d.d I will see what I can do about that.
Sep 17 2015
On Thursday, 2 July 2015 at 14:25:09 UTC, Stefan Koch wrote:I cannot continue working on it anymore.Nontheless an unexpected update that makes FancyPars more Feature-complete than than Pegged. I addded simplistic Left Recursion handling... but the code is a mess :(
Sep 05 2015
On Saturday, 5 September 2015 at 19:45:09 UTC, Stefan Koch wrote:On Thursday, 2 July 2015 at 14:25:09 UTC, Stefan Koch wrote: I addded simplistic Left Recursion handling...Interesting. From the readme:it only compiles with dmd 2.0.66.2 because it exploits a bug in the const-ness type-systemHowever, 2.0.66.2 does not seem to exist [1,2]. Am I overlooking something? Best, Bastiaan. [1] http://downloads.dlang.org/releases/2.x/ [2] https://github.com/D-Programming-Language/dmd/releases?after=v2.067.1-b1
Sep 06 2015
On Sunday, 6 September 2015 at 20:23:40 UTC, Bastiaan Veelo wrote:However, 2.0.66.2 does not seem to exist [1,2]. Am I overlooking something?Ahh yeah it should be 2.066.1 Thanks for catching that
Sep 06 2015
On Thursday, 2 July 2015 at 14:25:09 UTC, Stefan Koch wrote:I hope that it will be suitable to beginners.Sounds like you want to share this, but I can't find a licence. In case this turns out to be useful, we would need one :-) If you want I can prepare a PR for that, just let me know which licence to pick. Best, Bastiaan.
Sep 16 2015
On Wednesday, 16 September 2015 at 12:16:03 UTC, Bastiaan Veelo wrote:Sounds like you want to share this, but I can't find a licence. In case this turns out to be useful, we would need one :-) If you want I can prepare a PR for that, just let me know which licence to pick. Best, Bastiaan.I am not sure. The source should not be used in any product without my explicit permission. However you may study it to get better in your understanding of dlang or parser technology
Sep 17 2015
On Thursday, 17 September 2015 at 15:47:42 UTC, Stefan Koch wrote:On Wednesday, 16 September 2015 at 12:16:03 UTC, Bastiaan Veelo wrote:Yikes. Are you sure? Are you familiar with open source licensing?Sounds like you want to share this, but I can't find a licence. In case this turns out to be useful, we would need one :-) If you want I can prepare a PR for that, just let me know which licence to pick. Best, Bastiaan.I am not sure. The source should not be used in any product without my explicit permission. However you may study it to get better in your understanding of dlang or parser technology
Sep 17 2015
On Thursday, 17 September 2015 at 16:02:14 UTC, John Colvin wrote:Yikes. Are you sure? Are you familiar with open source licensing?I would be open to open-source the "base" of fp. but keeping certin extentions for grammar analysis closed. What license would you suggest for that.
Sep 17 2015
On Thursday, 17 September 2015 at 16:33:12 UTC, Stefan Koch wrote:On Thursday, 17 September 2015 at 16:02:14 UTC, John Colvin wrote:Assuming you wrote it all, you can license the code in whatever way you want. See http://choosealicense.com for more info. You can even use multiple licenses, or different licenses for different parts of the code.Yikes. Are you sure? Are you familiar with open source licensing?I would be open to open-source the "base" of fp. but keeping certin extentions for grammar analysis closed. What license would you suggest for that.
Sep 17 2015
On Thursday, 17 September 2015 at 16:55:42 UTC, John Colvin wrote:Assuming you wrote it all, you can license the code in whatever way you want. See http://choosealicense.com for more info. You can even use multiple licenses, or different licenses for different parts of the code.Hmm reading this. No license, is best for now. Bastian The FancyPars Grammar for pascal will look very very different from what you wrote. In FancyPars Grammars I worked very hard to avoid repetitions. FGPs do not just describe the language grammar. They are describing the AST-Structure. So just by reading the grammar a person working with the AST will know what is what and in which members-variables of the AST-Node which information is stored. I would recommed you open issues in the FancyPars-repo for stuff that is hard to understand.
Sep 17 2015
On Thursday, 17 September 2015 at 20:32:59 UTC, Stefan Koch wrote:On Thursday, 17 September 2015 at 16:55:42 UTC, John Colvin wrote:Take your time, but without a license anyone cloning or forking your repo is in fact violating your copyright. It is not what most people expect on github, and I will have to delete my fork and local clone...Assuming you wrote it all, you can license the code in whatever way you want. See http://choosealicense.com for more info. You can even use multiple licenses, or different licenses for different parts of the code.Hmm reading this. No license, is best for now.Bastiaan The FancyPars Grammar for pascal will look very very different from what you wrote. In FancyPars Grammars I worked very hard to avoid repetitions. FGPs do not just describe the language grammar. They are describing the AST-Structure. So just by reading the grammar a person working with the AST will know what is what and in which members-variables of the AST-Node which information is stored.I can see the value of that when designing a grammar, or building a translator. In my case though the grammar was standardised a quarter of a century ago, and available in BNF. Redefining the complete language in FPG by hand would be interesting but time consuming and error prone -- not sure that would pay in the end. Maybe writing a BNF2FPG transcompiler would get me there faster... But, without a license I am prohibited from experimenting with it. Even with permission for educational purposes or the like, which I think you have implied, I am not sure that I will be allowed to construct a transcompiler intended for the translation of proprietary source in the end. I am afraid I can't afford the time to investigate the possibilities of FancyPars until legal uncertainties are resolved. Maybe you could consider to make the core of FancyPars Open Source with one of the mainstream licenses, without further restrictions. The parts that you want to keep proprietary I would not publish at all. That way, if somebody else decides to write an analyser, he will not risk infringing the copyright of your closed source, because it is not publicly viewable. Best, Bastiaan.
Sep 17 2015
On Thu, Sep 17, 2015 at 23:40:49 +0000, Bastiaan Veelo via Digitalmars-d-announce wrote:On Thursday, 17 September 2015 at 20:32:59 UTC, Stefan Koch wrote:By using public repos, you explicitly allow anyone to view and fork your project. There are no implicit rights of *use* of that clone though. --BenHmm reading this. No license, is best for now.Take your time, but without a license anyone cloning or forking your repo is in fact violating your copyright. It is not what most people expect on github, and I will have to delete my fork and local clone...
Sep 17 2015
On Friday, 18 September 2015 at 00:30:25 UTC, Ben Boeckel wrote:On Thu, Sep 17, 2015 at 23:40:49 +0000, Bastiaan Veelo via Digitalmars-d-announce wrote:You are correct [1], thanks. But I still will have to delete mine, because it contains changes. [1] https://help.github.com/articles/open-source-licensing/#what-happens-if-i-dont-choose-a-licenseOn Thursday, 17 September 2015 at 20:32:59 UTC, Stefan Koch wrote:By using public repos, you explicitly allow anyone to view and fork your project. There are no implicit rights of *use* of that clone though.Hmm reading this. No license, is best for now.Take your time, but without a license anyone cloning or forking your repo is in fact violating your copyright. It is not what most people expect on github, and I will have to delete my fork and local clone...
Sep 18 2015
On Fri, Sep 18, 2015 at 2:30 AM, Ben Boeckel via Digitalmars-d-announce < digitalmars-d-announce puremagic.com> wrote:On Thu, Sep 17, 2015 at 23:40:49 +0000, Bastiaan Veelo via Digitalmars-d-announce wrote:There is also no implicit rights if you provide pull requests for said repo. I for one will have to delete everything I have on FancyPars and avoid, because I mix work and pleasure all the time, and I have no time in my life for lawyers, life is too short.On Thursday, 17 September 2015 at 20:32:59 UTC, Stefan Koch wrote:By using public repos, you explicitly allow anyone to view and fork your project. There are no implicit rights of *use* of that clone though. --BenHmm reading this. No license, is best for now.Take your time, but without a license anyone cloning or forking your repo is in fact violating your copyright. It is not what most people expect on github, and I will have to delete my fork and local clone...
Sep 17 2015
On Friday, 18 September 2015 at 06:13:24 UTC, Rory McGuire wrote:I for one will have to delete everything I have on FancyPars and avoid, because I mix work and pleasure all the time, and I have no time in my life for lawyers, life is too short.No worries! I will not sue anyone! of any copyright infringement or the like. I will open/source the of FancyPars. an BNF2FPG translator is possible will not be too useful. (If it does not do really significant work that is quite hard to do without deep-neural networks) That said a first step to translate existing grammars to fpg cam surely be done automatically .
Sep 18 2015
On Friday, 18 September 2015 at 14:24:09 UTC, Stefan Koch wrote:On Friday, 18 September 2015 at 06:13:24 UTC, Rory McGuire wrote: I will open/source the of FancyPars.Great! Looking forward to that. Bastiaan.
Sep 18 2015
On Thu, Sep 17, 2015 at 15:47:41 +0000, Stefan Koch via Digitalmars-d-announce wrote:I am not sure. The source should not be used in any product without my explicit permission.FYI, that's not FOSS. Please consider using a LICENSE file which explicitly states that as the case. Github is already a minefield when it comes to licensing, please don't help make it worse :) . --Ben
Sep 17 2015