From bb1f5a21195cf597e32ccd0dd588498663a4db54 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 1 Jul 2007 16:41:42 +0000 Subject: Ok...the name c++filt is taken, g++ comes with a name-damangler that's called that, also good to know, but annoying. --- src/c++filt/bfilt-c++.l | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/c++filt/bfilt-c++.l (limited to 'src/c++filt/bfilt-c++.l') 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 @@ +%{ +# include + +int nBC = 0; +%} + +%s hasT +%x inWith +%x inT +%option noyywrap nounput batch + +%% + +"operator<<" { ECHO; } +"operator>>" { ECHO; } +"operator". { ECHO; } + +"<<" { ECHO; } +">>" { ECHO; } +" <<" { ECHO; } +" >>" { ECHO; } + +"" { ECHO; } + +\n+ { + BEGIN( INITIAL ); + nBC = false; + ECHO; +} + +" <" { ECHO; } + +"<" { + BEGIN( inT ); + printf("<...>"); + nBC++; +} + +"<" { + nBC++; + +} +[^<>]* { } +">" { + nBC--; + if( nBC == 0 ) + BEGIN( hasT ); +} + +" [with"[^\]]*"]" { } + +%% + +int main() +{ + yyin = stdin; + + yylex(); + + return 0; +} + -- cgit v1.2.3