26 |
%x xSKIPSTR |
%x xSKIPSTR |
27 |
%x xAUTHOR |
%x xAUTHOR |
28 |
|
|
29 |
|
%option nounput |
30 |
|
|
31 |
%{ |
%{ |
32 |
#include <stdio.h> |
#include <stdio.h> |
33 |
#include <stdlib.h> |
#include <stdlib.h> |
34 |
#include <string.h> |
#include <string.h> |
35 |
#include <ctype.h> |
#include <ctype.h> |
36 |
|
|
37 |
|
#include <gd.h> |
38 |
|
|
39 |
#include "utils.h" |
#include "utils.h" |
40 |
|
#include "cvsgraph.h" |
41 |
#include "readconf.h" |
#include "readconf.h" |
42 |
#include "rcs.h" |
#include "rcs.h" |
43 |
#include "rcs.tab.h" |
#include "rcsy.h" |
44 |
|
|
45 |
#define SKIP_DELTATEXT 1 |
#define SKIP_DELTATEXT 1 |
46 |
|
|
94 |
commitid return tCOMMITID; |
commitid return tCOMMITID; |
95 |
kopt return tKOPT; |
kopt return tKOPT; |
96 |
filename return tFILENAME; |
filename return tFILENAME; |
97 |
|
properties return tPROPERTIES; |
98 |
|
|
99 |
/* Here come any other 'newphrase' constructs */ |
/* Here come any other 'newphrase' constructs */ |
100 |
{num}?{idchar}({idchar}|{num})* { |
{num}?{idchar}({idchar}|{num})* { |
101 |
rcslval.str = xstrdup(rcstext); |
yylval.str = xstrdup(yytext); |
102 |
return tNEWPHRASE; |
return tNEWPHRASE; |
103 |
} |
} |
104 |
|
|
106 |
<xSKIP>[^;@\n]+ ; |
<xSKIP>[^;@\n]+ ; |
107 |
<xSKIP>\n line_number++; |
<xSKIP>\n line_number++; |
108 |
<xSKIP>@ BEGIN(xSKIPSTR); |
<xSKIP>@ BEGIN(xSKIPSTR); |
109 |
<xSKIP>; BEGIN(INITIAL); return *rcstext; |
<xSKIP>; BEGIN(INITIAL); return *yytext; |
110 |
|
|
111 |
<xSKIPSTR>[^\n@]+ ; |
<xSKIPSTR>[^\n@]+ ; |
112 |
<xSKIPSTR>\n line_number++; |
<xSKIPSTR>\n line_number++; |
113 |
<xSKIPSTR>@@ ; |
<xSKIPSTR>@@ ; |
114 |
<xSKIPSTR>@ BEGIN(xSKIP); |
<xSKIPSTR>@ BEGIN(xSKIP); |
115 |
|
|
116 |
{num} rcslval.str = xstrdup(rcstext); return tREV; |
{num} yylval.str = xstrdup(yytext); return tREV; |
117 |
[:;$] return *rcstext; |
[:;$] return *yytext; |
118 |
|
|
119 |
<xID>{ws}+ ; |
<xID>{ws}+ ; |
120 |
<xID>\n line_number++; |
<xID>\n line_number++; |
121 |
<xID>{special} BEGIN(INITIAL); return *rcstext; |
<xID>{special} BEGIN(INITIAL); return *yytext; |
122 |
<xID>{num}?{idchar}({idchar}|{num})* { |
<xID>{num}?{idchar}({idchar}|{num})* { |
123 |
rcslval.str = xstrdup(rcstext); |
yylval.str = xstrdup(yytext); |
124 |
BEGIN(INITIAL); |
BEGIN(INITIAL); |
125 |
return tID; |
return tID; |
126 |
} |
} |
127 |
<xID>{num}?. rcserror("Invalid character in ID '%s' (0x%02x)", rcstext, rcstext[yyleng-1]); |
<xID>{num}?. rcserror("Invalid character in ID '%s' (0x%02x)", yytext, yytext[yyleng-1]); |
128 |
|
|
129 |
<xSYM>{ws}+ ; |
<xSYM>{ws}+ ; |
130 |
<xSYM>\n line_number++; |
<xSYM>\n line_number++; |
131 |
<xSYM>{special} BEGIN(INITIAL); return *rcstext; |
<xSYM>{special} BEGIN(INITIAL); return *yytext; |
132 |
<xSYM>{digit}*{idchar}({idchar}|{digit})* { |
<xSYM>{digit}*{idchar}({idchar}|{digit})* { |
133 |
rcslval.str = xstrdup(rcstext); |
yylval.str = xstrdup(yytext); |
134 |
BEGIN(INITIAL); |
BEGIN(INITIAL); |
135 |
return tSYM; |
return tSYM; |
136 |
} |
} |
137 |
<xSYM>{digit}*. rcserror("Invalid character in SYMBOL '%s' (0x%02x)", rcstext, rcstext[yyleng-1]); |
<xSYM>{digit}*. rcserror("Invalid character in SYMBOL '%s' (0x%02x)", yytext, yytext[yyleng-1]); |
138 |
|
|
139 |
@ reset_str(); BEGIN(xSTR); |
@ reset_str(); BEGIN(xSTR); |
140 |
<xSTR>[^@\n]+ add_str(rcstext, rcsleng); |
<xSTR>[^@\n]+ add_str(yytext, yyleng); |
141 |
<xSTR>\n line_number++; add_str(rcstext, rcsleng); |
<xSTR>\n line_number++; add_str(yytext, yyleng); |
142 |
<xSTR>@@ add_str(rcstext, 1); |
<xSTR>@@ add_str(yytext, 1); |
143 |
<xSTR>@ rcslval.str = get_str(); BEGIN(INITIAL); skip_string = 0; return tSTRING; |
<xSTR>@ yylval.str = get_str(); BEGIN(INITIAL); skip_string = 0; return tSTRING; |
144 |
|
|
145 |
<xAUTHOR>@ reset_str(); BEGIN(xSTR); |
<xAUTHOR>@ reset_str(); BEGIN(xSTR); |
146 |
<xAUTHOR>{ws}+ ; |
<xAUTHOR>{ws}+ ; |
147 |
<xAUTHOR>\n line_number++; |
<xAUTHOR>\n line_number++; |
148 |
<xAUTHOR>{special} BEGIN(INITIAL); return *rcstext; |
<xAUTHOR>{special} BEGIN(INITIAL); return *yytext; |
149 |
<xAUTHOR>{num}?{idchar}({idchar}|{num})* { |
<xAUTHOR>({idchar}|{num}|{ws})+ { |
150 |
rcslval.str = xstrdup(rcstext); |
yylval.str = xstrdup(yytext); |
151 |
BEGIN(INITIAL); |
BEGIN(INITIAL); |
152 |
return tID; |
return tID; |
153 |
} |
} |
154 |
<xAUTHOR>{num}?. rcserror("Invalid character in ID '%s' (0x%02x)", rcstext, rcstext[yyleng-1]); |
<xAUTHOR>. rcserror("Invalid character in AUTHOR '%s' (0x%02x)", yytext, yytext[yyleng-1]); |
155 |
|
|
156 |
{ws}+ ; /* Ignore whitespace */ |
{ws}+ ; /* Ignore whitespace */ |
157 |
\n line_number++; |
\n line_number++; |
158 |
|
|
159 |
. rcserror("Unknown char/unmatched text '%c' (0x%02x)", isprint(*rcstext) ? *rcstext : ' ', *rcstext); |
. rcserror("Unknown char/unmatched text '%c' (0x%02x)", isprint((int)((unsigned char)*yytext)) ? *yytext : ' ', *yytext); |
160 |
|
|
161 |
%% |
%% |
162 |
|
|
163 |
int rcswrap(void) |
int yywrap(void) |
164 |
{ |
{ |
165 |
return 1; |
return 1; |
166 |
} |
} |