manpagez: man pages & more
info flex
Home | html | info | man

File: flex.info,  Node: Reentrant Overview,  Next: Reentrant_Example.php">Reentrant Example,  Prev: Reentrant_Uses.php">Reentrant Uses,  Up: Reentrant

19.2 An Overview of the Reentrant API
=====================================

The API for reentrant scanners is different than for non-reentrant
scanners.  Here is a quick overview of the API:

     '%option reentrant' must be specified.

   * All functions take one additional argument: 'yyscanner'

   * In C/C++, all global variables are replaced by their macro
     equivalents.  (We tell you this because it may be important to you
     during debugging.)  This is a historical-compatibilty hack; other
     back ends probably will not emulate it.

   * In the default C/C++ 'yylex_init' and 'yylex_destroy' must be
     called before and after 'yylex', respectively.  Other back ends may
     or may not require this.

   * Accessor methods (get/set functions) provide access to common
     'flex' variables.

   * User-specific data can be stored in 'yyextra'.

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.