Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>indent -kr code -o code.out</p> <p>awk -f split.awk code.out</p> <p>you have to adapt a little bit split.awk wich is somewhat specific to my code and refactoring needs (for example y have so struct who are not typedefs</p> <p>And I'm sure you can make a nicer script :-)</p> <pre><code>-- BEGIN { line=0; FS=""; out=ARGV[ARGC-1] ".out"; var=ARGV[ARGC-1] ".var"; ext=ARGV[ARGC-1] ".ext"; def=ARGV[ARGC-1] ".def"; inc=ARGV[ARGC-1] ".inc"; typ=ARGV[ARGC-1] ".typ"; system ( rm " " -f " " out " " var " " ext " " def " " inc " " typ ); } /^[ ]*\/\/.*/ { print "comment :" $0 "\n"; print $0 &gt;&gt; out ; next ;} /^#define.*/ { print "define :" $0 ; print $0 &gt;&gt;def ; next;} /^#include.*/ { print "define :" $0 ; print $0 &gt;&gt;inc ; next;} /^typedef.*{$/ { print "typedef var :" $0 "\n"; decl="typedef";print $0 &gt;&gt; typ;infile="typ";next;} /^extern.*$/ { print "extern :" $0 "\n"; print $0 &gt;&gt; ext;infile="ext";next;} /^[^ }].*{$/ { print "init var :" $0 "\n";decl="var";print $0 &gt;&gt; var; infile="vars"; print $0; fout=gensub("^([^ \\*])*[ ]*([a-zA-A0-9_]*)\\[.*","\\2","g") ".vars"; print "var decl : " $0 "in file " fout; print $0 &gt;fout; next; } /^[^ }].*)$/ { print "func :" $0 "\n";decl="func"; infile="func"; print $0; fout=gensub("^.*[ \\*]([a-zA-A0-9_]*)[ ]*\\(.*","\\1","g") ".func"; print "function : " $0 "in file " fout; print $0 &gt;fout; next; } /^}[ ]*$/ { print "end of " decl ":" $0 "\n"; if(infile=="typ") { print $0 &gt;&gt; typ; }else if (infile=="ext"){ print $0 &gt;&gt; ext; }else if (infile=="var") { print $0 &gt;&gt; var; }else if ((infile=="func")||(infile=="vars")) { print $0 &gt;&gt; fout; fflush (fout); close (fout); }else if (infile=="def") { print $0 &gt;&gt; def; }else if (infile=="inc"){ print $0 &gt;&gt; inc; }else print $0 &gt;&gt; out; next; } /^[a-zA-Z_]/ { print "extern :" $0 "\n"; print $0 &gt;&gt; var;infile="var";next;} { print "other :" $0 "\n" ; if(infile=="typ") { print $0 &gt;&gt; typ; }else if (infile=="ext"){ print $0 &gt;&gt; ext; }else if (infile=="var") { print $0 &gt;&gt; var; }else if ((infile=="func")||(infile=="vars")){ print $0 &gt;&gt; fout; }else if (infile=="def") { print $0 &gt;&gt; def; }else if (infile=="inc"){ print $0 &gt;&gt; inc; }else print $0 &gt;&gt; out; next; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload