silver
silver copied to clipboard
AGDcl vs Dcl vs Decl
We're inconsistent in how we name AGDcl
productions. Amongst non-forwarding ones:
AGDcl:
-
errorAGDcl
-
emptyAGDcl
-
appendAGDcl
-
defsAGDcl
Dcl:
-
annotationDcl
-
aspectFunctionDcl
-
aspectProductionDcl
-
attributeDclInh
-
attributeDclSyn
-
defaultAttributionDcl
-
errorAttributionDcl
-
functionDcl
-
globalValueDclConcrete
-
instanceDcl
-
jarNameDcl
-
nonterminalDcl
-
productionDcl
-
typeClassDcl
-
terminalDclDefault
-
flowtypeDcl
-
flowtypeAttrDcl
-
collectionAttributeDclInh
-
collectionAttributeDclSyn
-
parserDcl
-
disambiguationGroupDcl
-
attributeDclParser
-
attributeAspectParser
-
copperMdaDcl
-
aspectDefaultProduction
-
ffiTypeDclUgly
Decl:
-
typeAliasDecl
-
lexerClassDecl
IMO we should either
- rename
AGDcl
toDecl
and change to uniformly beDecl
- change to uniformly be
AGDcl
Primary considerations:
- If the production name is going to have a suffix to identify the nonterminal, it really ought to match the nonterminal
- We shouldn't do
Dcl
since a lot ofDclInfo
productions useDcl
as a suffix (though we could refactor that too) -
Decl
is IMO preferable toAGDcl
, since the only kinds ofDecl
s we have are Silver/attribute grammar ones (not including the tutorial)
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 Decl
s, would be another small point of confusion in silver-ableC.
Maybe GlobalDecl
? IDK.
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
... (consModules
Stmts)
Another inconsistency:
-
nilFoo
-
nilFoos
-
foosNil
(resp cons
, one
, append
)
seperatedTerminalPrefix
is misspelled (at this point making notes for myself when I go back to fix all these)
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!