2016-12-02 19:18:50 +00:00
|
|
|
%top {
|
|
|
|
/* Include this before everything else, for various large-file definitions */
|
|
|
|
#include "config.h"
|
2021-10-17 12:17:47 +00:00
|
|
|
#include <wireshark.h>
|
2016-12-02 19:18:50 +00:00
|
|
|
}
|
|
|
|
|
2016-03-31 01:44:01 +00:00
|
|
|
/*
|
|
|
|
* We want a reentrant scanner.
|
|
|
|
*/
|
|
|
|
%option reentrant
|
|
|
|
|
2007-07-30 20:22:37 +00:00
|
|
|
/*
|
2015-11-05 23:35:04 +00:00
|
|
|
* We don't read interactively from the terminal.
|
2007-07-30 20:22:37 +00:00
|
|
|
*/
|
|
|
|
%option never-interactive
|
|
|
|
|
2015-12-05 03:52:51 +00:00
|
|
|
/*
|
|
|
|
* We want to stop processing when we get to the end of the input.
|
|
|
|
*/
|
|
|
|
%option noyywrap
|
|
|
|
|
2016-04-05 23:31:49 +00:00
|
|
|
/*
|
|
|
|
* The type for the state we keep for the scanner (and parser).
|
|
|
|
*/
|
|
|
|
%option extra-type="ascend_state_t *"
|
|
|
|
|
2007-07-30 20:22:37 +00:00
|
|
|
/*
|
2020-11-19 01:39:19 +00:00
|
|
|
* Prefix scanner routines with "ascend_" rather than "yy", so this scanner
|
2007-07-30 20:22:37 +00:00
|
|
|
* can coexist with other scanners.
|
|
|
|
*/
|
2020-11-19 01:39:19 +00:00
|
|
|
%option prefix="ascend_"
|
2007-07-30 20:22:37 +00:00
|
|
|
|
2016-03-31 01:44:01 +00:00
|
|
|
/*
|
|
|
|
* We have to override the memory allocators so that we don't get
|
|
|
|
* "unused argument" warnings from the yyscanner argument (which
|
|
|
|
* we don't use, as we have a global memory allocator).
|
|
|
|
*
|
|
|
|
* We provide, as macros, our own versions of the routines generated by Flex,
|
|
|
|
* which just call malloc()/realloc()/free() (as the Flex versions do),
|
|
|
|
* discarding the extra argument.
|
|
|
|
*/
|
|
|
|
%option noyyalloc
|
|
|
|
%option noyyrealloc
|
|
|
|
%option noyyfree
|
|
|
|
|
2011-06-09 22:46:00 +00:00
|
|
|
%{
|
|
|
|
/* ascend_scanner.l
|
1999-09-23 05:26:18 +00:00
|
|
|
*
|
|
|
|
* Wiretap Library
|
2001-11-13 23:55:44 +00:00
|
|
|
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
2011-06-08 20:58:44 +00:00
|
|
|
*
|
2018-04-30 07:47:58 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
1999-09-23 05:26:18 +00:00
|
|
|
|
2001-08-20 15:23:34 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2000-05-19 23:07:04 +00:00
|
|
|
#include "wtap-int.h"
|
2009-06-15 18:56:46 +00:00
|
|
|
#include "ascendtext.h"
|
1999-10-08 07:41:33 +00:00
|
|
|
#include "ascend-int.h"
|
2020-11-19 01:39:19 +00:00
|
|
|
#include "ascend_parser.h"
|
2000-01-13 07:18:50 +00:00
|
|
|
#include "file_wrappers.h"
|
1999-09-22 07:37:46 +00:00
|
|
|
|
2018-02-16 11:15:32 +00:00
|
|
|
/*
|
|
|
|
* Disable diagnostics in the code generated by Flex.
|
|
|
|
*/
|
|
|
|
DIAG_OFF_FLEX
|
2017-08-18 19:11:47 +00:00
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
static int ascend_yyinput(void *buf, ascend_state_t *parser_state) {
|
|
|
|
int c = file_getc(parser_state->fh);
|
|
|
|
if (c == EOF) {
|
|
|
|
parser_state->err = file_error(parser_state->fh,
|
|
|
|
&parser_state->err_info);
|
|
|
|
if (parser_state->err == 0)
|
|
|
|
parser_state->err = WTAP_ERR_SHORT_READ;
|
|
|
|
return YY_NULL;
|
|
|
|
} else {
|
|
|
|
*(char *) buf = c;
|
|
|
|
return 1;
|
|
|
|
}
|
2016-03-31 01:44:01 +00:00
|
|
|
}
|
1999-09-11 04:53:26 +00:00
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
#define YY_INPUT(buf, result, max_size) \
|
|
|
|
do { (result) = ascend_yyinput((buf), yyextra); } while (0)
|
|
|
|
|
|
|
|
|
|
|
|
/* Count bytes read. This is required in order to rewind the file
|
|
|
|
* to the beginning of the next packet, since flex reads more bytes
|
|
|
|
* before executing the action that does yyterminate(). */
|
|
|
|
#define YY_USER_ACTION do { yyextra->token.length = yyleng; } while (0);
|
|
|
|
|
2001-04-09 03:32:34 +00:00
|
|
|
#define NO_USER "<none>"
|
2000-02-15 21:06:58 +00:00
|
|
|
|
2003-10-03 21:12:49 +00:00
|
|
|
#ifndef HAVE_UNISTD_H
|
2003-10-03 21:03:00 +00:00
|
|
|
#define YY_NO_UNISTD_H
|
|
|
|
#endif
|
|
|
|
|
2016-03-31 01:44:01 +00:00
|
|
|
/*
|
|
|
|
* Sleazy hack to suppress compiler warnings in yy_fatal_error().
|
|
|
|
*/
|
|
|
|
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macros for the allocators, to discard the extra argument.
|
|
|
|
*/
|
2020-11-19 01:39:19 +00:00
|
|
|
#define ascend_alloc(size, yyscanner) (void *)malloc(size)
|
|
|
|
#define ascend_realloc(ptr, size, yyscanner) (void *)realloc((char *)(ptr), (size))
|
|
|
|
#define ascend_free(ptr, yyscanner) free((char *)ptr)
|
2005-02-05 17:39:12 +00:00
|
|
|
|
1999-09-11 04:53:26 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
D [0-9]
|
|
|
|
H [A-Fa-f0-9]
|
|
|
|
|
2005-10-11 19:55:55 +00:00
|
|
|
PPP_XPFX PPP-OUT
|
|
|
|
PPP_RPFX PPP-IN
|
2005-02-05 17:39:12 +00:00
|
|
|
ISDN_XPFX PRI-XMIT-
|
|
|
|
ISDN_RPFX PRI-RCV-
|
|
|
|
WAN_XPFX XMIT[\-:]*
|
|
|
|
WAN_RPFX RECV[\-:]*
|
|
|
|
ETHER_PFX ETHER
|
1999-09-11 04:53:26 +00:00
|
|
|
|
1999-09-13 03:49:04 +00:00
|
|
|
WDD_DATE "Date:"
|
|
|
|
WDD_TIME "Time:"
|
|
|
|
WDD_CAUSE "Cause an attempt to place call to "
|
|
|
|
WDD_CALLNUM [^\n\r\t ]+
|
|
|
|
WDD_CHUNK "WD_DIALOUT_DISP: chunk"
|
|
|
|
WDD_TYPE "type "[^\n\r\t ]+
|
|
|
|
|
|
|
|
%s sc_gen_task
|
|
|
|
%s sc_gen_time_s
|
|
|
|
%s sc_gen_time_u
|
|
|
|
%s sc_gen_octets
|
|
|
|
%s sc_gen_counter
|
|
|
|
%s sc_gen_byte
|
|
|
|
|
|
|
|
%s sc_wds_user
|
|
|
|
%s sc_wds_sess
|
|
|
|
|
|
|
|
%s sc_wdd_date_d
|
|
|
|
%s sc_wdd_date_m
|
|
|
|
%s sc_wdd_date_y
|
|
|
|
%s sc_wdd_time
|
|
|
|
%s sc_wdd_time_h
|
|
|
|
%s sc_wdd_time_m
|
|
|
|
%s sc_wdd_time_s
|
|
|
|
%s sc_wdd_cause
|
|
|
|
%s sc_wdd_callnum
|
|
|
|
%s sc_wdd_chunk
|
|
|
|
%s sc_wdd_chunknum
|
|
|
|
%s sc_wdd_type
|
1999-09-11 04:53:26 +00:00
|
|
|
|
2001-12-04 10:07:30 +00:00
|
|
|
%s sc_chardisp
|
|
|
|
|
2005-02-05 17:39:12 +00:00
|
|
|
%s sc_isdn_call
|
|
|
|
%s sc_ether_direction
|
|
|
|
|
1999-09-11 04:53:26 +00:00
|
|
|
%%
|
|
|
|
|
2005-02-05 17:39:12 +00:00
|
|
|
<INITIAL,sc_gen_byte>{ETHER_PFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_ether_direction);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_ETHER;
|
|
|
|
return ETHER_PREFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<INITIAL,sc_gen_byte>{ISDN_XPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_isdn_call);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_ISDN_X;
|
|
|
|
return ISDN_PREFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<INITIAL,sc_gen_byte>{ISDN_RPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_isdn_call);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_ISDN_R;
|
|
|
|
return ISDN_PREFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<INITIAL,sc_gen_byte>{WAN_XPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wds_user);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_WDS_X;
|
|
|
|
return WDS_PREFIX;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2005-02-05 17:39:12 +00:00
|
|
|
<INITIAL,sc_gen_byte>{WAN_RPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wds_user);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_WDS_R;
|
|
|
|
return WDS_PREFIX;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2005-02-05 17:39:12 +00:00
|
|
|
<INITIAL,sc_gen_byte>{PPP_XPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wds_user);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_WDS_X;
|
|
|
|
return WDS_PREFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<INITIAL,sc_gen_byte>{PPP_RPFX} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wds_user);
|
|
|
|
yyextra->token.u16_val = ASCEND_PFX_WDS_R;
|
|
|
|
return WDS_PREFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
2018-10-01 04:23:04 +00:00
|
|
|
/*
|
|
|
|
* If we allow an arbitrary non-zero number of non-left-parentheses after
|
|
|
|
* "ETHER", that means that some file that has ETHER followed by a lot of
|
|
|
|
* text (see, for example, tpncp/tpncp.dat in the source tree) can cause
|
|
|
|
* either an infinite loop or a loop that take forever to finish, as the
|
|
|
|
* scanner keeps swallowing characters. Limit it to 20 characters.
|
|
|
|
*
|
|
|
|
* XXX - any reason to require at least two of them?
|
|
|
|
*/
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_ether_direction>[^\(]{2,20} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_task);
|
|
|
|
return STRING;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
2018-10-01 04:23:04 +00:00
|
|
|
/*
|
|
|
|
* If we allow an arbitrary non-zero number of non-slash, non-left-parentheses,
|
|
|
|
* non-colon characters after "PRI-XMIT", that means that some file that has
|
|
|
|
* PRI-XMIT= followed by a lot of text can cause either an infinite loop or
|
|
|
|
* a loop that take forever to finish, as the scanner keeps swallowing
|
|
|
|
* characters. Limit it to 20 characters.
|
|
|
|
*/
|
|
|
|
<sc_isdn_call>[^\/\(:]{1,20} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_task);
|
|
|
|
return DECNUM;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_wds_user>[^:]{2,20} {
|
2020-11-19 01:39:19 +00:00
|
|
|
char *atcopy = g_strdup(yytext);
|
|
|
|
char colon = input(yyscanner);
|
|
|
|
char after = input(yyscanner);
|
|
|
|
int retval = STRING;
|
|
|
|
|
|
|
|
unput(after); unput(colon);
|
|
|
|
|
|
|
|
if (after != '(' && after != ' ') {
|
|
|
|
BEGIN(sc_wds_sess);
|
|
|
|
if (yyextra->pseudo_header != NULL && yyextra->pseudo_header->user[0] == '\0') {
|
2021-04-30 10:18:25 +00:00
|
|
|
(void) g_strlcpy(yyextra->pseudo_header->user, atcopy, ASCEND_MAX_STR_LEN);
|
2020-11-19 01:39:19 +00:00
|
|
|
}
|
|
|
|
} else { /* We have a version 7 file */
|
|
|
|
BEGIN(sc_gen_task);
|
|
|
|
if (yyextra->pseudo_header != NULL && yyextra->pseudo_header->user[0] == '\0') {
|
2021-04-30 10:18:25 +00:00
|
|
|
(void) g_strlcpy(yyextra->pseudo_header->user, NO_USER, ASCEND_MAX_STR_LEN);
|
2020-11-19 01:39:19 +00:00
|
|
|
}
|
|
|
|
/* Are valid values ever > 2^32? If so we need to adjust YYSTYPE and a lot of */
|
|
|
|
/* upstream code accordingly. */
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
retval = DECNUM;
|
2001-04-09 03:32:34 +00:00
|
|
|
}
|
2020-11-19 01:39:19 +00:00
|
|
|
g_free (atcopy);
|
|
|
|
return retval;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2001-04-09 03:32:34 +00:00
|
|
|
<sc_wds_sess>{D}* {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_task);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return DECNUM;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_gen_task>(0x|0X)?{H}{2,8} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_time_s);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 16);
|
|
|
|
return HEXNUM;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2001-12-04 10:07:30 +00:00
|
|
|
<sc_gen_task>\"[A-Za-z0-9_ ]+\" {
|
2020-11-19 01:39:19 +00:00
|
|
|
return STRING;
|
2001-12-04 10:07:30 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_gen_time_s>{D}{1,10} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_time_u);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return DECNUM;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_gen_time_u>{D}{1,6} {
|
2020-11-19 01:39:19 +00:00
|
|
|
char *atcopy = g_strdup(yytext);
|
|
|
|
BEGIN(sc_gen_octets);
|
|
|
|
/* only want the most significant 2 digits. convert to usecs */
|
|
|
|
if (strlen(atcopy) > 2)
|
|
|
|
atcopy[2] = '\0';
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(atcopy, NULL, 10) * 10000;
|
|
|
|
g_free(atcopy);
|
|
|
|
return DECNUM;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_gen_octets>{D}{1,10} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_counter);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return DECNUM;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
1999-09-13 03:49:04 +00:00
|
|
|
<sc_gen_counter,sc_gen_byte>"["{H}{4}"]:" {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_byte);
|
|
|
|
return COUNTER;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
1999-09-13 03:49:04 +00:00
|
|
|
<sc_gen_byte>{H}{2} {
|
2020-11-19 01:39:19 +00:00
|
|
|
yyextra->token.u8_val = (guint8) strtoul(yytext, NULL, 16);
|
|
|
|
return HEXBYTE;
|
1999-09-11 04:53:26 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_gen_byte>" "{4} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_chardisp);
|
2001-12-04 10:07:30 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_chardisp>.* {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_byte);
|
2001-12-04 10:07:30 +00:00
|
|
|
}
|
|
|
|
|
1999-09-13 03:49:04 +00:00
|
|
|
<INITIAL,sc_gen_byte>{WDD_DATE} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_date_m);
|
|
|
|
return WDD_DATE;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
/*
|
|
|
|
* Scan m/d/y as three separate m, /d/, and y tokens.
|
|
|
|
* We could alternately treat m/d/y as a single token.
|
|
|
|
*/
|
|
|
|
<sc_wdd_date_m>{D}{2} {
|
|
|
|
BEGIN(sc_wdd_date_d);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
<sc_wdd_date_d>\/{D}{2}\/ {
|
|
|
|
BEGIN(sc_wdd_date_y);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext+1, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_date_y>{D}{4} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_time);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_time>{WDD_TIME} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_time_h);
|
|
|
|
return WDD_TIME;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
/*
|
|
|
|
* Scan h:m:s as three separate h, :m:, and s tokens similar to above.
|
|
|
|
*/
|
1999-09-13 03:49:04 +00:00
|
|
|
<sc_wdd_time_h>{D}{2} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_time_m);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2020-11-19 01:39:19 +00:00
|
|
|
<sc_wdd_time_m>:{D}{2}: {
|
|
|
|
BEGIN(sc_wdd_time_s);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext+1, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_time_s>{D}{2} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_cause);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 10);
|
|
|
|
return WDD_DECNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_cause>{WDD_CAUSE} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_callnum);
|
|
|
|
return WDD_CAUSE;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_callnum>{WDD_CALLNUM} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_chunk);
|
2021-04-30 10:18:25 +00:00
|
|
|
(void) g_strlcpy(yyextra->token.str_val, yytext, ASCEND_MAX_STR_LEN);
|
2020-11-19 01:39:19 +00:00
|
|
|
return WDD_CALLNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2000-11-12 04:57:39 +00:00
|
|
|
<INITIAL,sc_wdd_chunk,sc_gen_byte>{WDD_CHUNK} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_chunknum);
|
|
|
|
return WDD_CHUNK;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2011-06-08 20:58:44 +00:00
|
|
|
<sc_wdd_chunknum>{H}{1,8} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_wdd_type);
|
|
|
|
yyextra->token.u32_val = (guint32) strtoul(yytext, NULL, 16);
|
|
|
|
return HEXNUM;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<sc_wdd_type>{WDD_TYPE} {
|
2020-11-19 01:39:19 +00:00
|
|
|
BEGIN(sc_gen_task);
|
|
|
|
return KEYWORD;
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2005-02-05 17:39:12 +00:00
|
|
|
<sc_gen_task>\/{D}+ {
|
2020-11-19 01:39:19 +00:00
|
|
|
return SLASH_SUFFIX;
|
2005-02-05 17:39:12 +00:00
|
|
|
}
|
|
|
|
|
2001-12-04 10:07:30 +00:00
|
|
|
(0x|0X)?{H}+ { return HEXNUM; }
|
1999-09-13 03:49:04 +00:00
|
|
|
|
2001-12-04 10:07:30 +00:00
|
|
|
task:|task|at|time:|octets { return KEYWORD; }
|
1999-09-11 04:53:26 +00:00
|
|
|
|
2015-12-06 23:39:10 +00:00
|
|
|
<<EOF>> { yyterminate(); }
|
1999-09-11 04:53:26 +00:00
|
|
|
|
2001-12-06 08:25:52 +00:00
|
|
|
(.|\n) ;
|
2018-02-16 11:15:32 +00:00
|
|
|
|
|
|
|
%%
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Turn diagnostics back on, so we check the code that we've written.
|
|
|
|
*/
|
|
|
|
DIAG_ON_FLEX
|