dcsimg
Why "Token.SKIP" is reported to be an error in VC++?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yi_zhao
Posted On:   Thursday, March 31, 2005 12:36 AM

It says: 'Token' : undeclared identifier


However, if I delete '{$setType(Token.SKIP)}' in *.g,

the whole C++ project is right.

Re: Why "Token.SKIP" is reported to be an error in VC++?

Posted By:   Anonymous  
Posted On:   Thursday, May 12, 2005 12:25 AM

It's because Token.SKIP is the java representation. Java uses the "." (dot) and C++ uses "::" (colon colon). Also the namespaces are different. The "Token" class only exists in the antlr namespace.

Personally, I use:


{ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP; }


There may be a better way to do it, but unfortunatly ANTLR appears to me to be geared more towards java.

About | Sitemap | Contact