Boost logo

Boost Users :

From: Max Motovilov (max_at_[hidden])
Date: 2005-12-04 14:27:26


Hartmut,

> You hit the nail on the head (like we Germans say). Wave currently doesn't
> really support error recovery. The main focus of Wave was conformance and
> not usability. Adding error recovery is one of my high priority tasks for
> Wave, but I'm not sure yet how to design this.

Perhaps you could give me some insight into what is going on within Wave
context when an error condition arises? Currently I am only interested in
very common situtations, perhaps macro re-definition IS the only error
recovery case I'll ever need to support. I was thinking along the lines of
last_known_good paradigm but as I have absolutely no idea whether all
necessary state information is indeed copied along with an iterator and
which methods trigger the next_token() step, I can't do it in an intelligent
way. I guess, my questions to you would be:

- Is there any way to return the state of the Wave context back to a
specific position? I probably don't even care much if such an operation
would be expensive since error conditions like that are relatively rare in
real C++ code, as long as it is not as expensive as restarting the parsing
from the beginning.

- Which methods cause next_token() to be called? operator ==/!=, operator*,
operator++? Only some of them?

- Also, it would be nice if I could extract the cause of error at the point
where an exception is caught, but it looks like the current codebase doesn't
preserve the error itself, only severity. It would be enough for me to know
that the last two tokens consumed were <#define> and <Identifier> but since
those are processed by the Wave itself I will not know about it. So, any
suggestions how I could determine that the cause of error was indeed macro
re-definition?

A bit of background: I am trying to use Wave for a small project that might
or might not grow into something useful [e.g. for Boost] and am in no way
pressed for time, so if you think you might be able to answer some of these
concerns later, in subsequent versions of Wave, please let me know. Also I
am perfectly willing to try out any of the alpha quality (or worse :) ) code
you might be developing. My platform for this project is Visual C++ 8.0
(VStudio 2005), I don't plan to port it elsewhere until I decide the whole
thing I am trying to put together is indeed worthwhile.

Regards,
...Max...


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net