[antlr-interest] Newbie: Multiple Inheritance Error.

BLade X blade_x123 at yahoo.com
Wed Mar 5 09:00:07 PST 2003


Hi,
 I am trying to write a directx .X file parser using
antlr.
1. I am using antlr 2.7.2 with GCC 3.x on MinGW. I am
getting multiple inheritance errors when I try to
compile the code generated by my program. I am trying
to parse the directx .X format. I seem to have been
able to trubleshoot most of the errors but this one
really has me stumped.

Here are the errors...
----------------------------------------------------------
g++ -g -o dxparse main.cpp DXLexer.cpp
DXFileParser.cpp -I/usr/
local/include -lantlr -L/usr/local/lib

DXFileParser.cpp: In member function `void
DXFileParser::file()':
DXFileParser.cpp:43: request for member `LT' is
ambiguous in multiple 
   inheritance lattice
DXFileParserTokenTypes.hpp:36: candidates are: 
   DXFileParserTokenTypes::<anonymous enum>
DXFileParserTokenTypes::LT
C:/MSYS/local/include/antlr/LLkParser.hpp:50:         
       virtual 
   antlr::RefToken antlr::LLkParser::LT(int)
DXFileParser.cpp: In member function `void
DXFileParser::statements()':
DXFileParser.cpp:130: request for member `LT' is
ambiguous in multiple 
   inheritance lattice
DXFileParserTokenTypes.hpp:36: candidates are: 
   DXFileParserTokenTypes::<anonymous enum>
DXFileParserTokenTypes::LT
C:/MSYS/local/include/antlr/LLkParser.hpp:50:         
       virtual 
   antlr::RefToken antlr::LLkParser::LT(int)
DXFileParser.cpp: In member function `void
DXFileParser::templateDef()':

...
--------------------------------------------------------

Any suggestions will be very welcome. I have attached
the dxlexer.g and dxfile.g to this e-mail in case one
needs it.

2. My second suggestion is to give the users the
ability to build and install only the cpp libraries, I
do not have jdk installed and it cannot find
javac.exe. I don't need java libraries. This is just a
suggestion.

3. In the directx format, there are these things
called templates, which are equivalent to variable
declarations. 

For example I can say
--------------------------------------------
Template DancingMonkey {
 Shake behind;
}

DancingMonkey niceMonkey;
--------------------------------------------
My question is when I am parsing I want to give an
error message if I see some template that has not been
declared before, I am not exactly sure how to do that.
Any suggestions or pointers to example where that kind
of stuff is done (preferrably C++).

Forgive my english it is 3 AM and I am currently
thinking only antlr grammar.

Thanks in advance,
Manju

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dxlexer.g
Type: application/octet-stream
Size: 5456 bytes
Desc: dxlexer.g
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20030305/8b88baf9/dxlexer.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dxfile.g
Type: application/octet-stream
Size: 3442 bytes
Desc: dxfile.g
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20030305/8b88baf9/dxfile.obj


More information about the antlr-interest mailing list