kdev-pg: Stars and pluses

Jakob Petsovits jpetso at gmx.at
Sun Feb 5 20:00:10 UTC 2006


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.

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?

See you,
  Jakob

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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdev-pg-plus-and-star.diff.gz
Type: application/x-gzip
Size: 2183 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20060205/0020417c/attachment.gz>


More information about the KDevelop-devel mailing list