[antlr-interest] Re: How to override the default reportError of Parser

macromliu <macromliu at yahoo.com.cn> macromliu at yahoo.com.cn
Wed Jan 1 03:39:55 PST 2003


  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.
...
 //---------------------------



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list