xref: /original-bsd/games/atc/lex.l (revision a425a1c9)
1 %{
2 /*-
3  * Copyright (c) 1990, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * Ed James.
8  *
9  * %sccs.include.redist.c%
10  */
11 
12 /*
13  * Copyright (c) 1987 by Ed James, UC Berkeley.  All rights reserved.
14  *
15  * Copy permission is hereby granted provided that this notice is
16  * retained on all partial or complete copies.
17  *
18  * For more info on this and all of my stuff, mail edjames@berkeley.edu.
19  */
20 
21 #ifndef lint
22 static char sccsid[] = "@(#)lex.l	8.1 (Berkeley) 05/31/93";
23 #endif /* not lint */
24 
25 #include "y.tab.h"
26 extern int	line;
27 
28 %}
29 %%
30 [0-9]+			{ yylval.ival = atoi(yytext);  return(ConstOp); }
31 height			{ return(HeightOp); }
32 width			{ return(WidthOp); }
33 newplane		{ return(NewplaneOp); }
34 update			{ return(UpdateOp); }
35 airport			{ return(AirportOp); }
36 line			{ return(LineOp); }
37 exit			{ return(ExitOp); }
38 beacon			{ return(BeaconOp); }
39 [wedcxzaq]		{ yylval.cval = *yytext; return (DirOp); }
40 [ \t]+			{ }
41 #[^\n]*\n		{ line++; }
42 \n			{ line++; }
43 .			{ return *yytext; }
44