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

6965How to override the default reportError of Parser

Expand Messages
  • macromliu <macromliu@yahoo.com.cn>
    Jan 1, 2003
    • 0 Attachment
      Enviroment:
      VC++ 6.0 Enterprise(SP5) Win2k SP3(en) JDK 1.3 ANTLR2.7.2RC1

      when i tried to override the reportError of the Parser like this:
      //--------------------------------------
      header{
      #include <afxcoll.h> //CPtrList
      #include <iostream>
      #include "antlr/RecognitionException.hpp"
      }
      options{
      language="Cpp";
      }
      class GMSPassParser extends Parser;
      options {
      exportVocab=GMSPass;
      k = 1;
      }
      {
      void reportError(RecognitionException &ex )
      {
      AfxMessageBox(ex.toString().c_str() );
      }

      }
      .........
      ..........
      //---------------------------
      i got the following compile error:
      error C2061: syntax error : identifier 'RecognitionException'

      how to get ride of this compile error???
    • Show all 2 messages in this topic