| OLD | NEW |
| (Empty) |
| 1 #include <cstring> | |
| 2 #include <cstdlib> | |
| 3 #include <cstdio> | |
| 4 | |
| 5 #include "textparser.hxx" | |
| 6 #include "htmlparser.hxx" | |
| 7 #include "latexparser.hxx" | |
| 8 | |
| 9 #ifndef W32 | |
| 10 using namespace std; | |
| 11 #endif | |
| 12 | |
| 13 int | |
| 14 main(int argc, char** argv) | |
| 15 { | |
| 16 FILE * f; | |
| 17 /* first parse the command line options */ | |
| 18 | |
| 19 if (argc < 2) { | |
| 20 fprintf(stderr,"correct syntax is:\n"); | |
| 21 fprintf(stderr,"testparser file\n"); | |
| 22 fprintf(stderr,"example: testparser /dev/stdin\n"); | |
| 23 exit(1); | |
| 24 } | |
| 25 | |
| 26 /* open the words to check list */ | |
| 27 f = fopen(argv[1],"r"); | |
| 28 if (!f) { | |
| 29 fprintf(stderr,"Error - could not open file of words to check\n"); | |
| 30 exit(1); | |
| 31 } | |
| 32 | |
| 33 TextParser * p = new LaTeXParser("qwertzuiopasdfghjklyxcvbnméáúõûóüöíQWERTZU
IOPASDFGHJKLYXCVBNMÍÉÁÕÚÖÜÓÛ"); | |
| 34 | |
| 35 char buf[MAXLNLEN]; | |
| 36 char * next; | |
| 37 | |
| 38 while(fgets(buf,MAXLNLEN,f)) { | |
| 39 fprintf(stdout,"---------------------------------------\n"); | |
| 40 p->put_line(buf); | |
| 41 fprintf(stderr, "x:%s\n", buf); | |
| 42 p->set_url_checking(1); | |
| 43 while ((next=p->next_token())) { | |
| 44 fprintf(stdout,"token: %s\n",next); | |
| 45 free(next); | |
| 46 } | |
| 47 } | |
| 48 | |
| 49 delete p; | |
| 50 fclose(f); | |
| 51 return 0; | |
| 52 } | |
| 53 | |
| OLD | NEW |