Skip to content

Commit

Permalink
doc: amend manual section on state stack functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jannick0 authored and westes committed Mar 13, 2018
1 parent 3971b61 commit b33fd4c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion doc/flex.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1978,15 +1978,23 @@ as though you had used
@deftypefun void yy_pop_state ()
pops the top of the stack and switches to it via
@code{BEGIN}.
The program execution aborts, if there is no state on the stack.
@end deftypefun

@deftypefun int yy_top_state ()
returns the top of the stack without altering the stack's contents.
returns the top of the stack without altering the stack's contents
if a top state on the stack exists or the current state via
@code{YY_START}
otherwise.
@end deftypefun

@cindex memory, for start condition stacks
The start condition stack grows dynamically and so has no built-in size
limitation. If memory is exhausted, program execution aborts.
The stack is not automatically reset. The function
@code{yylex_destroy}
should be called to reset and destroy the state stack which then frees
other resources used by the scanner.

To use start condition stacks, your scanner must include a @code{%option
stack} directive (@pxref{Scanner Options}).
Expand Down

0 comments on commit b33fd4c

Please sign in to comment.