[Gtkradiant] Analyzing the mapq3 parser & some suggestions

"Eduard Aumüller" basiror at gmx.de
Wed Mar 14 10:46:21 CDT 2007


Hi, I am currently analyzing the mapq3 parser and got some questions, maybe you can help me there.

I have a little sample output

  1
  2 // entity 0
  3 {
  4 "classname" "worldspawn"
  5 // brush 0
  6 {
  7 ( -24 64 64 ) ( -24 -8 64 ) ( -80 64 64 ) NULL 0 0 0 0.5 0.5 0 0 0
  8 ( -24 64 64 ) ( -80 64 64 ) ( -24 64 -64 ) NULL 0 0 0 0.5 0.5 0 0 0
  9 ( -24 64 64 ) ( -24 64 -64 ) ( -24 -8 64 ) NULL 0 0 0 0.5 0.5 0 0 0
 10 ( -80 -8 -64 ) ( -24 -8 -64 ) ( -80 64 -64 ) NULL 0 0 0 0.5 0.5 0 0 0
 11 ( -80 -8 -64 ) ( -80 -8 64 ) ( -24 -8 -64 ) NULL 0 0 0 0.5 0.5 0 0 0
 12 ( -80 -8 -64 ) ( -80 64 -64 ) ( -80 -8 64 ) NULL 0 0 0 0.5 0.5 0 0 0
 13 }
 14 }


so you jump into it with this peace of code, go to next line so you are in line #2 right?
        for(;;)
        {
                tokeniser.nextLine();
                if (tokeniser.getToken()==0) // { or 0
                    break;
                NodeSmartReference entity(Entity_parseTokens(...));


so in Entity_parseTokens you use nextLine() again and jump right to line#3 and get the next token
const char* token = tokeniser.getToken();

token should be "{" now
so we land here and create a new entity

else if(strcmp(token, "{")==0) // begin primitive
                {
                        if(entity == g_nullNode)
                        {
                                entity = Entity_create(.....);
                        }



somehow this can t work since we have to skip line #3 in order to read the key value pairs, thus receiving the classname to create the proper entity from definition

so the tokenizer musst skip line #1 when tokenising the input stream right? its an empty token anyways, so I assume thats the way it works



Another thing I wanted to ask you

1.)  Why don t you at least add a //! blah blah infront of each class declaration so doxygen can generate the complete class hierarchy.

2.) How about adding a picture code to the bugsubmission form, this spam is really annoying
3.) Also what happened to the GTKRadiant wiki? Maybe setup on at wikipedia?
4.) A message board for developers would be very nice too^^
Just some suggestions


thx for your help in advance
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the Gtkradiant mailing list