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
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
POTTIER Francois
menhir
Commits
4093bc82
Commit
4093bc82
authored
Jun 30, 2015
by
Yann Régis-Gianas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document.
parent
7a7a77e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
CHANGES
CHANGES
+5
-0
doc/main.tex
doc/main.tex
+3
-1
src/keyword.mli
src/keyword.mli
+10
-2
src/parserAux.ml
src/parserAux.ml
+2
-0
No files found.
CHANGES
View file @
4093bc82
2015/06/29:
Changed the treatment of positional parameters which are now
rewritten into named parameters of the form '_i' where 'i'
is an integer.
2015/02/11:
Added support for anonymous rules. This allows writing, e.g.,
list(e = expression SEMI { e })
...
...
doc/main.tex
View file @
4093bc82
...
...
@@ -516,7 +516,9 @@ semantic values of the terminal or nonterminal symbols that appear in the
production via the semantic value identifiers bound by the production. For
compatibility with
\ocamlyacc
, semantic actions can also refer to these
semantic values via positional keywords of the form
\kw
{
\$
1
}
,
\kw
{
\$
2
}
, etc.
\
This style is discouraged.
\kw
{
\$
1
}
,
\kw
{
\$
2
}
, etc.
\
This style is discouraged. Furthermore, as
a positional keyword of the form
\kw
{
\$
i
}
is internally rewritten as
\nt
{
\_
i
}
, such identifiers are forbidden.
\paragraph
{
\dprec
annotations
}
\label
{
sec:prec
}
...
...
src/keyword.mli
View file @
4093bc82
...
...
@@ -18,7 +18,12 @@ type where =
(* The user can request position information about a production's
left-hand side or about one of the symbols in its right-hand
side, which he can refer to by position or by name. *)
side, which he can refer to by position or by name.
A positional reference of the form [$i] is a syntactic sugar for the
name [_i]. This surface syntax is first parsed as a [parsed_subject]
and desugared as a [subject] during keywords rewriting into actual
OCaml identifiers. (See {!Lexer.transform_keywords}) *)
type
parsed_subject
=
|
PLeft
|
PRightDollar
of
int
...
...
@@ -29,8 +34,11 @@ and subject =
|
RightNamed
of
string
(* Keywords inside semantic actions. They allow access to semantic
values or to position information.
*)
values or to position information.
As said previously, a positional reference is a syntactic sugar
which appears in a [parsed_keyword] but is desugared in the
actual [keyword] representation. *)
type
parsed_keyword
=
|
PDollar
of
int
|
PPosition
of
parsed_subject
*
where
*
flavor
...
...
src/parserAux.ml
View file @
4093bc82
...
...
@@ -49,6 +49,8 @@ let check_production_group right_hand_sides =
end
;
right_hand_sides
(* [normalize_producer i p] assigns a name of the form [_i]
to the unnamed producer [p]. *)
let
normalize_producer
i
(
pos
,
opt_identifier
,
parameter
)
=
let
id
=
match
opt_identifier
with
...
...
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