Hello,

can anybody tell me how this lexer-parser-combination would look if it
is a reentrant parser?

---------------lexer.l-------------------------------
%option yylineno
%option case-insensitive

%{
  #include "parser.tab.h"
  /* hier C-includes*/
%}

%%
.        { return LINE;
         }
%%

int yywrap(){ return 1; /* 1: beendet lex */ }

---------------lexer.l-------------------------------

---------------parser.y------------------------------
%{
  /* hier C-includes*/
%}

%token LINE

%%

PROGRAM : LINE { /* meine C-Anweisung */ }

%%

int yyerror (char const *s)
{
  exit(1);
  return 0;
}

---------------parser.y------------------------------

---------------main.c--------------------------------
extern int yyparse();

int main()
{
  /* YYIN = file_descriptor_1; */
  yyparse();
  /* reset_parser - ?????????????? */

  /* YYIN = file_descriptor_2; */
  /* yyparse();  */
  return 0;
}
---------------main.c--------------------------------

--------------make.sh--------------------------------
#!/bin/bash
bison -d parser.y
flex lexer.l

gcc -c parser.tab.c
gcc -c lex.yy.c
gcc -c main.c

gcc -o main parser.tab.o lex.yy.o main.o
--------------make.sh--------------------------------



_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to