]> git.ipfire.org Git - thirdparty/nftables.git/commit
scanner: introduce start condition stack
authorFlorian Westphal <fw@strlen.de>
Mon, 8 Mar 2021 17:18:33 +0000 (18:18 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 11 Mar 2021 12:43:30 +0000 (13:43 +0100)
commit5896772fe3c5f01696188ea04957a825ee601b12
tree42c1971b34a17ea7107bbeb0b60c11d863dd05d1
parentf8d5fa7c0523d8058e11c823c4664c9ba9ccf121
scanner: introduce start condition stack

Add a small initial chunk of flex start conditionals.

This starts with two low-hanging fruits, numgen and j/symhash.

NUMGEN and HASH start conditions are entered from flex when
the corresponding expression token is encountered.

Flex returns to the INIT condition when the bison parser
has seen a complete numgen/hash statement.

This intentionally uses a stack rather than BEGIN()
to eventually support nested states.

The scanner_pop_start_cond() function argument is not used yet, but
will need to be used later to deal with nesting.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/parser.h
src/parser_bison.y
src/scanner.l