Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pos attribute generation #132

Open
c71n93 opened this issue Sep 18, 2023 · 0 comments
Open

Fix pos attribute generation #132

c71n93 opened this issue Sep 18, 2023 · 0 comments

Comments

@c71n93
Copy link
Member

c71n93 commented Sep 18, 2023

In this example (taken from src/test/resources/integration/in/basic_cycle/basic_cycle.xmir):

[] > classA
  classB > @
  [] > doA
    stdout > @
      "A"

[] > classB
  classA > @
  [] > doBA
    ^.doA > @

XMIR listing of object classB looks like this:

<o abstract="" line="9" name="classB" pos="0">
   <o base="classA" line="10" name="@" pos="2"/>
   <o abstract="" line="11" name="doBA" pos="2">
      <o base="^" line="12" pos="4"/>
      <o base=".doA" line="12" method="" name="@" pos="5"/>
   </o>
</o>

DDR gives result transformed XMIR with such classB object (taken from src/test/resources/integration/out/basic_cycle/basic_cycle.xmir):

<o abstract="" line="9" name="classB" pos="0">
   <o base="classA" line="10" name="@" pos="2" ref="3"/>
   <o abstract="" line="11" name="doBA" pos="2">
      <o base="^" line="12" pos="4"/>
      <o base=".@" line="12" method="" pos="9"/>
      <o base=".doA" line="12" method="" name="@" pos="5"/>
   </o>
</o>

As an EO code, classB object should look like this:

[] > classB
  classA > @
  [] > doBA
    ^[email protected] > @

So pos of .@ equals "5" and pos of .doA equals "7". But this is not the case in the XMIR file.
We either need to delete thepos attribute for objects that are related to DDR working process, or handle their pos attribute correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant