lelio-brun / obelisk Goto Github PK
View Code? Open in Web Editor NEWA simple multi-format pretty-printer for Menhir.
License: MIT License
A simple multi-format pretty-printer for Menhir.
License: MIT License
Hi,
The way <
and >
are handled in the generated HTML is a little bit... unusual. Using <
and >
would be better. What do you think ? This one is easy, so I'll make a PR.
Hi,
On the same file than the one in #10 ; on the line with the nonempty_list
, here's what I get in the LaTeX output:
& \grambar &\MATCH*{} \expr*{} nonempty\_list \zzzzzzEND*{}\\
Which visually gives something like: MATCH <expr> nonempty_list END
.
Obviously, something is missing, it should be: MATCH <expr> nonempty_list(<match_case>) END
.
The grammar
edn_assoc:
| BEGIN_ASSOC; lp = list(pair(value, value)); RIGHT_BRACE { lp }
;
will result in
<edn_assoc> ::= BEGIN_ASSOC <value> <value>* RIGHT_BRACE
and I would expect
<edn_assoc> ::= BEGIN_ASSOC (<value> <value>)* RIGHT_BRACE
Please let me know if there something I'm missing!
Also, thank you for the great software ๐
See #2 (comment)
Hi !
I've have a .mly file that looks like:
let expr :=
...
| MATCH; m = expr; l = nonempty_list(match_case); END; { Match (Raw, m, l) }
I then run obelisk -i parser.mly
and get:
<expr> ::= ...
...
| MATCH <expr> nonempty_list(<match_case>) END
But I would expect the following:
<expr> ::= ...
...
| MATCH <expr> <match_case>+ END
Am I missing something ? Note that, in the same file, list(X)
is correctly recognized and translated to X*
.
EDIT: I'm on OCaml 4.09.0, menhir 20200211 and obelisk 0.5.0.
Consider the following production definition:
endif: END | ENDIF { }
In Latex version, it will generate a \newcommand\endif{end\_if}
, however, \newcommand
definitions are not allowed to have names starting with end
, or it will emit an error. The generated code for productions starting with end
should be with \def
instead.
Hi,
There's a new syntax available in menhir. In practice, it looks like this. I'm wondering if you have any plan to add support for this new syntax in obelisk ?
Cheers,
Unless I'm mistaken, it's only possible to generate a complete, standalone file, as of now. If so, it would be nice to add an option to generate only the grammar part, in order to include it in a larger document.
See #2 (comment)
See #2 (comment)
Production and group bars should be treated differently in printers.
The following file does not produce a very nice output for comma_sep
and comma_sep1
:
%public %inline comma_sep(X) :
xs = separated_list(COMMA, X)
{ xs }
%public %inline comma_sep1(X) :
xs = separated_nonempty_list(COMMA, X)
{ xs }
Would be nice if this tool could output an EBNF accepted by https://www.bottlecaps.de/rr/ui .
Ideally menhir would have an option to output this kind of naked grammar to facilitate the work like I did for bison, byacc, ... here https://github.com/mingodad/lalr-parser-test .
See discussion here stan-dev/stanc3#1142 .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.