Re: Newbie python design question

2005-05-23 Thread Bruno Desthuilliers
Michael a écrit : > Hi, > I'm trying to write a script to parse a .cpp file and begin to create a > 'translational unit'. > To do this i need to: > > Go through the file and remove all 'C' comments as > /* Comment 1*/ > (can be on multiple lines) > > Go through and remove all 'C++' comments, anyt

Re: Newbie python design question

2005-05-22 Thread Philippe C. Martin
Hi, I C I usually use switch for my FSMs, in Python however I usually use if + elif Your question makes me realize it would be trivial to use a dictionnary in case the FSM had too many states, the key being the state and the item the method to handle the state. Regards, Philippe Mich

Newbie python design question

2005-05-22 Thread Michael
Hi, I'm trying to write a script to parse a .cpp file and begin to create a 'translational unit'. To do this i need to: Go through the file and remove all 'C' comments as /* Comment 1*/ (can be on multiple lines) Go through and remove all 'C++' comments, anything between // and '\n' char. The st