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

6966Re: How 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
      i've solve this problem... just like the following...
      //--------------------------------------
      header{
      #include <afxcoll.h> //CPtrList
      #include <iostream>
      #include "antlr/RecognitionException.hpp"
      ANTLR_USING_NAMESPACE(antlr) //********and this line***********
      }
      options{
      language="Cpp";
      }
      class GMSPassParser extends Parser;
      options {
      exportVocab=GMSPass;
      k = 1;
      }
      {
      void reportError(RecognitionException &ex )
      {
      AfxMessageBox(ex.toString().c_str() );
      }

      }
      ...
      rules.
      ...
      //---------------------------
    • Show all 2 messages in this topic