Last updated: 2011 March 26
This page describes how to use the SGML tagging style of FlexOr frames.
- The weave program supports the use of Math symbols, inclusion of Postscript
and inclusion of EPS files.
- The tangle program handles literate programming, a macro faciltity
and adaptation at the source level.
The document FlexOr Frame Structure (pdf 19 pages)
describes the implemented tags, tag attributes and contains instructions for writing macros, and including mathematics and eps files in FlexOr frames.
Weaving and Tangling
To execute the program on Prism you need to have the environment variable CLASSPATH set to include the following path.
I have the following definition for the CLASSPATH but you may already have a definition, which you need to modify.
setenv CLASSPATH ".:/cs/dept/www/java/bin:/cs/dept/www/java/bin/FlexOr"
On Prism the following command brings up the weave and tangle program
java FlexOr.sgml.Start &
A display panel appears.
Enter the input file name. I sugggest you use the browse button as the full path must
be given. By convention FlexOr frames using the SGML tagging style have the extension ".jfx" for frames with Java programs, ".cfx" for for frames with C and C++ programs, ".efx" for frames with Eiffel programs, and ".sfx" for for non-program frames, where the frame will not be tangled but consists of mathematics and documentation.
Enter the output file name. I suggest you use the browser for the input file name as
then the input file name is copied to the output file name with the last 2
- By default the various FlexOr processes insert the appropriate last two characters of extension when the corresponding process button is pressed.
Then select either the
- Weave button -- to produce a postscript document to view or print. The default extension is ".ps" for all files.
- Tangle button -- to extract the program from the frame. The default extension is ".java" for .jfx files, ".c" for .cfx files, ".e" for .efx files, and ".s" for .sfx files.
- Text Only button -- to extract the documentation text from a frame to enable you to use a spell and grammar checker. The default extension is ".txt" for all files.
- Z Check button -- to extract the Z text from a frame to enable you to use the Z type checker fuzz-Z-typecheck. The default extension is ".zc" for all files.
- Debug button -- Does not change the extension. Only useful to see the internal representation created by scan and parse algorithms in FlexOr.
- For practice you can save the source file for the frame
FlexOr Frame Structure
and try to weave it -- you will also need to copy the
eps for the example diagram (normally the extension
should be eps not ePost; the change is to not invoke eps application helpers).
The example is the source file for
the document FlexOr Frame Structure (pdf 19 pages).
The weave output is a postscript file that you can view with ghostview.
- You can weave and tangle the hello world C program frame. The tangled output file is "hellow.c", which you can compile and run.
To produce your own documents you can cut the
parts that you do not need from an example frame and replace with your own documentation and program text.