Open schuster opened 8 years ago
We removed the automatic parser-
(define-parser parse-
I think of the auto generated parser and with-output-language as being for slightly different purposes. I use parse when I’m reading in a full program. I tend to use with-output-language when I’m ginning up bits of language form outside of the right-hand side of a pass body.
When I get some spare time, I will update the docs accordingly.
Since I’ve noticed you’ve commented more on this :)
Kent and I made the strategic decision to make the asymmetric change of having define-parser be separate while define-unparsed is not, because we were basically never using the parsers for the Chez Scheme compiler. The parsers are too simple to really be useful inside a commercial compiler, but they are great for a teaching compiler. The unparsers, on the other hand, and useful for tracing and for error messages and almost always end up getting used. (In particular the trace-define-pass makes use of the unparsers, which is handy for debugging.)
That said, there is actually a separate define-unparsed form as well, and you can define separate unparsers with it, if you wanted a different name, or something along those lines.
-andy:) On March 4, 2016 at 3:01:45 PM, Jonathan Schuster (notifications@github.com) wrote:
Section 2.3 claims that define-language produces a parser function parse-
— Reply to this email directly or view it on GitHub.
I’m reading Nanopass’ documentation and I just tripped over the false claim that parse-language-name
would be provided. Only unparse-language-name
is provided, and parse-language-name
has to be defined with define-parser
.
In other words, the implementation behaves like @akeep described in the comment above, of course. But the documentation doesn’t reflect that.
I believe #21 fixes this. Should have referenced this issue in the Pull request, sorry.
Section 2.3 claims that define-language produces a parser function
parse-<language-name>
and an unparserunparse-<language-name>
, but I'm told that's not the case and to usewith-output-language
instead. This should be reflected in the docs.