Home Patches

"Patch" for using doxygen for slicefiles

g00fyg00fy Member SalvaniaOrganization: SalvaniaProject: Database systems ✭✭
Hereby attached you can find a little "howto" how to use DoxyGen to generate documentation for your project:

This is how I got it working:

1. Install Cygwin (www.cygwin.com), check that doxygen and sed is installed.
$ sed --version
GNU sed version 4.1.5
$ doxygen --version
1.4.6

2. Create a doxygen-script (I will assume you called it 'slice2doxy')
a] Make a small doxygen script, which only generates HTML files:
EXTRACT_ALL            = YES
QUIET                  = YES
FILE_PATTERNS          = *.ice
INPUT_FILTER           = "sed -f sed.script "
GENERATE_LATEX         = NO
b] Or get the full configuration file by running the following command:
doxygen -s -g slice2doxy
And edit it by hand to have all the options you want (but be sure it has the above options in it!)

3. Create a sed-script (I assume you call it sed.script):
# Skip C-style commenting
/\/\*/ , /\*\//b
/\/\/\(.*\)/b

s/module/namespace/
s/local//
s/idempotent//
s/dictionary/map/
s/sequence/vector/

#parse local interface
/interface/ , /{/    {
    /interface/ {
        #change interface to class
        s/interface\(.*\)/class \1/
    }
#change extends
    s/extends/: public/
#add public before every keyword, but not {
    /{/!s/,\(.*\)/, public \1/g
    s/{/{public:/
}

s/nonmutating\(.*)\)/\1 const/

/throws/,/;/ {
    s/throws/throw(/
    s/;/);/
}

4. Generate the HTMLs (or whatever you had in mind)
$ doxygen slice2doxy


If any questions, please fire ahead ;-)

PS: I made this little howto because I still couldn't figure out how to use docbook...

Comments

  • ee_dorightee_doright Member Jonathan SprinkleOrganization: University of ArizonaProject: Compositional Systems
    Updated patch

    I made a few mods to this, to enforce the script only on *.ice files.

    Edit the project.doxyfile as follows:
    FILTER_PATTERNS          = *.ice=./slice2doxy
    

    Create a doxygen-script (call it 'slice2doxy') with the below contents. Make this script executable by the current user.
    #!/bin/sh
    sed -f sed.script
    

    Create the sed-script below, called sed.script:
    # Skip C-style commenting
    /\/\*/ , /\*\//b
    /\/\/\(.*\)/b
    
    s/module/namespace/
    s/local//
    s/idempotent//
    s/dictionary/map/
    s/sequence/vector/
    
    #parse local interface
    /interface/ , /{/    {
        /interface/ {
            #change interface to class
            s/interface\(.*\)/class \1/
        }
    #change extends
        s/extends/: public/
    #add public before every keyword, but not {
        /{/!s/,\(.*\)/, public \1/g
        s/{/{public:/
    }
    
    s/nonmutating\(.*)\)/\1 const/
    
    /throws/,/;/ {
        s/throws/throw(/
        s/;/);/
    }
    

    Now run your generation as normal
    $ doxygen project.doxyfile
    
  • mwilsonmwilson Member Mark WilsonOrganization: Integrated Computer Solutions, Inc.Project: TBD ✭✭✭
    Hmm, this doesn't seem to work. I get errors from sed (this is on Solaris 10, Gnome desktop):

    Unrecognized command: /\/\*/ , /\*\//b

    Any idea what could be wrong?

    Thanks,
    Mark
Sign In or Register to comment.