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

No viable alternative at input after eo:0.43.0:xmir-to-phi #3535

Open
volodya-lombrozo opened this issue Nov 24, 2024 · 10 comments
Open

No viable alternative at input after eo:0.43.0:xmir-to-phi #3535

volodya-lombrozo opened this issue Nov 24, 2024 · 10 comments
Labels

Comments

@volodya-lombrozo
Copy link
Member

I tried to upgrade eo-maven-plugin up to the 0.43.0 version and got a bunch of errors, the main is:

org/eolang/hone/App.phi:
	[9:27] no viable alternative at input 'j$org↦⟦j$eolang↦⟦j$hone↦⟦j$App↦⟦version↦Φ.jeo.int(α0↦Φ.org.eolang.bytes(α0↦⟦Δ⤍0': "EOF"
	[9:27] no viable alternative at input 'α0↦Φ.org.eolang.bytes(α0↦⟦Δ⤍0': "EOF"
	[9:27] no viable alternative at input 'α0↦⟦Δ⤍0': "EOF"
	[11:12] mismatched input ')' expecting {'}', '(', '.'}: "EOF"

How to reproduce:

  1. I disassemble java bytecode by using jeo-maven-plugin:disassemble into xmir
  2. Convert this xmir to phi by using eo-maven-plugin:0.43.0:xmir-to-phi
  3. Convert the phi back to xmir by using eo-maven-plugin:0.43.0:phi-to-xmir

On the (3) step I get the exception.

Expected behaviour: all the transformation work without errors. Moreover, xmir-to-phi and phi-to-xmir shouldn't alter the original xmir.

Also I attach all the files that might be helpful:
App.xmir.disassemble.txt
App.phi.txt
App.xmir.unphi.txt

@volodya-lombrozo
Copy link
Member Author

@yegor256 Could you take a look please?

@yegor256
Copy link
Member

@volodya-lombrozo I believe, it's a duplicate of #3534

@volodya-lombrozo
Copy link
Member Author

volodya-lombrozo commented Nov 24, 2024

@yegor256 I don't know. It's impossible to say anything from the error output. But I would suggest to keep both issues, at least for now.

@yegor256
Copy link
Member

@volodya-lombrozo the problem is that you are generating bytes in XMIR in 00 01 02 format, but it should be 00-01-02, starting from 0.43.0.

@yegor256
Copy link
Member

@volodya-lombrozo try to format bytes differently, with a dash between them, not space. This is what 0.43.0 expects

@maxonfjvipon
Copy link
Member

@volodya-lombrozo empty bytes must look like -- and one byte must end with dash: 00-, the same as in EO original grammar

@volodya-lombrozo
Copy link
Member Author

@yegor256 @maxonfjvipon Please note that the exception was thrown after the xmir-to-phi phase, specifically during the phi-to-xmir phase. This means that xmir-to-phi accepts the XMIR and produces incorrect phi. If xmir-to-phi had given me an error message about dashes and bytes formatting, it would indicate a bug in jeo-maven-plugin, but that is not the case now. Please add some sort of checking or specification that I can rely on. Otherwise, I have no way of knowing how many else inconsistencies jeo-maven-plugin might produce.

@volodya-lombrozo
Copy link
Member Author

It's kinda blocker.

@yegor256
Copy link
Member

@volodya-lombrozo we are planning to make XSD stronger, in #3534

@volodya-lombrozo
Copy link
Member Author

@yegor256 It would be awesome, I'm waiting for it

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

No branches or pull requests

3 participants