You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a TA for an undergraduate programming languages course at the University of Michigan, where students use LearnOCaml to implement various typecheckers and evaluators. To help with test writing, we provide a menhir-generated parser for each assignment's language in the prepare.ml files.
Currently, setting this up involves a slow, tedious feedback loop due to various incidental limitations:
I use ocamllex and menhir to generate a parser, typically using a copied form of the language syntax datatype I've defined in the exercise prelude.ml file, which I have to make sure stays synchronized.
These tools generate line number directives in their outputs. As far as I can tell, these are not optional (cf this comment in menhir's source), and LearnOCaml does not accept such directives in its exercise files (albeit last I checked was a year or two ago). So first I remove the directives, using a regex find-and-replace.
I can't distribute exercise implementations over files other than the recognized ones, so I copy and paste over the generated lexer and parser into submodules of the recognized prepare.ml file. The generated implementations are very large, so this tends to require a lot of scrolling and/or careful code folding, especially when updating an existing large implementation.
These large implementations show up again in LearnOCaml's exercise build error messages, necessitating additional scrolling to reach the actual message, and continue to do so beyond parser development.
Wanted solution:
I'd like to be able to write a menhir .mly spec and an ocamllex .mll spec in an exercise directory, referring to definitions in prelude.ml, and the exercise build system will handle generation and scoping so that students can invoke them, without obscuring error messages with the generated output.
Considered alternatives:
No response
Additional context:
No response
The text was updated successfully, but these errors were encountered:
Related user(s):
No response
Related issue(s) or PR(s):
No response
Related project scope(s):
build
The problem:
I'm a TA for an undergraduate programming languages course at the University of Michigan, where students use LearnOCaml to implement various typecheckers and evaluators. To help with test writing, we provide a menhir-generated parser for each assignment's language in the
prepare.ml
files.Currently, setting this up involves a slow, tedious feedback loop due to various incidental limitations:
prelude.ml
file, which I have to make sure stays synchronized.prepare.ml
file. The generated implementations are very large, so this tends to require a lot of scrolling and/or careful code folding, especially when updating an existing large implementation.Wanted solution:
I'd like to be able to write a menhir
.mly
spec and an ocamllex.mll
spec in an exercise directory, referring to definitions inprelude.ml
, and the exercise build system will handle generation and scoping so that students can invoke them, without obscuring error messages with the generated output.Considered alternatives:
No response
Additional context:
No response
The text was updated successfully, but these errors were encountered: