#!/usr/bin/python #---------------------------------------------------------- # Main Module # # python version of stripper.cc # September, 2003 #----------------------------------------------------------- import sys import string from stripFSM import * if __name__ == "__main__": myStripper = StripFSM() myStripper.SetStreams(sys.stdin, sys.stdout) while (1): oneCh = myStripper.ReadChar() if (oneCh == ""): break elif oneCh == '/': myStripper.Slash() elif oneCh == '*': myStripper.Star() elif oneCh == '\n': myStripper.EOL() else: myStripper.Other() """ // $Id: stripper.py,v 1.1 2003/09/26 19:36:17 park Exp $ // // This program implements a C++ comment stripper // using the State Map Parser. // #include #include #include "stripFSM.h" main() { StripFSM myStripper; myStripper.SetStreams(cin,cout); while (cin) switch(myStripper.ReadChar()) { case EOF: exit(0); break; case '/': myStripper.Slash(); break; case '*': myStripper.Star(); break; case '\n': myStripper.EOL(); break; default: myStripper.Other(); break; } } """