]> git.tuebingen.mpg.de Git - lopsub.git/commit
config_file.l: Instruct flex to create a reentrant scanner.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 12 Jul 2017 09:43:25 +0000 (11:43 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 28 Nov 2017 09:54:36 +0000 (10:54 +0100)
commit427af673591a006e351dcf76e5957ed67d4e0477
tree06b75dee8057d4a8d3a2c60f0c1af7732735fc63
parent42ce69710691440c9afc2781124b57447fa18415
config_file.l: Instruct flex to create a reentrant scanner.

This requires some modifications:

* Most functions take an additional yyscan_t argument.
* We must call yylex_init and yylex_destroy().
* Accessor methods must be used to get yytext and yylen.

We used to set the initial start condition in lls_convert_config(),
before the call to yylex(). For reentrant scanners, however,
the BEGIN macro can not be used in the user code section where
lls_convert_config() is located. But pushing a state works and should
be equivalent.

The generated scanner is not reentrant yet because it still has global
variables. This issue will be addressed in a subsequent patch.
config_file.l