1 %{
2 
3 /* cwe by David A. Wheeler (http://www.dwheeler.com).
4    This prints anything of the form CWE-#
5 */
6 
7 #include <stdio.h>
8 #include <ctype.h>
9 #include <string.h>
10 
out(char * text)11 void out(char *text) {
12 	fputs(text,stdout);
13 }
14 
outchar(char c)15 void outchar(char c) {
16 	fputc(c, stdout);
17 }
18 
19 
20 %}
21 
22 
23 %%
24 CWE-[1-9][0-9]* { out(yytext); outchar('\n'); }
25 .               { }
26 \n              { }
27 
28 %%
29 
30