You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
540 B
30 lines
540 B
#include<FlexLexer.h>
|
|
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <iostream.h>
|
|
#include <fstream.h>
|
|
|
|
#include "stack.h"
|
|
|
|
int main(int argc, char* argv[] )
|
|
{
|
|
const char * file_name = strdup(argv[1]);
|
|
ifstream input;
|
|
input.open(file_name, ios::in);
|
|
yyFlexLexer* parser = new yyFlexLexer(&input);
|
|
|
|
/* allocate initial stack */
|
|
stack = (Stack *) malloc(stack_size * sizeof(Stack));
|
|
|
|
if ( stack == NULL)
|
|
{
|
|
cerr << "texparser: not enough memory for stacks\n";
|
|
return 3;
|
|
}
|
|
|
|
while(parser->yylex() != 0);
|
|
|
|
return 0;
|
|
}
|