krfkeith / silver

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

Silver's separate namespaces for productions and nonterminals can clash in Copper specs #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Name a nonterminal and a production the same name. e.g.

nonterminal A;

concrete production A
top::A ::=
{}

and generate a parser. 

What is the expected output? What do you see instead?

Copper will raise errors due to the duplicate names 'A', while Silver is happy 
with this arrangement.

Actually, the bug may manifest itself as Copper complaining about mal-formed 
XML, since Silver will happily resolve the name to a production inside, say, 
the right-hand side list of symbols (which should only be terminal or 
nonterminal references)

Please use labels and text to provide additional information.

We had discussed a possibility of required productions to be lower case awhile 
back. That would solve the problem, but is also a breaking change (which is why 
we haven't done it yet.)  Another possibility would be to mangle the copper 
names a little bit more than they are now by adding a namespace prefix like 
"prod__" to productions.

Original issue reported on code.google.com by tux...@gmail.com on 11 Mar 2014 at 5:42