-
Notifications
You must be signed in to change notification settings - Fork 84
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
Vendor happy-codegen-common
into happy-grammar
#286
Comments
OK my thinking was this is that: Yes, this does reflect the syntax of happy grammars, but none of this stuff is about the grammar itself (a mathematical construct) and instead all this stuff is misc hooks for the backends. (It is somewhat comparable to inline assembly in being a sort of wormhole to talk to a later pipeline stage.) I figured if we ever got things like a grammar or table "interpreter", those would not need any of these options, but just work on the grammar itself. Likewise I would try to decouple the assumption of grammers always having Haskell elimination rules, etc. from the grammer type, so you could do something like write just the grammar, and then separately write the elimination rules for a given grammer. I should probably just admit I don't have time time to do any of these things, but I thought I would leave this comment for posterity. |
I totally agree with you in principle that we should strive for a decoupled design with small domain types. That's why I like the main part of #221: Introducing a type that captures pragmas. On that front: for |
I do think a modular CLI is kinda a fraught concept because UI stuff is hard/complex/less naturally orthogonal, but I would be happy if if the RAD backend was just stuck in this repo and shipped by default. |
Well, that sounds quite antithetical to the whole purpose of modularisation. Why would you split everything into libraries, except the CLI, even if Apart from that, I think it's a bad idea to merge |
The package
happy-codegen-common
presently contains a single file:This data type describes pragmas to be used in happy's .y-files such as
%expect
,%monad
, etc.Hence this file belongs in
happy-grammar
, which defines the remaining AST data types for happy's .y-files.Doing so has the nice benefit of cutting down on the jungle of
happy-*
packages. We will have just the following dependency structureThis will revert #221 (Edit: Actually it doesn't. The new domain data type expressing pragmas is still there; good), but I do disagree with the opening statement
As I said above, the pragmas whose AST representation
CommonOptions
encodes are very much part of the syntax of grammar files.The text was updated successfully, but these errors were encountered: