Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.sbin / pcvt / vgaio / lex.l
1 %{
2 /*
3  * Copyright (c) 1994 Joerg Wunsch
4  *
5  * All rights reserved.
6  *
7  * This program is free software.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *      This product includes software developed by Joerg Wunsch
20  * 4. The name of the developer may not be used to endorse or promote
21  *    products derived from this software without specific prior written
22  *    permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27  * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35
36 #ident "$FreeBSD: src/usr.sbin/pcvt/vgaio/lex.l,v 1.5 1999/09/06 07:39:30 peter Exp $"
37 #ident "$DragonFly: src/usr.sbin/pcvt/vgaio/Attic/lex.l,v 1.2 2003/06/17 04:29:59 dillon Exp $"
38
39 /*
40  * $Log: lex.l,v $
41  * Revision 1.1  1994/03/29  02:47:20  mycroft
42  * pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
43  *
44  * Revision 1.2  1994/01/08  17:42:58  j
45  * cleanup
46  * made multiple commands per line work
47  * wrote man page
48  *
49  * Revision 1.3  21.12.1994 -hm
50  * Added mi command for accessing the misc out register
51  */
52
53 #include <stdio.h>
54 #include <stdlib.h>
55
56 #include "vgaio.h"
57 #include "y.tab.h"
58
59 extern YYSTYPE yylval;
60
61 %}
62
63 D       [0-9a-fA-F]
64
65 %%
66
67 cr|CR   { return CR; }
68
69 ar|AR   { return AR; }
70
71 gr|GR   { return GR; }
72
73 sr|SR   { return SR; }
74
75 mi|MI   { return MI; }
76
77 {D}({D}*)  { sscanf(yytext, "%x", &yylval.num); return NUM; }
78
79 [ \t]   { /* ignore */ }
80
81 \n      { return NEWLINE; }
82
83 .       { return yytext[0]; }