Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ocamlyacc with cpspg #165

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/DblParser/YaccParser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ op
| op_80 { $1 }
| op_90 { $1 }
| op_100 { $1 }
;
;

/* ========================================================================= */

Expand Down Expand Up @@ -391,7 +391,7 @@ expr_90
;

// exp1 ** exp2
expr_100
expr_100
: expr_150 op_100 expr_100 { make (EBOp($1, $2, $3)) }
| expr_150 { $1 }
;
Expand All @@ -417,6 +417,7 @@ expr_select
: UID DOT expr_ctor { (NPName $1, $3) }
| UID DOT expr_300 { (NPName $1, $3) }
| UID DOT expr_select { let (p, e) = $3 in (NPSel($1, p), e) }
;

expr_250
: expr_300 { $1 }
Expand Down
7 changes: 6 additions & 1 deletion src/DblParser/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
(ocamlyacc (modules YaccParser))
(ocamllex (modules Lexer))
;(ocamlyacc (modules YaccParser));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this line instead of commenting it out? As discussed on the last meeting, we are going to use nice features of cpspg (which are not implemented yet), so I think in the near future, we will be incompatible with ocamlyacc.

(rule
(deps YaccParser.mly)
(target YaccParser.ml)
(action (run cpspg --compat -o %{target} %{deps})))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does cpspg generate .mli files? If yes, maybe it should be added to this rule (I'm sure, dune can do that. You can ask @Foxinio, our local dune guru). If not, maybe we could consider writing own YaccParser.mli file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not generate .mli files, but it should be straightforward to implement.


(library
(name dblParser)
Expand Down
Loading