filters

main.cpp
1#include<FlexLexer.h>
2
3#include <string.h>
4#include <stdlib.h>
5#include <iostream.h>
6#include <fstream.h>
7
8#include "stack.h"
9
10int main(int argc, char* argv[] )
11{
12 const char * file_name = strdup(argv[1]);
13 ifstream input;
14 input.open(file_name, ios::in);
15 yyFlexLexer* parser = new yyFlexLexer(&input);
16
17 /* allocate initial stack */
18 stack = (Stack *) malloc(stack_size * sizeof(Stack));
19
20 if ( stack == NULL)
21 {
22 cerr << "texparser: not enough memory for stacks\n";
23 return 3;
24 }
25
26 while(parser->yylex() != 0);
27
28 return 0;
29}