diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-07-01 16:45:07 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-07-01 16:45:07 +0000 |
commit | a1bc3936b85eab573361026ae323c1a02e0f0ccd (patch) | |
tree | 600ecd16026592cbe2d4461036279edc2a41e480 /src/bfilt | |
parent | bb1f5a21195cf597e32ccd0dd588498663a4db54 (diff) | |
download | build-a1bc3936b85eab573361026ae323c1a02e0f0ccd.tar.gz build-a1bc3936b85eab573361026ae323c1a02e0f0ccd.tar.bz2 build-a1bc3936b85eab573361026ae323c1a02e0f0ccd.tar.xz build-a1bc3936b85eab573361026ae323c1a02e0f0ccd.zip |
Ok, now there's a dir of bfilts, build-filters, that's the best I can come up
with right now for these until they're integrated and it won't matter anymore.
Diffstat (limited to 'src/bfilt')
-rw-r--r-- | src/bfilt/c++/bfilt-c++.l | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/bfilt/c++/bfilt-c++.l b/src/bfilt/c++/bfilt-c++.l new file mode 100644 index 0000000..af12cac --- /dev/null +++ b/src/bfilt/c++/bfilt-c++.l | |||
@@ -0,0 +1,62 @@ | |||
1 | %{ | ||
2 | # include <string> | ||
3 | |||
4 | int nBC = 0; | ||
5 | %} | ||
6 | |||
7 | %s hasT | ||
8 | %x inWith | ||
9 | %x inT | ||
10 | %option noyywrap nounput batch | ||
11 | |||
12 | %% | ||
13 | |||
14 | "operator<<" { ECHO; } | ||
15 | "operator>>" { ECHO; } | ||
16 | "operator". { ECHO; } | ||
17 | |||
18 | "<<" { ECHO; } | ||
19 | ">>" { ECHO; } | ||
20 | " <<" { ECHO; } | ||
21 | " >>" { ECHO; } | ||
22 | |||
23 | "<anonymous>" { ECHO; } | ||
24 | |||
25 | \n+ { | ||
26 | BEGIN( INITIAL ); | ||
27 | nBC = false; | ||
28 | ECHO; | ||
29 | } | ||
30 | |||
31 | " <" { ECHO; } | ||
32 | |||
33 | "<" { | ||
34 | BEGIN( inT ); | ||
35 | printf("<...>"); | ||
36 | nBC++; | ||
37 | } | ||
38 | |||
39 | <inT>"<" { | ||
40 | nBC++; | ||
41 | |||
42 | } | ||
43 | <inT>[^<>]* { } | ||
44 | <inT>">" { | ||
45 | nBC--; | ||
46 | if( nBC == 0 ) | ||
47 | BEGIN( hasT ); | ||
48 | } | ||
49 | |||
50 | <hasT>" [with"[^\]]*"]" { } | ||
51 | |||
52 | %% | ||
53 | |||
54 | int main() | ||
55 | { | ||
56 | yyin = stdin; | ||
57 | |||
58 | yylex(); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | |||