swp-uebersetzerbau-ss13 / common

Shared files between teams.
1 stars 0 forks source link

Problem in m2 example cond.prog #33

Closed fub-frank closed 11 years ago

fub-frank commented 11 years ago

m2 example cond.prog contains the line

print "bla";

This is an impossible statement according to the source language grammar:

stmt -> assign | ... | print loc;
loc -> loc [assign] | id | loc.id

Therefore no literals can be printed but only identifiers (variables). It is also impossible to represent the above code in the AST as the AST restricts the child node of print to identifierNode.

fub-frank commented 11 years ago

The same problem occurs with print "\n" in print.prog

Tkrauss commented 11 years ago

We discussed that issue already in the plenum two weeks ago. As far as i understood Yves, it is valid to change the code to that, that it stores the strings in a variable and print the variable. I don't know who exactly is in charge of this modification, but i think we all agree if you're changing it.

flofreud commented 11 years ago

We discussed explicitly who should change it but it was on my list. I had no time yet for this fix. I hope I am able to changes this tonight, but if someone volunteer...

On Tue, Jun 4, 2013 at 1:13 PM, Tkrauss notifications@github.com wrote:

We discussed that issue already in the plenum two weeks ago. As far as i understood Yves, it is valid to change the code to that, that it stores the strings in a variable and print the variable. I don't know who exactly is in charge of this modification, but i think we all agree if you're changing it.

— Reply to this email directly or view it on GitHubhttps://github.com/swp-uebersetzerbau-ss13/common/issues/33#issuecomment-18902649 .