Skip to content

Commit

Permalink
Add simple Doxygen filter for Julia
Browse files Browse the repository at this point in the history
Also modifies Doxyfile to accept Julia source files, telling doxygen to
parse Julia files with its C parser. Now of course Julia is NOT C at
all, but doxygen allows you to fool it by running input filters on
source files.

The Julia-to-pseudo-C filter is the most brain-dead thing you can
imagine. All the heavy lifting is done by JuliaParser.jl; the filter
simply looks for function declarations, rewrites the signatures into
pseudo-C notation, and then spits out the body of the function parsed by
JuliaParser wrapped with a pair of braces.

The pseudo-C function signature is quite incomplete:
- varargs drop the names of the variable (e.g. myarrays... -> ....),
- kwargs are ignored

Nonetheless it's quite amazing how much functionality you can get from
such a terrible hack!
  • Loading branch information
jiahao committed Oct 21, 2014
1 parent 3bbb0a3 commit 5a28707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.

EXTENSION_MAPPING =
EXTENSION_MAPPING = jl=C

# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
Expand Down Expand Up @@ -772,7 +772,7 @@ INPUT_ENCODING = UTF-8
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.

FILE_PATTERNS = *.c *.cpp *.h
FILE_PATTERNS = *.c *.cpp *.h *.jl

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
Expand Down Expand Up @@ -866,14 +866,14 @@ INPUT_FILTER =
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.

FILTER_PATTERNS =
FILTER_PATTERNS = *.jl=/Users/jiahao/sandbox/jldoxy/doxyfilter.jl

# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.

FILTER_SOURCE_FILES = NO
FILTER_SOURCE_FILES = YES

# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
Expand Down
1 change: 1 addition & 0 deletions contrib/doxyfilter.jl

0 comments on commit 5a28707

Please sign in to comment.