Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
18e86e27
Commit
18e86e27
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-06-08 15:29:46 by cvscast] beppe: added example of Unix script
Original author: cvscast Date: 2003-06-08 15:29:46+00:00
parent
b4160bdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/manual/interpreter.xml
View file @
18e86e27
...
...
@@ -55,6 +55,32 @@ scripts, which are executed successively.</li>
</box>
<box
title=
"Scripting"
link=
"scripting"
>
<p>
CDuce can also be used for writing using scripts. As usual it suffices to start
the script file by
<code>
#!%%install_dir%%/cduce
</code>
to call in a batch way
the cduce interpreter. Here is an example of a script file that prints all the
titles of the filters of an Evolution mail client.
</p>
<sample>
<![CDATA[
#!/usr/local/bin/cduce
type Filter = <filteroptions>
[
<ruleset>
[(
<rule>
[
<title>
String _*])+]];;
let filter : Filter =
match load_xml "/home/beppe/evolution/filters.xml" with
| x
&
Filter -> x
| _ -> raise "Not a filter document"
in print_xml(
<filters>
([filter]/
<ruleset>
_/
<rule>
_/
<title>
_)) ;;
]]>
</sample>
</box>
<box
title=
"Phrases"
link=
"phrases"
>
<p>
...
...
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