charmplusplus / charm

The Charm++ parallel programming system. Visit https://charmplusplus.org/ for more information.
Apache License 2.0
202 stars 49 forks source link

charmxi: redundant semicolons lead to erroneous error messages #1007

Closed pplimport closed 7 years ago

pplimport commented 8 years ago

Original author: Ralf Gunter Corrêa Carvalho Original issue: https://charm.cs.illinois.edu/redmine/issues/1007


This innocuous piece of code...

<code>mainmodule m {
  mainchare c {
    entry c(CkArgMsg *msg);;
  }
}</code>

causes the following error:

<code>~/p/p/c/t/c/c/tmp ❯❯❯ ~/programming/ppl/charm/net-darwin-x86_64/bin/charmxi semicolon.ci                                                                                                                         ⏎
semicolon.ci:3:28-28: error: invalid SDAG member
  entry c(CkArgMsg *msg);;
                         ^</code>

This is probably due to the inconsistent way we deal with semicolons.

harshithamenon commented 5 years ago

Original date: 2016-04-25 18:24:56


I ran into a similar issue when compiling amr with latest branch of charm

to reproduce

git clone charmgit:users/alanger/amr git checkout abstract3d make

This throws an error in charmxi parsing

nitbhat commented 5 years ago

Original date: 2016-10-13 19:53:41


Fix: https://charm.cs.illinois.edu/gerrit/#/c/1915/ https://github.com/UIUC-PPL/charm/commit/c30a4e57122b99147477654f956254ed3a34b309 In all places where a semicolon is optional, I changed the parsing rule to allow 0 or more semicolons. In all places where a semicolon was required, I changed the parsing rule to allow 1 or more semicolons.

Fix works for:

mainmodule m {
  mainchare c {
    entry c(CkArgMsg *msg);;
  }
}

For the case mentioned by Harshitha, it was a case of having a semicolon at the end of an SDAG block. There wasn't a rule matching this.

mainmodule m {
  mainchare c {
    ...
    entry foo() serial {

    };
  }
}

For this, I added an optional semicolon at the end of an '{' CCode '}' block. With the fix, this passes as well.