diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-04-05 16:31:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-04-05 23:32:18 +0000 |
commit | 368e3b8bd75cdbb67a905eb0de226c07f8c4e4e1 (patch) | |
tree | b860dfd7536b3a833bdd2a92dc2a85b83a211311 /wiretap | |
parent | 8b9cae5ff37d4d075992551dd37e8237841e74ae (diff) |
Set the extra type the right way.
Use %option extra_type= rather than #defining YY_EXTRA_TYPE.
Change comments to reflect that the state structure is used both by the
lexical analyzer and the parser.
Change-Id: I19a81de61cbd6e86d71154f376ef0681cc6d42fb
Reviewed-on: https://code.wireshark.org/review/14826
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/ascend-int.h | 1 | ||||
-rw-r--r-- | wiretap/ascend.y | 2 | ||||
-rw-r--r-- | wiretap/ascend_scanner.l | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/wiretap/ascend-int.h b/wiretap/ascend-int.h index 0d8e70b6d6..539c76a9a8 100644 --- a/wiretap/ascend-int.h +++ b/wiretap/ascend-int.h @@ -51,7 +51,6 @@ typedef struct { time_t secs; guint32 usecs; } ascend_state_t; -#define YY_EXTRA_TYPE ascend_state_t * extern int run_ascend_parser(FILE_T fh, struct wtap_pkthdr *phdr, guint8 *pd, diff --git a/wiretap/ascend.y b/wiretap/ascend.y index 31f9cbc88e..a746f23cd7 100644 --- a/wiretap/ascend.y +++ b/wiretap/ascend.y @@ -19,7 +19,7 @@ %lex-param {void *yyscanner} /* - * And we need to pass the parser state to the scanner. + * And we need to pass the parser/scanner state to the parser. */ %parse-param {ascend_state_t *parser_state} diff --git a/wiretap/ascend_scanner.l b/wiretap/ascend_scanner.l index df2393d488..260d820b46 100644 --- a/wiretap/ascend_scanner.l +++ b/wiretap/ascend_scanner.l @@ -20,6 +20,11 @@ %option noyywrap /* + * The type for the state we keep for the scanner (and parser). + */ +%option extra-type="ascend_state_t *" + +/* * Prefix scanner routines with "ascend" rather than "yy", so this scanner * can coexist with other scanners. */ |