aboutsummaryrefslogtreecommitdiff
path: root/src/c++filt/bfilt-c++.l
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-01 16:41:42 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-01 16:41:42 +0000
commitbb1f5a21195cf597e32ccd0dd588498663a4db54 (patch)
tree0e6a46c4286615cfe6b61b21390b2b636ae638df /src/c++filt/bfilt-c++.l
parente992a71800cd41bbf2c7d3301dd00691f1c04327 (diff)
downloadbuild-bb1f5a21195cf597e32ccd0dd588498663a4db54.tar.gz
build-bb1f5a21195cf597e32ccd0dd588498663a4db54.tar.bz2
build-bb1f5a21195cf597e32ccd0dd588498663a4db54.tar.xz
build-bb1f5a21195cf597e32ccd0dd588498663a4db54.zip
Ok...the name c++filt is taken, g++ comes with a name-damangler that's called
that, also good to know, but annoying.
Diffstat (limited to 'src/c++filt/bfilt-c++.l')
-rw-r--r--src/c++filt/bfilt-c++.l62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/c++filt/bfilt-c++.l b/src/c++filt/bfilt-c++.l
new file mode 100644
index 0000000..af12cac
--- /dev/null
+++ b/src/c++filt/bfilt-c++.l
@@ -0,0 +1,62 @@
1%{
2# include <string>
3
4int 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
54int main()
55{
56 yyin = stdin;
57
58 yylex();
59
60 return 0;
61}
62