File: lemonflex-head.inc

package info (click to toggle)
wireshark 1.8.2-5wheezy18
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 196,124 kB
  • sloc: ansic: 2,186,574; xml: 55,064; python: 30,233; perl: 22,353; sh: 13,118; pascal: 5,964; lex: 4,963; cpp: 3,604; makefile: 3,471; yacc: 266; asm: 156; tcl: 35
file content (34 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* $Id: lemonflex-head.inc 11400 2004-07-18 00:24:25Z guy $ */

/* This file is #include'd at the top of a Lex/Flex scanner
for use with the Lemon parser. You must have #define'd:

LVAL		name of lval variable
LVAL_TYPE	type of lval variable
LVAL_INIT_VAL	Initial value of lval variable

*/

/* Flex has a few routines which help us get the scanner to read
 * from a string rather than from a file. POSIX lex only provides
 * for reading from a file; any method of reading from a string
 * is inherently non-portable.  Besides reading from a string,
 * we have to worry about resetting the scanner after a bad
 * parse; this too is non-portable. Combine the reset with
 * a string input, and you have major non-portability. I'll provide
 * the routines for flex here. If you really want to modify the
 * scanner and use a non-flex lex implementation, you may
 * add more ifdef's below.
 */


/* If we don't need yyunput, use this macro to get it out of the
 * generated C file, avoiding a compiler warning about its lack of use */
#define YY_NO_UNPUT 1


/* Yup, I'm using a non-standard type for lval, unlike usual lex/yacc implementations.
 * I can do so because I'm *not* using yacc, I'm using Lemon, where I have
 * more control of the interaction between scanner and parser. */
LVAL_TYPE	LVAL = LVAL_INIT_VAL;