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
6468fdc3
Commit
6468fdc3
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-11-27 15:31:59 by cmiachon] Empty log message
Original author: cmiachon Date: 2003-11-27 15:31:59+00:00
parent
486f337d
Changes
3
Hide whitespace changes
Inline
Side-by-side
parser/parser.ml
View file @
6468fdc3
...
@@ -250,16 +250,24 @@ EXTEND
...
@@ -250,16 +250,24 @@ EXTEND
|
|
[
e1
=
expr
;
op
=
[
"*"
];
e2
=
expr
->
exp
loc
(
Op
(
op
,
[
e1
;
e2
]))
[
e1
=
expr
;
op
=
[
"*"
];
e2
=
expr
->
exp
loc
(
Op
(
op
,
[
e1
;
e2
]))
|
e1
=
expr
;
"&&"
;
e2
=
expr
->
exp
loc
(
logical_and
e1
e2
)
|
e1
=
expr
;
"&&"
;
e2
=
expr
->
exp
loc
(
logical_and
e1
e2
)
|
e
=
expr
;
op
=
"/"
;
p
=
pat
->
|
e
=
expr
;
"/"
;
t
=
[
a
=
pat
->
let
tag
=
mk
loc
(
Internal
(
Types
.
atom
(
Atoms
.
any
)))
in
let
tag
=
mk
loc
(
Internal
(
Types
.
atom
(
Atoms
.
any
)))
in
let
att
=
mk
loc
(
Internal
Types
.
Record
.
any
)
in
let
att
=
mk
loc
(
Internal
Types
.
Record
.
any
)
in
let
any
=
mk
loc
(
Internal
(
Types
.
any
))
in
let
any
=
mk
loc
(
Internal
(
Types
.
any
))
in
let
re
=
Star
(
Alt
(
SeqCapture
(
id_dummy
,
Elem
p
)
,
Elem
any
))
in
let
re
=
Star
(
Alt
(
SeqCapture
(
id_dummy
,
Elem
a
)
,
Elem
any
))
in
let
ct
=
mk
loc
(
Regexp
(
re
,
any
))
in
let
ct
=
mk
loc
(
Regexp
(
re
,
any
))
in
let
p
=
mk
loc
(
XmlT
(
tag
,
multi_prod
loc
[
att
;
ct
]))
in
let
p
=
mk
loc
(
XmlT
(
tag
,
multi_prod
loc
[
att
;
ct
]))
in
let
b
=
(
p
,
Var
(
Id
.
value
id_dummy
))
in
(
p
,
Var
(
Id
.
value
id_dummy
))
exp
loc
(
Transform
(
e
,
[
b
]))
|
"@"
;
a
=
[
IDENT
|
keyword
]
->
(* projection sur 1 attribut *)
let
tag
=
mk
loc
(
Internal
(
Types
.
atom
Atoms
.
any
))
in
let
any
=
mk
loc
(
Internal
(
Types
.
any
))
in
let
att
=
mk
loc
(
Record
(
true
,
[(
label
a
,
mk
loc
(
PatVar
(
U
.
mk
"$$$"
)))]))
in
let
ct
=
mk
loc
(
Regexp
(
Elem
any
,
any
))
in
let
p
=
mk
loc
(
XmlT
(
tag
,
multi_prod
loc
[
att
;
ct
]))
in
(
p
,
Pair
(
Var
(
Id
.
value
id_dummy
)
,
cst_nil
))
]
->
exp
loc
(
Transform
(
e
,
[
t
]))
]
]
|
|
[
e
=
expr
;
"."
;
l
=
[
IDENT
|
keyword
]
->
[
e
=
expr
;
"."
;
l
=
[
IDENT
|
keyword
]
->
...
...
tests/cql/q1.cd
View file @
6468fdc3
(* /@ not implemented
let q1x =
let q1x =
<bib>
<bib>
select <book year=y>t
select <book year=y>([b]/<title>_)
from b in [doc]/<book>_ ,
from b in [doc]/<book>[_* <publisher>"Addison-Wesley";_] ,
y in b/@year,
y in [b]/@year
p in b/<publisher>_,
where (int_of(y)>>1991);;
t in b/<title>_
where (p = [<publisher>"Addison-Wesley"]) and (int_of(y)>>1991);;
*)
let q1p =
let q1p =
...
...
tests/cql/q7.cd
View file @
6468fdc3
...
@@ -61,3 +61,4 @@ from b in [doc]/<book>[ _* <publisher>['Addison-Wesley'];_],
...
@@ -61,3 +61,4 @@ from b in [doc]/<book>[ _* <publisher>['Addison-Wesley'];_],
y in [doc]/@year
y in [doc]/@year
where int_of(y) >> 1991
where int_of(y) >> 1991
) in <bib>q;;
) in <bib>q;;
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