Loading ...
Sorry, an error occurred while loading the content.
 

Re: [antlr-interest] Including Exception headers (C++)

Expand Messages
  • Ric Klaren
    ... Yup.. ... It s probably a good idea to have a catch all in your main program. You never know when something unexected might be thrown, that way it may at
    Message 1 of 4 , Feb 8, 2001
      On Thu, Feb 01, 2001 at 03:29:09PM +1000, John Green wrote:
      > I found that some of the Exception headers are generated into the
      > lexer.cpp file instead of the lexer.hpp file. So if you include lexer.hpp
      > into your main.cpp, you won't necessarily be getting the Exception
      > definitions that you might throw at it.

      Yup..

      > As a newbie to C++, it took me a while to figure out that this was the
      > source of the Windows "This program has performed an illegal operation..."
      > error that I was getting.

      It's probably a good idea to have a catch all in your main program. You
      never know when something unexected might be thrown, that way it may at
      least be handled somewhat more gracefull than just dying.

      > Would it make sense to generate the #include *Exception lines into the hpp
      > files instead of into the cpp files? Or is there something better that could
      > be done to save other new users from the same confusion that I just went
      > through?

      I'm usually not such a fan of including anything you can include in
      headerfiles. It usually makes it real hard to track what a cpp file really
      depends on. But I'll have a look at it anyway.

      Ric
      --
      -----+++++*****************************************************+++++++++-------
      ---- Ric Klaren ----- klaren@... ----- +31 4893722 ----
      -----+++++*****************************************************+++++++++-------
      Why don't we just invite them to dinner and massacre them all when they're
      drunk? You heard the man. There's seven hundred thousand of them.
      Ah? ... So it'd have to be something simple with pasta, then.
      --- From: Interesting Times by Terry Pratchet
      -----+++++*****************************************************+++++++++-------
    Your message has been successfully submitted and would be delivered to recipients shortly.