don't do a strlen() if length is provided
[unix-history] / usr / src / games / atc / lex.l
CommitLineData
932954ff 1%{
e04f5cf8
KB
2/*-
3 * Copyright (c) 1990 The Regents of the University of California.
4 * 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
932954ff
KB
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
e04f5cf8
KB
21#ifndef lint
22static char sccsid[] = "@(#)lex.l 5.2 (Berkeley) %G%";
23#endif /* not lint */
24
932954ff
KB
25#include "y.tab.h"
26extern int line;
e04f5cf8 27
932954ff
KB
28%}
29%%
30[0-9]+ { yylval.ival = atoi(yytext); return(ConstOp); }
31height { return(HeightOp); }
32width { return(WidthOp); }
33newplane { return(NewplaneOp); }
34update { return(UpdateOp); }
35airport { return(AirportOp); }
36line { return(LineOp); }
37exit { return(ExitOp); }
38beacon { return(BeaconOp); }
39[wedcxzaq] { yylval.cval = *yytext; return (DirOp); }
40[ \t]+ { }
41#[^\n]*\n { line++; }
42\n { line++; }
43. { return *yytext; }