I sure will. Btw, since you obviously managed to compile the whole think
on Mozart 1.3.1, could you please send me the modified sources, so I
won't have to redo this?
Yep, see the attachements. I modified Start.oz so that it handles
backslashes so that I'm able to use the output directory flag. (Note
that ozh fails when the destination directory exists...this could of
course be easily fixed - but it's probably better to delete the output
directory before running ozh).
OzParser.ozg is patched so that it does not choke on the 1.3.1 loop
syntactic sugar (well, most of it). But note, this is quite a dirty hack
- I have no knowledge of Gump whatsoever :-).
To compile it, however, you will need the Cygwin environment (if you're
as lazy as me, just download everything in 'Devel' and you'll be fine)
and a Mozart build (that's what I use, there may be other ways, though I
doubt it...). Mozart compilation is quite easy, just follow the guide on
the website. Suppose you have Mozart installed at /install. Then the
following builds ozh:
./configure --prefix=/install
Change the following in the Makefile (configure somehow does not get it
right):
OZC = /install/bin/ozc
OZL = /install/bin/ozl
make
mkdir -p /install/cache/x-ozlib/mozart/ozh
cp *.ozf /install/cache/x-ozlib/mozart/ozh
ozl -z 9 --include=x-ozlib://mozart/ozh/ -x Start.ozf -o ozh
rm -f /install/cache/x-ozlib/mozart/ozh/*
make install
The ozh stuff is then installed in /install at subdirectories that you
already know ;-) (Sorry, I couldn't resist...)
I think that ozmake would perhaps do a better job than configure+make,
but I have not tried it.
I also thought of translating Oz class definitions / procedures / etc.
to C++ skeletons, and using doxygen on that.
I thought of that too, but it would take quite an effort to support all
Oz language features. I guess you could model classes as classes and
packages as namespaces, but what about records whose features are
procedures for example? Classes as well? Structs just to have it
different from classes? These are currently not treated well by ozh
either (they are ignored), but this might be easier to address with
using a native grammar.
Well, I think that the OzScaner+OzParser framework takes care of this,
so it could probably be used as a structured representation of the code
(I think that Eclipse folks call this a DOM), from which all of the
C++-style representation could be generated.
Not to mention the whole issue of types, which are so important in
C-like languages and which get a lot of doxygen attention, yet are
completely inapplicable to Oz. I'm really not sure how to address this
in the least annoying way.
It's pity that Oz is not a strongly typed language (yes, I like C++ very
much).
In any case, please let me know if you make any progress on this, and
I'll keep you posted with what I'm doing.
Thanks, and I hope this helps,
Filip
--- ../html/franzen-ozh-1.1/Start.oz 2006-05-16 18:58:42.453125000 +0200
+++ Start.oz 2000-12-06 09:53:04.000000000 +0100
@@ -56,7 +56,7 @@
'define'(multiple char:&D type:atom default:nil))
proc{CheckDirectory D} A=try {OS.stat D}.type==dir catch _ then false end
in
- if A==false then B=({OS.system Mkdir#if {List.last D}\=&/ then D else
{List.take D {Length D}-1} end}==0) in
+ if A==false then B=({OS.system Mkdir#D}==0) in
if B==false then
M=try
if {OS.stat D}.type\=dir then ", file exists!"
@@ -93,7 +93,7 @@
in
try
Args = {Application.getCmdArgs Spec}
- Dir=if Args.out\=nil andthen {List.last Args.out}\=&/ then {Append
Args.out "/"} else Args.out end
+ Dir=if Args.out\=nil andthen {List.last Args.out}\=&/ then Args.out#"/"
else Args.out end
in
%% Ask for help?
if Args.help==true then
--- ../html/franzen-ozh-1.1/OzParser.ozg 2006-05-14 20:32:06.562500000
+0200
+++ OzParser.ozg 2000-12-06 09:53:04.000000000 +0100
@@ -164,8 +164,7 @@
'false' 'false()' 'feat' 'finally' 'from' 'fun' 'functor' 'if' 'in'
'import' 'local' 'lock' 'meth' 'not' 'of' 'or' 'proc' 'prop' 'prepare'
'raise' 'require' 'self' 'skip' 'then' 'thread' 'true' 'true()' 'try'
- 'unit' 'unit()' 'for' 'do' 'comment' 'LMacro' 'RMacro' 'return'
'maximize' 'minimize' 'default' 'break' 'continue'
- 'collect' 'append' 'while' 'until'
+ 'unit' 'unit()' 'for' 'do' 'comment' 'LMacro' 'RMacro'
'=': rightAssoc(100)
'<-': rightAssoc(200)
@@ -342,20 +341,8 @@
end
syn Iterator($)
- 'default' ':' Phrase(_) => unit
- [] 'collect' ':' NakedVariable(_) => unit
- [] 'append' ':' NakedVariable(_) => unit
- [] 'minimize' ':' NakedVariable(_) => unit
- [] 'maximize' ':' NakedVariable(_) => unit
- [] 'return' ':' Phrase(_) => unit
- [] 'break' ':' NakedVariable(_) => unit
- [] 'continue' ':' NakedVariable(_) => unit
- [] 'while' ':' Phrase(_) => unit
- [] 'until' ':' Phrase(_) => unit
- [] Atom(_) ':' Phrase(_) => unit
- [] Sequence(_) 'in' Phrase(_) '..' Phrase(_) OptIteratorStep(_) => unit
- [] Sequence(_) 'in' Phrase(_) OptIteratorStep(_) => unit
- [] Sequence(_) 'from' Phrase(_) => unit
+ NakedVariable(_) 'in' Phrase(_) '..' Phrase(_) OptIteratorStep(_) => unit
+ [] NakedVariable(_) 'in' Phrase(_) OptIteratorStep(_) => unit
end
syn OptIteratorStep($)
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users