diff options
author | John Millaway <john43@users.sourceforge.net> | 2002-09-05 13:53:27 +0000 |
---|---|---|
committer | John Millaway <john43@users.sourceforge.net> | 2002-09-05 13:53:27 +0000 |
commit | 96bd85673c69d948214fd840cc37a9297f30fea0 (patch) | |
tree | 06633af2f1ed0848cb9793421520b6dcfbb9ab8d /devel/00EXTRACT-ALL-SYMS.sh | |
parent | b5d7837b3662763f993a2bc3fd52015625d4a79b (diff) |
Added devel/ directory for junk that we don't want in the distribution,
but that we want in CVS.
Diffstat (limited to 'devel/00EXTRACT-ALL-SYMS.sh')
-rw-r--r-- | devel/00EXTRACT-ALL-SYMS.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/devel/00EXTRACT-ALL-SYMS.sh b/devel/00EXTRACT-ALL-SYMS.sh new file mode 100644 index 0000000..0f7d4ae --- /dev/null +++ b/devel/00EXTRACT-ALL-SYMS.sh @@ -0,0 +1,57 @@ +# extract all table types from various scanners. We try to get the ones +# that are declared outside '{'. +# hopefully we'll hit them all. +OUTFILE=/tmp/EXTRACT-FLEX-SYMS.$$ +echo > $OUTFILE + +for s in \ + yy_trans_info \ + yy_NUL_trans \ + yy_accept \ + yy_base \ + yy_chk \ + yy_def \ + yy_ec \ + yy_meta \ + yy_nxt \ + yy_rule_can_match_eol \ + yy_rule_linenum \ + yy_start_state_list \ + yy_state_type \ + yy_transition +do + perl -ne \ + ' + BEGIN{ + $s = qq('$s'); + } + s/\b(short|long)\s+int\b/$1/; + s/\b(static|(yy)?const)\b\s+//g; + next unless m/((?:struct\s*)?\w+)\W+$s\s*((?:\[\s*\d*\s*\])+)\s*=/; + $type=$1; + $arr = $2; + $arr =~ s/\d+//g; + $a{$s}->{$type . $arr}= $_; + + END{ + for(sort keys %a){ + print values %{$a{$_}} + } + } + ' \ + tests/test-*/*.c >> $OUTFILE +done + +grep -E 'typedef.*yy_state_type' tests/test-*/*.c | + gawk -F ':' '{print $2}' | + sort | + uniq >> $OUTFILE + +pcregrep '(\w+)[\s*]*yy_(verify|nxt)\s*;' tests/test-*/*.c | + perl -pe 's/^.*?\.c?[\-\:]//;' | + sort | + uniq >> $OUTFILE + +cat $OUTFILE +rm -f $OUTFILE + |