From: joel de guzman (joel_at_[hidden])
Date: 2001-05-23 08:56:57
----- Original Message -----
From: "Vladimir Prus" :
> I think that to make futher discussion of Spring usefull, we should first
> all agree on some points.
> 1. Potential scope
> I have already said that Sprint is unfit for large grammars. The author
> "Sure a C++ grammar would most probably choke the parser". It is therefore
> necessary to establish which grammars are suitable. This can be done
> experiment only.
> Joel, could you make some more grammars and give performance results
> compared with traditional parsers, time needed to write and debug parsers,
> and so on?
> (Besides, your code fails to compile under g++ 3.0 and bcc 5.5.1).
My first priority is to compile Spirit with g++ and bcc. Could you give
me a hint on what errors are reported? I tried hard to make the
code c++ standard compliant. I am using Metrowerks CodeWarrior 5.x.
The code relies heavily on member templates and partial specializations.
I'd appreciate help on porting to other platforms.
As for more grammars and performance analysis, that would involve
more time. But certainly that's something I intend to do.
Scope? Well admittedly, the original intent of Spirit is for small to
medium sized grammars. Internet protocols, files, html, xml, scripting
languages, possibly basic variants, pascal variants, pre-processors,
resource description, lexers, and yes I intend to use Spirit as an engine
for another parser.
Hey don't forget micro-parsers as Vesa Karvonen pointed out.
Also, the parser is a library not a separate application. This is a very
important factor. Finally, the ability to define a parser using straight c++
BTW, could you give me a parser that does not choke on C++?
In any case, I believe the future trend is towards simpler grammars.
It's just too difficult to parse C++ even with current generation tools.
> 2. Syntax
> Proposed syntax has prefix "*" and "+". This is likely to confuse anyone
> knows what EBNF is. Reuben Fries and later David Abrahams have already
> proposed different syntax. Is it better? I tend to say "yes".
I disagree. The iterator syntax, apart from being more verbose (and clutters
the grammar), requires more time to comprehend. I'd say go for both. I tend
to agree on the infix + instead of >> for sequencing though.
> 3. Possible extensions
> Douglas Gregor's idea of compiling Sprint expression looks very neat. I
> that if some automata building libary is available, it can be easily
> accomplished. However, such a library should be completely independent
Agreed. this is a really cool avenue to explore.
Thanks for your comments, Vladimir.
Joel de Guzman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk