repo.or.cz
/
rofl0r-c-split.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
new tool to strip comments from headers
[rofl0r-c-split.git]
/
CParser-remove-comments.pl
blob
6df2032905f8ff1fcb61a7f27bfb377aa8963980
1
#!/usr/bin/env perl
2
use
strict
;
3
use
warnings
;
4
5
use
File
::
Basename
;
6
use
Cwd
'abs_path'
;
7
use
lib dirname
(
abs_path
(
$0
));
8
use
CParser
;
9
use
Data
::
Dump
qw(dump)
;
10
11
my
$file
=
$ARGV
[
0
]
or die
(
"need filename"
);
12
13
my
$p
=
CParser
->
new
(
$file
);
14
$p
->
parse
();
15
#dump($p);
16
17
for
(
@
{
$p
->{
macros
}}) {
18
print
"
$_
\n
"
;
19
}
20
21
for
(
@
{
$p
->{
typedefs
}}) {
22
print
"
$_
\n
"
;
23
}