<<main>>=
@use goofy
...
@
But it is recognized as @text.
@text @use goofy <--------------
@nl
Is there any solution to this?
Any example for 'noweb pipeline' would be a help.
Thanks.
> I want to use Matlab with noweb.
> Since I couldn't find '-autodefs matlab'
Alas, I'm not fluent in Matlab. Browsing the online manual, and
using
function <return stuff> = <funname>
as the template of a function, I generated the following gawk
script that might do what you want. No guarantees that it will
actually work, since I haven't tested it. Contact me if you want
the literate source for this.
Save it as autodefs.matlab.
#!/usr/local/bin/gawk --file
# A gawk filter for auto-indexing a Matlab noweb source file.
# It indexes all procedure and module assignments
# whose name begins in the first column.
#
# Copyright (c) 2006 by Joseph S. Riel. All rights reserved.
BEGIN {codeflag = 0}
($0 ~ /^@begin code /) \
&& (codeflag = 1) \
|| ($0 ~ /^@end code /) \
&& (codeflag = 0) && 1 \
|| !codeflag \
|| ! match($0,/^@text[ ]function [^=]*= *([a-zA-Z_][a-zA-Z_0-9]*)/,arr) \
{print;next}
{print "@index defn", arr[1]
print
}
END {}
--
Joe Riel
I'm not sure what you mean or what you're looking for since I don't
know matlab.
I have an example of autodoefs.lisp that I wrote. You can find it via
my home page http://gratefulfrog.net. Norman Ramsey has created a
framework for building autodefs files using Icon. It wasn't too hard to
adapt some of the other files to work for common lisp.
There is a trick that needs to be done concerning the delimeters used
in the parsing of tokens in whatever language you use. The default
delimiters may or may not be adequate for your application. If they're
not then you'll have to make an adapatation like I did to the source of
finduses.c. You can also see this on my pages.
I take no credit for any of this, it was all done through advice from
NR, author of noweb.
If you can give a more clear statement of your problem, maybe I could
give better help.
Cheers,
GF