uxmal / pytocs

Converts Python source to C#
Apache License 2.0
552 stars 167 forks source link

2.0.1 Errors Unexpected token {OP_GT} and Expected token type ID but saw LPAREN. #91

Closed ATECoder closed 1 year ago

ATECoder commented 1 year ago

@uxmal, I am humbled by the speed in which you are fixing these issues.

I am trying to port the python RPC lib and then the Python VXI-11 so as to have an open-source library for talking to LXI instruments. Presently, the LXI foundation relies on the IVI foundation which relies on vendors such as NI, Keysight and Rohde-Schwarz, who are IVI members, for the implementation of VXI-11. Unfortunately, these implementations are closed source. Their .NET implementations go back to .NET Framework 3.5, even though, they could definitely be refactored fairly quickly in .NET standard 2.0, I still am awaiting replies to my requests and queries about timelines.

So, here we are. Here are the issues I am reporting.

Source code at: https://svn.python.org/projects/python/trunk/Demo/rpc

py2ocs reports the following:

AST cache is at: C:\Users\David\AppData\Local\Temp\pytocs\ast_cache

58% (46 of 79) SPEED: 86/s AVG SPEED: 86/s Error: (C:\pub\lxi\rpc\nfsclient.py,166): parser error. Please report on https://github.com/uxmal/pytocs C:\pub\lxi\rpc\nfsclient.py(166): Unexpected token {OP_GT}. Error: (C:\pub\lxi\rpc\rpc.py,333): parser error. Please report on https://github.com/uxmal/pytocs C:\pub\lxi\rpc\rpc.py(333): Expected token type ID but saw LPAREN. Error: (C:\pub\lxi\rpc\xdr.py,81): parser error. Please report on https://github.com/uxmal/pytocs C:\pub\lxi\rpc\xdr.py(81): Unexpected token {OP_GT}. Error: (C:\pub\lxi\rpc\xdr.py,186): parser error. Please report on https://github.com/uxmal/pytocs C:\pub\lxi\rpc\xdr.py(186): Unexpected token {OP_GT}.

100% (79 of 79) SPEED: 117/s AVG SPEED: 97/s Finished loading files. 546 functions were called. Analyzing uncalled functions.

100% (1071 of 1071) SPEED: 9325/s AVG SPEED: 9306/s
---------------- Analysis symmary ----------------

uxmal commented 1 year ago

It appears that the issue is that the Python <> operator (for inequality) was removed in Python 3. You'd need to translate those files to be Python 3 compliant. Pytocs only supports Python 3 and later versions. You may consider trying tools that translate Python 2 to Python 3 and try again.

ATECoder commented 1 year ago

Indeed, converting 2 to 3 removed the errors.