[Plib-cvs] plib/src/ssg ssgLoadX.cxx,1.21,1.22 ssgParser.cxx,1.27,1.28
Brought to you by:
sjbaker
From: Wolfram K. <wol...@us...> - 2004-10-04 08:10:18
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27221 Modified Files: ssgLoadX.cxx ssgParser.cxx Log Message: Added "pre_processor" to ParserSpec. Fixed typos. Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ssgLoadX.cxx 26 Jul 2003 09:33:18 -0000 1.21 +++ ssgLoadX.cxx 4 Oct 2004 08:10:00 -0000 1.22 @@ -23,7 +23,7 @@ // // .X loader for SSG/PLIB -// .X is the 3D file format for Micro$ofts directX retained mode. +// .X is the 3D file format for Micro$ofts directX. // Written by Wolfram Kuss (Wol...@t-...) in Oct/Nov of 2000 // #include "ssgLocal.h" @@ -55,6 +55,7 @@ { "\r\n\t ", // delim_chars_skipable ",;", // delim_chars_non_skipable + NULL, // pre_processor "{", // open_brace_chars "}", // close_brace_chars '"', // quote_char @@ -133,7 +134,7 @@ while ( TRUE) { token = parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return ; //FALSE; } @@ -200,9 +201,10 @@ { char *sNextToken, *sName=globEmpty; sNextToken=parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } + // if entity is named, read the name. skip "{": sName = NULL; if (0 != strcmp(sNextToken, "{")) { sName = new char[ strlen(sNextToken) + 1 ]; @@ -217,7 +219,7 @@ if(sNextToken[0] == '<') // UUID sNextToken = parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } @@ -231,7 +233,7 @@ IgnoreEntity ( 0 ); else { - parser.error("I am sorry, but Entity-typ '%s' is not yet implemented.", aEntities[i].sName); + parser.error("I am sorry, but Entity-type '%s' is not yet implemented.", aEntities[i].sName); return FALSE ; } @@ -562,7 +564,7 @@ while(TRUE) { char *nextToken =parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } Index: ssgParser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgParser.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ssgParser.cxx 4 May 2004 12:37:33 -0000 1.27 +++ ssgParser.cxx 4 Oct 2004 08:10:00 -0000 1.28 @@ -42,6 +42,7 @@ { "\r\n\t ", // delim_chars_skipable 0, // delim_chars_non_skipable + NULL, // pre_processor 0, // open_brace_chars 0, // close_brace_chars '"', // quote_char @@ -145,7 +146,7 @@ static char *EOL_string = "EOL reached"; char* _ssgParser::getNextToken( const char* name ) -// Fetches next token, even if it has to read over some empty or commant-only lines to get to it. +// Fetches next token, even if it has to read over some empty or comment-only lines to get to it. // Never returns NULL. Returns EOF_string on EOF. { while(!( curtok < numtok )) @@ -166,7 +167,7 @@ } char *_ssgParser::peekAtNextToken( const char* name ) -// Like getNextToken, but doesnÄt remove the token from the input stream +// Like getNextToken, but doesn't remove the token from the input stream { while(!( curtok < numtok )) { //int startLevel = level; @@ -327,6 +328,8 @@ eof = TRUE; return(0) ; } + if(spec.pre_processor != NULL) + spec.pre_processor (linebuf); memcpy( tokbuf, linebuf, sizeof(linebuf) ) ; ptr = tokbuf ; |