kdev-pg: Stars and pluses

Roberto Raggi roberto at kdevelop.org
Mon Feb 6 10:11:08 UTC 2006


Hi!

On Sunday 05 February 2006 19:55, Jakob Petsovits wrote:
> On Wednesday, 14. December 2005 16:55, Roberto Raggi wrote:
> > I think i will replace the symbol "!" with "+".... but not today :-)
>
> I thought maybe this would be a good task to start with.
> As a result, the attached patch replaces !(...) (one or more items)
> with (...)+ which brings kdev-pg closer to common EBNF notation.
> Additionally, I reactivated the old !(...) semantics (zero or more items)
> and added (...)* as well.
great!

>
> The patch adapts the grammar parser, renames all "bang" occurrences to
> "plus" and introduces "star" as a part of the parse tree. The star operator
> could have been done also by transforming it to ( (...)+ | 0 ) in the
> grammar parser, but having a seperate element brings flexibility in future
> condition-item enhancements and beautifies warnings and generated code. Ah,
> generated code: (...)+ is now done as do-while loop instead of the normal
> while loop, which improves correctness for some rare (but existing) cases.
>
> I have adapted the grammars in SVN to the new syntax in my working copy,
> so those can be committed right away as well. Ok to apply?
I'm all for it

> P.S.: Do we also want a question item? Does it make sense to make it a new
> tree item as well? Why is it commented out in the current parser?
yeap! in future we'll use "question items" to implement LL(k)

ciao robe





More information about the KDevelop-devel mailing list