Salome HOME
- display error message
[tools/hxx2salome.git] / scripts / parse1.awk
1 # This awk program extract public functions of the class definition present in hxx interface
2
3 BEGIN { public=0 }
4
5 # we want to extract each function that is public and that does'nt contain
6 # the patterns : public, protected, private, // (comments), { and }
7 public == 1     && 
8 $1 !~ /public/  && 
9 $1 !~ /protected/ && 
10 $1 !~ /private/ && 
11 $1 !~ /\/\/*/   && 
12 $1 !~ /{|}/  {
13    for (i=1; i<=NF; i++)
14       printf "%s ", $i
15 #  change line if last field contains ";" -> one function per line in output
16    if ( $NF ~ /;/ ) 
17       printf "\n"
18 }
19    
20 $1 == "class" && $0 !~ /;/ {public=1} # we test matching against /;/  to get rid of forward declaration
21 $1 ~ /public/ {public=1}
22 $1 ~ /protected/ {public=0}
23 $1 ~ /private/ {public=0}
24 $1 ~ /}/      {public=0}