Revision 566625

Go back to digest for 30th July 2006

Features in Development Tools

Jakob Petsovits committed changes in /branches/work/kdevelop-pg/src:

jpetso proudly presents:
...Automatic Error Recovery for kdevelop-pg!

Using this feature, a parser doesn't give up when it
encounters a parsing error. Instead, it proceeds to where
the rule could possibly go on after the recovered part,
and continues parsing from there.
(For parser junkies: it proceeds to the first found token
of the recovered item's FOLLOW set.)

Usage: (easy!)
Wrap your favorite optional items into recover(...).
Like, "(#stmt=statement)*" becomes "recover(#stmt=statement)*".

Note that the star should be outside of recover(...),
otherwise you'd only recover at the end of all statements
and the parser would not try for another statement.

Also contained in this commit:
* A fix for the FOLLOW set calculation for star and plus items
* Generating a few more newlines for better readability

File Changes

Modified 19 files
  • /branches/work/kdevelop-pg/src
  •   /kdev-pg-ast.h
  •   /kdev-pg-clone-tree.cpp
  •   /kdev-pg-clone-tree.h
  •   /kdev-pg-code-gen.cpp
  •   /kdev-pg-code-gen.h
  •   /kdev-pg-default-visitor.cpp
  •   /kdev-pg-default-visitor.h
  •   /kdev-pg-first.cpp
  •   /kdev-pg-first.h
  •   /kdev-pg-follow.cpp
  •   /kdev-pg-follow.h
  •   /kdev-pg-lexer.ll
  •   /kdev-pg-parser.yy
  •   /kdev-pg-pretty-printer.cpp
  •   /kdev-pg-pretty-printer.h
  •   /kdev-pg-visitor.cpp
  •   /kdev-pg-visitor.h
  •   /kdev-pg.cpp
  •   /kdev-pg.h
19 files changed in total