Update of /cvsroot/plib/plib/src/psl
In directory usw-pr-cvs1:/tmp/cvs-serv32635/plib/src/psl
Modified Files:
pslCompiler.h pslToken.cxx
Log Message:
Implement #ifdef/#ifndef/#else/#endif
Index: pslCompiler.h
===================================================================
RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pslCompiler.h 12 Sep 2002 03:17:06 -0000 1.14
+++ pslCompiler.h 12 Sep 2002 04:39:26 -0000 1.15
@@ -152,6 +152,15 @@
int searchDefines ( const char *s ) const ;
+ int skipOverride ;
+ int skippingFlag ;
+ int next_skippingLevel ;
+
+ int skipping ()
+ {
+ return ! skipOverride && skippingFlag != 0 ;
+ }
+
pslSymbol symtab [ MAX_SYMBOL ] ;
pslSymbol code_symtab [ MAX_SYMBOL ] ;
@@ -309,6 +318,8 @@
next_code_symbol = 0 ;
next_code = 0 ;
next_var = 0 ;
+ skippingFlag = 0 ;
+ next_skippingLevel = 1 ;
}
void dump () const ;
Index: pslToken.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/psl/pslToken.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pslToken.cxx 12 Sep 2002 03:17:06 -0000 1.16
+++ pslToken.cxx 12 Sep 2002 04:39:26 -0000 1.17
@@ -37,25 +37,41 @@
} while ( c != '\n' && c != -1 ) ;
}
+
+
int pslCompiler::getChar ()
{
- /*
- If we got a newline then we have to test to see whether
- a '#' preprocessor directive is on this line.
- */
[...161 lines suppressed...]
+ define_token [ next_define ] = new char [ strlen ( token ) + 1 ] ;
+ define_replacement [ next_define ] = new char [ strlen ( subst ) + 1 ] ;
+ strcpy ( define_token [ next_define ], token ) ;
+ strcpy ( define_replacement [ next_define ], subst ) ;
+ next_define++ ;
+ }
}
}
@@ -199,7 +281,9 @@
*/
skipToEOL () ;
- _pslPushDefaultFile ( p ) ;
+
+ if ( ! skipping () )
+ _pslPushDefaultFile ( p ) ;
}
|