filters
main.cc00001 #include<FlexLexer.h>
00002
00003 #include <string.h>
00004 #include <stdlib.h>
00005 #include <iostream.h>
00006 #include <fstream.h>
00007
00008 #include "stack.h"
00009
00010 int main(int argc, char* argv[] )
00011 {
00012 const char * file_name = strdup(argv[1]);
00013 ifstream input;
00014 input.open(file_name, ios::in);
00015 yyFlexLexer* parser = new yyFlexLexer(&input);
00016
00017
00018 stack = (Stack *) malloc(stack_size * sizeof(Stack));
00019
00020 if ( stack == NULL)
00021 {
00022 cerr << "texparser: not enough memory for stacks\n";
00023 return 3;
00024 }
00025
00026 while(parser->yylex() != 0);
00027
00028 return 0;
00029 }
|