melt-umn / silver

An attribute grammar-based programming language for composable language extensions
http://melt.cs.umn.edu/silver/
GNU Lesser General Public License v3.0
59 stars 7 forks source link

AGDcl vs Dcl vs Decl #537

Open remexre opened 3 years ago

remexre commented 3 years ago

We're inconsistent in how we name AGDcl productions. Amongst non-forwarding ones:

AGDcl:

Dcl:

Decl:

IMO we should either

  1. rename AGDcl to Decl and change to uniformly be Decl
  2. change to uniformly be AGDcl

Primary considerations:

krame505 commented 3 years ago

Yeah, I agree it's kind of a mess. I'm not sure what the best convention to follow is though, if it is worth cleaning this up.

Decl is IMO preferable to AGDcl, since the only kinds of Decls we have are Silver/attribute grammar ones (not including the tutorial)

We also have "production statements" some of which are definitely declarations, so I'm not a huge fan of just Decl (although AGDcl itself doesn't really help to clarify things there that much...) Also ableC has Decls, would be another small point of confusion in silver-ableC.

Maybe GlobalDecl? IDK.

remexre commented 3 years ago

On the topic of bad names (expect more of these, I'm defining an aspect on every non-forwarding prod in the Silver syntax tree), nilModuleStmts vs consModulesStmts... (consModulesStmts)

remexre commented 3 years ago

Another inconsistency:

(resp cons, one, append)

remexre commented 3 years ago

seperatedTerminalPrefix is misspelled (at this point making notes for myself when I go back to fix all these)

ericvanwyk commented 3 years ago

I fully support refactoring all of this.

I like Decl. Lucas is right that there are declarations in other places, but they are local ones and we can have a more specific name for them.

The Silver style guide - http://melt.cs.umn.edu/silver/style-guide/, yes there is one - might be considered and updated in doing this. It suggests nilFoo and consFoo for lists.

Thanks!