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