www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Goldie Parser Generator. Haxe language definition.

reply bls <bizprac orange.fr> writes:
Hi Nick, I guess :)
some questions.

Since there is no formal language description for Haxe (afaik) How do 
you implement the Gold Haxe grammar ?

It seems that Goldie grammars are very similar to BNF ( not EBNF) is 
this true ?

Since I like Haxe (at least the language, not the OCaml impl.) I would 
like to use your grammar to create a PEG port.
(based on https://github.com/PhilippeSigaud/Pegged)

So ...May I reuse your Gold Haxe grammar ?
I would like to create Haxe to D and eventually HLA translator. The 
final goal is to create a factory pattern based Haxe2XXX translator.

Bjoern..
Apr 06 2012
parent "Nick Sabalausky" <a a.a> writes:
"bls" <bizprac orange.fr> wrote in message 
news:jlnp76$2mg4$1 digitalmars.com...
 Hi Nick, I guess :)
 some questions.

 Since there is no formal language description for Haxe (afaik) How do you 
 implement the Gold Haxe grammar ?

 It seems that Goldie grammars are very similar to BNF ( not EBNF) is this 
 true ?

 Since I like Haxe (at least the language, not the OCaml impl.) I would 
 like to use your grammar to create a PEG port.
 (based on https://github.com/PhilippeSigaud/Pegged)

 So ...May I reuse your Gold Haxe grammar ?
 I would like to create Haxe to D and eventually HLA translator. The final 
 goal is to create a factory pattern based Haxe2XXX translator.

 Bjoern..

Goldie uses the exact same grammar definition language as GOLD. It is very similar to BNF, and it doesn't include repetition operators for non-terminals, but such things are easy enough to accomplish manually. The full documentation of the format is on GOLD's site here: http://goldparser.org/doc/grammars/index.htm It's also explained in Goldie's "Beginner's Tutorial" and on GOLD's "Getting Started": http://www.semitwist.com/goldie/Start/Tutorial/ http://goldparser.org/getting-started/index.htm However, I am working on a Haxe -> D converter already, called HaxeD (which uses Goldie), so the easiest thing would probably be to just use that as a starting point, or contribute pull requests: http://www.dsource.org/projects/haxed It's zlib/libpng licensed open-source (except where otherwise noted, such as JsonViewer), so you can fork it, borrow and adapt any part of it, pretty much whatever you want. It's not really usable for real Haxe programs yet, but the current state of it is explained right there on its homepage. Out of all my hobby projects, HaxeD is actually my #1 top priority at this point (real world work still takes precedence, of course). So I'm pretty committed to it. Any big gaps of time between commits are usually just due to making Goldie improvements to help with HaxeD. For example, I just finished a manic 3-week stretch fixing some embarrassing problems in Goldie's GRMC: Grammar Compiler that prevented it from handling the Haxe grammar correctly. It's fixed in Goldie's Git/BitBucket now and will be out in Goldie v0.9 hopefully pretty soon after DMD 2.059 is out. Of course, if you want to adapt the grammar for Pegged, by all means, feel free!
Apr 06 2012