congo-cc / congo-parser-generator

The CongoCC Parser Generator, the Next Generation of JavaCC 21, which in turn was the next generation of JavaCC
https://discuss.congocc.org/
Other
36 stars 11 forks source link

Add sugar for LHS references to @Property variables in the production #53

Closed adMartem closed 1 year ago

adMartem commented 1 year ago

I think this is ready to pull, but I also think the jar needs to be refreshed. When I tried it on my machine with the main branch before this change, the refresh failed because of a couple of warning suppression annotations I think were committed by accident. I removed them and rebuilt the jar and then successfully applied and tested these changes, but I wasn't sure how you wanted to handle the refresh (including the proper environment to do so), so I'll leave this PR for you to apply when it seems opportune.

Meanwhile I will prepare a blog post that describes this (Java at the moment) feature as well as the LHS for tree-node annotations that I did a few months ago. (See below)

I've actually gone a little past this batch of changes with my JTB branch, allowing the properties to be automatically created in the production node if they are not already there, and allowing the LHS to be available on any expansion unit of the production using the ability to insert synthetic syntactic nodes that I had to develop for the JTB stuff.

Anything more that this PR is now kind of hung up on my problems figuring out why I can't get python to work with the reorganized version of the parser productions template upon with this change is based. I'll keep tilting at that windmill.

revusky commented 1 year ago

I'll have a look soon.

adMartem commented 1 year ago

More Cowbells.md

revusky commented 1 year ago

When I tried it on my machine with the main branch before this change, the refresh failed because of a couple of warning suppression annotations I think were committed by accident.

Oh, I see. That's my fault. Well, the problem, more precisely was that there was a bug where it was inserting the annotation in the wrong place. I had fixed that issue in my own fork but it was still there in the congo-cc repository. Well, anyway, if you synch up, the issue should be gone, git pull https://github.com/congo-cc/congo-parser-generator.git

revusky commented 1 year ago

More Cowbells.md

Yes, this definitely looks like a good thing!