| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | %{ | | 1 | %{ |
2 | /* $NetBSD: scan.l,v 1.41 2008/10/13 14:00:37 dholland Exp $ */ | | 2 | /* $NetBSD: scan.l,v 1.42 2008/12/10 16:12:39 joerg Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. | | 5 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. |
6 | * Copyright (c) 1994, 1995 Jochen Pohl | | 6 | * Copyright (c) 1994, 1995 Jochen Pohl |
7 | * All Rights Reserved. | | 7 | * All Rights Reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
15 | * notice, this list of conditions and the following disclaimer in the | | 15 | * notice, this list of conditions and the following disclaimer in the |
| @@ -25,27 +25,27 @@ | | | @@ -25,27 +25,27 @@ |
25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 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 | | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 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 | | 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. | | 33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | #include <sys/cdefs.h> | | 36 | #include <sys/cdefs.h> |
37 | #if defined(__RCSID) && !defined(lint) | | 37 | #if defined(__RCSID) && !defined(lint) |
38 | __RCSID("$NetBSD: scan.l,v 1.41 2008/10/13 14:00:37 dholland Exp $"); | | 38 | __RCSID("$NetBSD: scan.l,v 1.42 2008/12/10 16:12:39 joerg Exp $"); |
39 | #endif | | 39 | #endif |
40 | | | 40 | |
41 | #include <stdlib.h> | | 41 | #include <stdlib.h> |
42 | #include <string.h> | | 42 | #include <string.h> |
43 | #include <limits.h> | | 43 | #include <limits.h> |
44 | #include <float.h> | | 44 | #include <float.h> |
45 | #include <ctype.h> | | 45 | #include <ctype.h> |
46 | #include <errno.h> | | 46 | #include <errno.h> |
47 | #include <math.h> | | 47 | #include <math.h> |
48 | | | 48 | |
49 | #include "lint1.h" | | 49 | #include "lint1.h" |
50 | #include "cgram.h" | | 50 | #include "cgram.h" |
51 | | | 51 | |
| @@ -215,26 +215,27 @@ static struct kwtab { | | | @@ -215,26 +215,27 @@ static struct kwtab { |
215 | { "float", T_TYPE, 0, FLOAT, 0, 0, 0, 0 }, | | 215 | { "float", T_TYPE, 0, FLOAT, 0, 0, 0, 0 }, |
216 | { "for", T_FOR, 0, 0, 0, 0, 0, 0 }, | | 216 | { "for", T_FOR, 0, 0, 0, 0, 0, 0 }, |
217 | { "goto", T_GOTO, 0, 0, 0, 0, 0, 0 }, | | 217 | { "goto", T_GOTO, 0, 0, 0, 0, 0, 0 }, |
218 | { "if", T_IF, 0, 0, 0, 0, 0, 0 }, | | 218 | { "if", T_IF, 0, 0, 0, 0, 0, 0 }, |
219 | { "__imag__", T_IMAG, 0, 0, 0, 0, 1, 0 }, | | 219 | { "__imag__", T_IMAG, 0, 0, 0, 0, 1, 0 }, |
220 | { "inline", T_SCLASS, INLINE, 0, 0, 0, 1, 0 }, | | 220 | { "inline", T_SCLASS, INLINE, 0, 0, 0, 1, 0 }, |
221 | { "__inline__", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, | | 221 | { "__inline__", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, |
222 | { "__inline", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, | | 222 | { "__inline", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, |
223 | { "int", T_TYPE, 0, INT, 0, 0, 0, 0 }, | | 223 | { "int", T_TYPE, 0, INT, 0, 0, 0, 0 }, |
224 | { "__symbolrename", T_SYMBOLRENAME, 0, 0, 0, 0, 0, 0 }, | | 224 | { "__symbolrename", T_SYMBOLRENAME, 0, 0, 0, 0, 0, 0 }, |
225 | { "long", T_TYPE, 0, LONG, 0, 0, 0, 0 }, | | 225 | { "long", T_TYPE, 0, LONG, 0, 0, 0, 0 }, |
226 | { "__real__", T_REAL, 0, 0, 0, 0, 1, 0 }, | | 226 | { "__real__", T_REAL, 0, 0, 0, 0, 1, 0 }, |
227 | { "register", T_SCLASS, REG, 0, 0, 0, 0, 0 }, | | 227 | { "register", T_SCLASS, REG, 0, 0, 0, 0, 0 }, |
| | | 228 | { "restrict", T_QUAL, 0, 0, RESTRICT, 0, 1, 0 }, |
228 | { "return", T_RETURN, 0, 0, 0, 0, 0, 0 }, | | 229 | { "return", T_RETURN, 0, 0, 0, 0, 0, 0 }, |
229 | { "short", T_TYPE, 0, SHORT, 0, 0, 0, 0 }, | | 230 | { "short", T_TYPE, 0, SHORT, 0, 0, 0, 0 }, |
230 | { "signed", T_TYPE, 0, SIGNED, 0, 1, 0, 0 }, | | 231 | { "signed", T_TYPE, 0, SIGNED, 0, 1, 0, 0 }, |
231 | { "__signed__", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, | | 232 | { "__signed__", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, |
232 | { "__signed", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, | | 233 | { "__signed", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, |
233 | { "sizeof", T_SIZEOF, 0, 0, 0, 0, 0, 0 }, | | 234 | { "sizeof", T_SIZEOF, 0, 0, 0, 0, 0, 0 }, |
234 | { "static", T_SCLASS, STATIC, 0, 0, 0, 0, 0 }, | | 235 | { "static", T_SCLASS, STATIC, 0, 0, 0, 0, 0 }, |
235 | { "struct", T_SOU, 0, STRUCT, 0, 0, 0, 0 }, | | 236 | { "struct", T_SOU, 0, STRUCT, 0, 0, 0, 0 }, |
236 | { "switch", T_SWITCH, 0, 0, 0, 0, 0, 0 }, | | 237 | { "switch", T_SWITCH, 0, 0, 0, 0, 0, 0 }, |
237 | { "typedef", T_SCLASS, TYPEDEF, 0, 0, 0, 0, 0 }, | | 238 | { "typedef", T_SCLASS, TYPEDEF, 0, 0, 0, 0, 0 }, |
238 | { "union", T_SOU, 0, UNION, 0, 0, 0, 0 }, | | 239 | { "union", T_SOU, 0, UNION, 0, 0, 0, 0 }, |
239 | { "unsigned", T_TYPE, 0, UNSIGN, 0, 0, 0, 0 }, | | 240 | { "unsigned", T_TYPE, 0, UNSIGN, 0, 0, 0, 0 }, |
240 | { "void", T_TYPE, 0, VOID, 0, 0, 0, 0 }, | | 241 | { "void", T_TYPE, 0, VOID, 0, 0, 0, 0 }, |