Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cduce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cduce
cduce
Commits
66861b88
Commit
66861b88
authored
Oct 05, 2007
by
Pietro Abate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[r2004-12-30 00:30:19 by afrisch] --script, punning
Original author: afrisch Date: 2004-12-30 00:30:19+00:00
parent
861f06de
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
19 deletions
+43
-19
CHANGES
CHANGES
+1
-0
Makefile
Makefile
+1
-1
driver/run.ml
driver/run.ml
+7
-3
parser/parser.ml
parser/parser.ml
+30
-14
web/demo.js
web/demo.js
+4
-1
No files found.
CHANGES
View file @
66861b88
...
...
@@ -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 @
66861b88
...
...
@@ -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 @
66861b88
...
...
@@ -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 @
66861b88
...
...
@@ -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 @
66861b88
...
...
@@ -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