| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: scan.l,v 1.2 2009/10/26 04:27:15 christos Exp $ */ | | 1 | /* $NetBSD: scan.l,v 1.3 2010/04/07 16:14:07 christos Exp $ */ |
2 | | | 2 | |
3 | /* scan.l - scanner for flex input -*-C-*- */ | | 3 | /* scan.l - scanner for flex input -*-C-*- */ |
4 | | | 4 | |
5 | %{ | | 5 | %{ |
6 | /* Copyright (c) 1990 The Regents of the University of California. */ | | 6 | /* Copyright (c) 1990 The Regents of the University of California. */ |
7 | /* All rights reserved. */ | | 7 | /* All rights reserved. */ |
8 | | | 8 | |
9 | /* This code is derived from software contributed to Berkeley by */ | | 9 | /* This code is derived from software contributed to Berkeley by */ |
10 | /* Vern Paxson. */ | | 10 | /* Vern Paxson. */ |
11 | | | 11 | |
12 | /* The United States Government has rights in this work pursuant */ | | 12 | /* The United States Government has rights in this work pursuant */ |
13 | /* to contract no. DE-AC03-76SF00098 between the United States */ | | 13 | /* to contract no. DE-AC03-76SF00098 between the United States */ |
14 | /* Department of Energy and the University of California. */ | | 14 | /* Department of Energy and the University of California. */ |
| @@ -73,29 +73,29 @@ extern const char *escaped_qstart, *esca | | | @@ -73,29 +73,29 @@ extern const char *escaped_qstart, *esca |
73 | strlcpy( nmstr, yytext, sizeof(nmstr) ); \ | | 73 | strlcpy( nmstr, yytext, sizeof(nmstr) ); \ |
74 | } \ | | 74 | } \ |
75 | else \ | | 75 | else \ |
76 | { \ | | 76 | { \ |
77 | synerr(_("Input line too long\n")); \ | | 77 | synerr(_("Input line too long\n")); \ |
78 | FLEX_EXIT(EXIT_FAILURE); \ | | 78 | FLEX_EXIT(EXIT_FAILURE); \ |
79 | } \ | | 79 | } \ |
80 | return NAME; | | 80 | return NAME; |
81 | | | 81 | |
82 | #define PUT_BACK_STRING(str, start) \ | | 82 | #define PUT_BACK_STRING(str, start) \ |
83 | for ( i = strlen( str ) - 1; i >= start; --i ) \ | | 83 | for ( i = strlen( str ) - 1; i >= start; --i ) \ |
84 | unput((str)[i]) | | 84 | unput((str)[i]) |
85 | | | 85 | |
86 | #define CHECK_REJECT(str) \ | | 86 | #define CHECK_RE_JECT(str) \ |
87 | if ( all_upper( str ) ) \ | | 87 | if ( all_upper( str ) ) \ |
88 | reject = true; | | 88 | reject = true |
89 | | | 89 | |
90 | #define CHECK_YYMORE(str) \ | | 90 | #define CHECK_YYMORE(str) \ |
91 | if ( all_lower( str ) ) \ | | 91 | if ( all_lower( str ) ) \ |
92 | yymore_used = true; | | 92 | yymore_used = true; |
93 | | | 93 | |
94 | #define YY_USER_INIT \ | | 94 | #define YY_USER_INIT \ |
95 | if ( getenv("POSIXLY_CORRECT") ) \ | | 95 | if ( getenv("POSIXLY_CORRECT") ) \ |
96 | posix_compat = true; | | 96 | posix_compat = true; |
97 | | | 97 | |
98 | %} | | 98 | %} |
99 | | | 99 | |
100 | %option caseless nodefault stack noyy_top_state | | 100 | %option caseless nodefault stack noyy_top_state |
101 | %option nostdinit | | 101 | %option nostdinit |
| @@ -867,27 +867,27 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; / | | | @@ -867,27 +867,27 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; / |
867 | return '}'; | | 867 | return '}'; |
868 | } | | 868 | } |
869 | } | | 869 | } |
870 | | | 870 | |
871 | | | 871 | |
872 | <PERCENT_BRACE_ACTION>{ | | 872 | <PERCENT_BRACE_ACTION>{ |
873 | {OPTWS}"%}".* bracelevel = 0; | | 873 | {OPTWS}"%}".* bracelevel = 0; |
874 | | | 874 | |
875 | <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT ); | | 875 | <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT ); |
876 | | | 876 | |
877 | <CODEBLOCK,ACTION>{ | | 877 | <CODEBLOCK,ACTION>{ |
878 | "reject" { | | 878 | "reject" { |
879 | ACTION_ECHO; | | 879 | ACTION_ECHO; |
880 | CHECK_REJECT(yytext); | | 880 | CHECK_RE_JECT(yytext); |
881 | } | | 881 | } |
882 | "yymore" { | | 882 | "yymore" { |
883 | ACTION_ECHO; | | 883 | ACTION_ECHO; |
884 | CHECK_YYMORE(yytext); | | 884 | CHECK_YYMORE(yytext); |
885 | } | | 885 | } |
886 | } | | 886 | } |
887 | | | 887 | |
888 | {M4QSTART} ACTION_ECHO_QEND; | | 888 | {M4QSTART} ACTION_ECHO_QEND; |
889 | {M4QEND} ACTION_ECHO_QEND; | | 889 | {M4QEND} ACTION_ECHO_QEND; |
890 | . ACTION_ECHO; | | 890 | . ACTION_ECHO; |
891 | {NL} { | | 891 | {NL} { |
892 | ++linenum; | | 892 | ++linenum; |
893 | ACTION_ECHO; | | 893 | ACTION_ECHO; |