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
fdfc8324
Commit
fdfc8324
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-12-30 00:30:19 by afrisch] --script, punning
Original author: afrisch Date: 2004-12-30 00:30:19+00:00
parent
7554a3b6
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
fdfc8324
...
...
@@ -9,6 +9,7 @@ Since 0.2.1
- new syntax { l = p else p' }
- fixed a little bit support for XML Schema, but still largely broken
- better compilation of sequence capture variables
- punning in record/attribute expressions and values ({ x; y } -> {x=x;y=y})
0.2.1
...
...
Makefile
View file @
fdfc8324
...
...
@@ -35,7 +35,7 @@ charme_build:
install_web_distant
:
$(MAKE)
webpages
scp CHANGES INSTALL INSTALL.WIN32 web/www/
*
.html web/cduce.css cduce@iris.ens.fr:public_html/
scp CHANGES INSTALL INSTALL.WIN32 web/www/
*
.html
web/demo.js
web/cduce.css cduce@iris.ens.fr:public_html/
SCRIPT
=
INCLUDES_DEB
=
$(INCLUDES)
$(
shell
ocamlfind query
-i-format
-recursive
$(PACKAGES)
)
...
...
driver/run.ml
View file @
fdfc8324
...
...
@@ -11,6 +11,7 @@ let args = ref []
let
compile
=
ref
false
let
run
=
ref
false
let
script
=
ref
false
let
version
()
=
Printf
.
eprintf
"CDuce, version %s
\n
"
<:
symbol
<
cduce_version
>>;
...
...
@@ -41,10 +42,13 @@ let specs = ref
" add one directory to the lookup path for .cdo and .cmi files"
;
"--stdin"
,
Arg
.
Unit
(
fun
()
->
src
:=
""
::
!
src
)
,
" read CDuce script on standard input"
;
"--arg"
,
Arg
.
Rest
(
fun
s
->
args
:=
s
::
!
args
)
,
" following arguments are passed to the CDuce program"
;
" following arguments are passed to the CDuce program"
;
"--script"
,
Arg
.
Rest
(
fun
s
->
if
not
!
script
then
(
script
:=
true
;
src
:=
s
::
!
src
)
else
args
:=
s
::
!
args
)
,
" the first argument after is the source, then the arguments"
;
"--no"
,
Arg
.
String
Config
.
inhibit
,
" disable a feature (cduce -v to get a list of features)"
;
"--debug"
,
Arg
.
Unit
(
fun
()
->
Stats
.
set_verbosity
Stats
.
Summary
)
,
...
...
parser/parser.ml
View file @
fdfc8324
...
...
@@ -572,13 +572,20 @@ EXTEND
or_else
:
[
[
OPT
[
"else"
;
y
=
pat
->
y
]
]
];
record_spec
:
[
[
r
=
LIST0
[
l
=
[
IDENT
|
keyword
];
"="
;
opt_field_pat
:
[
[
OPT
[
"="
;
o
=
[
"?"
->
true
|
->
false
];
x
=
pat
;
y
=
or_else
->
let
x
=
if
o
then
mk
loc
(
Optional
x
)
else
x
in
(
label
l
,
(
x
,
y
))
]
SEP
";"
->
x
=
pat
;
y
=
or_else
->
(
o
,
x
,
y
)
]
]
];
record_spec
:
[
[
r
=
LIST0
[
l
=
[
IDENT
|
keyword
];
f
=
opt_field_pat
->
let
(
o
,
x
,
y
)
=
match
f
with
|
None
->
(
false
,
mknoloc
(
PatVar
(
U
.
mk
l
))
,
None
)
|
Some
z
->
z
in
let
x
=
if
o
then
mk
loc
(
Optional
x
)
else
x
in
(
label
l
,
(
x
,
y
))
]
SEP
";"
->
r
]
];
...
...
@@ -589,21 +596,28 @@ EXTEND
attrib_spec
:
[
[
r
=
LIST0
[
l
=
[
IDENT
|
keyword
];
"="
;
o
=
[
"?"
->
true
|
->
false
];
x
=
pat
;
y
=
or_else
;
OPT
";"
->
let
x
=
if
o
then
mk
loc
(
Optional
x
)
else
x
in
(
label
l
,
(
x
,
y
))
]
->
[
[
r
=
LIST0
[
l
=
[
IDENT
|
keyword
];
f
=
opt_field_pat
;
OPT
";"
->
let
(
o
,
x
,
y
)
=
match
f
with
|
None
->
(
false
,
mknoloc
(
PatVar
(
U
.
mk
l
))
,
None
)
|
Some
z
->
z
in
let
x
=
if
o
then
mk
loc
(
Optional
x
)
else
x
in
(
label
l
,
(
x
,
y
))
]
->
mk
loc
(
Record
(
true
,
r
))
|
"("
;
t
=
pat
;
")"
->
t
|
"{"
;
r
=
record_spec
;
"}"
->
mk
loc
(
Record
(
true
,
r
))
|
"{|"
;
r
=
record_spec
;
"|}"
->
mk
loc
(
Record
(
false
,
r
))
]
];
opt_field_expr
:
[
[
OPT
[
"="
;
x
=
expr
LEVEL
"no_appl"
->
x
]
]
];
expr_record_spec
:
[
[
r
=
LIST1
[
l
=
[
IDENT
|
keyword
];
"="
;
x
=
expr
LEVEL
"no_appl"
->
[
l
=
[
IDENT
|
keyword
];
x
=
opt_field_expr
->
let
x
=
match
x
with
Some
x
->
x
|
None
->
Var
(
U
.
mk
l
)
in
(
label
l
,
x
)
]
SEP
";"
->
exp
loc
(
RecordLitt
r
)
...
...
@@ -611,7 +625,9 @@ EXTEND
expr_attrib_spec
:
[
[
r
=
LIST1
[
l
=
[
IDENT
|
keyword
];
"="
;
x
=
expr
LEVEL
"no_appl"
;
OPT
";"
->
[
l
=
[
IDENT
|
keyword
];
x
=
opt_field_expr
;
OPT
";"
->
let
x
=
match
x
with
Some
x
->
x
|
None
->
Var
(
U
.
mk
l
)
in
(
label
l
,
x
)
]
->
exp
loc
(
RecordLitt
r
)
]
...
...
web/demo.js
View file @
fdfc8324
...
...
@@ -28,7 +28,10 @@ function defreq(pr)
function
submit
(
pr
)
{
var
xmlhttp
=
new
XMLHttpRequest
();
xmlhttp
.
open
(
"
POST
"
,
"
/cgi-bin/evaluator
"
,
true
);
netscape
.
security
.
PrivilegeManager
.
enablePrivilege
(
'
UniversalXPConnect UniversalBrowserAccess
'
);
xmlhttp
.
open
(
"
POST
"
,
"
http://reglisse.ens.fr/evaluator
"
,
true
);
xmlhttp
.
onreadystatechange
=
function
()
{
if
(
xmlhttp
.
readyState
==
4
)
{
show_result
(
pr
,
xmlhttp
.
responseText
);
}
}
...
...
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