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
Raphaël Cauderlier
Sigmaid
Commits
677a582e
Commit
677a582e
authored
Jul 01, 2014
by
Raphaël Cauderlier
Browse files
Parse function applications
parent
35bb2e87
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser.mly
View file @
677a582e
...
...
@@ -18,6 +18,11 @@
let
label
l
=
let
l'
=
Label
l
in
Base
.
labels
:=
insert1
l'
!
Base
.
labels
;
l'
let
rec
apply
t
=
function
|
[]
->
t
|
t1
::
tl
->
apply
(
App
(
t
,
t1
))
tl
%
}
%
token
<
string
>
ID
CID
SELECT
UPDATE
FUPD
...
...
@@ -59,12 +64,18 @@ obj: ID { Var (Id ($1)) }
|
LBRACK
obj_elems
RBRACK
{
Obj
(
$
2
)
}
;
term
:
obj
{
$
1
}
/*
|
term
term
{
App
(
$
1
,
$
2
)
}
*/
sterm
:
obj
{
$
1
}
|
obj
SELECT
{
Select
(
$
1
,
label
(
$
2
))
}
;
app
:
/*
empty
*/
{
[]
}
|
sterm
app
{
$
1
::
$
2
}
;
term
:
sterm
app
{
apply
$
1
$
2
}
|
LAMBDA
LPAR
ID
COLUMN
ty
RPAR
term
{
Abst
(
Id
(
$
3
)
,
$
5
,
$
7
)}
|
obj
SELECT
{
Select
(
$
1
,
label
(
$
2
))
}
|
obj
UPDATE
meth
{
Update
(
$
1
,
label
(
$
2
)
,
$
3
)
}
|
obj
FUPD
term
{
Field_update
(
$
1
,
label
(
$
2
)
,
$
3
)
}
|
obj
FUPD
s
term
{
Field_update
(
$
1
,
label
(
$
2
)
,
$
3
)
}
;
meth
:
SIGMA
LPAR
ID
COLUMN
ty
RPAR
term
{
Method
(
Id
(
$
3
)
,
$
5
,
$
7
)
}
...
...
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