krfkeith / silver

Automatically exported from code.google.com/p/silver
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Break DclInfo down into multiple types #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Provide an explanation of what the project should entail:

The type "DclInfo" is used to represent some generic information about 
declarations in Silver.

Currently, this type is the same for all different kinds of declarations:
1. values
2. types
3. attributes
4. occurs
5. lexer classes
6. probably more!

The purpose of this project is to make each of these differents types of 
declarations actually
different TYPES.  i.e. ValueDclInfo, TypeDclInfo, AttributeDclInfo, 
OccursDclInfo, etc.

Provide a concrete example of a problem this project will fix:

The change will be somewhat superficial for the moment, because we don't have 
the tools (YET)
to take advantage of this change.

In the future, the advantage will be that the set of attributes that need to be 
defined for a
DclInfo will be machine-discernable and checkable.  (Currently, there are 
attributes that
occur on DclInfo that only apply to one/some of the above.  Lexer classes do 
not have types, etc.)

At the present, it will simply make the code much higher quality, and easier to 
understand.

Provide a short guide on how to start this project:

Begin by looking at EnvItem and EnvTree in silver:definition:env.
and at QNameLookup in silver:definition:core QName.sv.
Then take a look at Env and Defs in silveR:definition:env.

Provide a very rough and probably inaccurate expectation of what the set of 
patches completing this project would look like:

1. Parameterize EnvItem, EnvTree, and QNameLookup, but leave everything as is
   (i.e. the parameter is always 'Decorated DclInfo' in Env and Defs).
2. Start by trying to remove 'Decorated' from occurs declarations. This should 
shake-out any problems by starting to have
   the type be different, without requiring too many invasive changes.
3. Now introduce an OccursDclInfo nonterminal that has only occurs-declaration 
relevant info on it.
4. After each of these change is done, working, and committed, continue until 
they are all done.

Probable challenges in completing this project:

You find (and be able to fix) a couple of kludges during this.  For example 
there's some awful code
involved in getting the type of an attribute from the occurs declaration and a 
nonterminal type that
currently de-decorates and re-decorates the dclinfo, which doesn't need to 
happen once it's not
passed around decorated anymore.

Do TypeDclInfo and LexerClassDclInfo last, because once to try to do them, 
you're going to run into
some awful code in the copper modification that you'll probably need my help to 
fix.  Alternatively,
forgo introducing LexerClassDclInfo for the time being, and make it just be a 
TypeDclInfo.
(This is related to some places where "terminals or lexer classes" are 
expected, so there will
be some difficulty in having two different types.)

Additional Information:

Technically, removing the 'Decorated' from DclInfo could be a whole separate 
project to itself.

Original issue reported on code.google.com by tux...@gmail.com on 10 Jan 2012 at 12:44

GoogleCodeExporter commented 9 years ago
Template labels didn't seem to take, manually adding them.

Original comment by tux...@gmail.com on 10 Jan 2012 at 12:46

GoogleCodeExporter commented 9 years ago

Original comment by kevin.ar...@gmail.com on 16 Jan 2012 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by kevin.ar...@gmail.com on 6 Jun 2012 at 7:16