Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Duncan White
C-datadec
Commits
136fa173
Commit
136fa173
authored
Mar 19, 2002
by
dcw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not install instructions now
parent
0ac38050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
46 deletions
+40
-46
README
README
+40
-46
No files found.
README
View file @
136fa173
...
...
@@ -5,54 +5,48 @@ implement them.
Duncan C. White, dcw@doc.ic.ac.uk
19th March 2002
Building and Packaging on Linux
An Example of Datadec in Action
-------------------------------
Either download http://csgsoft.doc.ic.ac.uk/datadec/datadec-1.0-1.i386.rpm
and install it (rpm -i) from there, or do a source build:
1. Download the datadec-1.0.tgz file and save it in your RPM SOURCES directory.
2. Extract the package SPEC file:
tar xzf datadec-1.0.tgz datadec-1.0/PKG/RPM
3. Enter the directory and build the package:
cd datadec-1.0/PKG/RPM
rpm -bb datadec.spec
4. Now you can install the datadec-1.0-1.is386.rpm that you just built,
using rpm -i..
Building on Solaris or Other Unices
-----------------------------------
1. Extract the .tgz file..
2. Compile it:
cd datadec-1.0
make
3. Install it (run this as root) into /usr/local/bin and /usr/man/man1:
make install
4. (Optionally on Solaris) package it up and store in somewhere:
cd PKG/Solaris
make
(edit Makefile, changing where to store the built package)
make install
5. install the package (as root):
pkgadd -d datadec-1.0-1-sol8-sparc-dcw all
To give you a feel for what datadec can do, you could write:
intlist = nil
| cons( int first, intlist next )
;
illist = nil
| cons( intlist first, illist next )
;
idtree = leaf( string id, illist l )
| node( idtree left, idtree right )
;
</pre>
What does this mean?
The first rule declares that an intlist can take two basic "shapes" -
it is either empty, nil, or of the form cons(int,intlist).
nil and cons() are called constructors, and define different
"shapes" that objects of the type can take.
However, because the second argument of a cons() constructor is itself
an intlist, this type is said to be recursively defined.
Functional programmers will recognise nil or cons() as the standard
way of defining a list, so more intuitively, intlist is simply
a list of integers!
Reading on, an illist is declared as a list of intlists,
and an idtree is declared as a binary tree where each leaf node
contains a (string, illist) pair.
Given this input, datadec can automatically construct an ANSI C
module which implements all the data types, a constructor function for
each constructor, deconstructor functions to help you to take objects
apart again and printing functions to help you with debugging.
Building and Packaging datadec
------------------------------
See the INSTALL file for building and packaging instructions.
Testing
-------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment