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

can't convert open62541.c #242

Closed
eugeis opened this issue Nov 11, 2018 · 5 comments
Closed

can't convert open62541.c #242

eugeis opened this issue Nov 11, 2018 · 5 comments

Comments

@eugeis
Copy link

eugeis commented Nov 11, 2018

Hello,
I am trying to convert
https://github.com/open62541/open62541/releases/download/0.3-rc2/open62541.c

and get many AST error, see
https://github.com/eugeis/gopen62541/blob/master/open62541.go

Is it easy to resolve or too difficult?
Thank You

@Konstantin8105
Copy link
Owner

Thank you for sending AST error.
For myself - easy. I think tomorrow- I will fix.

@Konstantin8105
Copy link
Owner

Konstantin8105 commented Nov 12, 2018

Dear @eugeis ,
Again thanks for AST ERROR.
Please try transpile with argument -s like that:

c4go transpile -s open62541.c

eugeis pushed a commit to eugeis/gopen62541 that referenced this issue Nov 12, 2018
@eugeis
Copy link
Author

eugeis commented Nov 12, 2018

Dear @Konstantin8105 ,
thank you for your improvement.

It seems to be better now, but still some AST issues like

Cannot parse line: VarDecl 0x55b0fd0132f0 <col:5, col:37> col:20 used range 'UA_UInt32Range':'UA_UInt32Range' nrvo cinit. could not match regexp with string
^(?P

[0-9a-fx]+) (?:parent (?P0x[0-9a-f]+) )?(?:prev (?P0x[0-9a-f]+) )?<(?P.)>(?P .+:\d+)?(?P used)?(?P referenced)?(?P \w+)? '(?P.+?)'(?P:'.?')?(?P extern)?(?P static)?(?P tls)?(?P register)?(?P cinit)?(?P callinit)?(?P nrvo)?[\s]*$
0x55b0fd0132f0 <col:5, col:37> col:20 used range 'UA_UInt32Range':'UA_UInt32Range' nrvo cinit

Would you like to check it out, I regenerated the file:
https://raw.githubusercontent.com/eugeis/gopen62541/master/gen/open62541.go

@Konstantin8105
Copy link
Owner

Dear @eugeis ,
this is maximal of translation.
Now, transpilation is ok only for small source with minimal dependency.
For example, for next header c4go haven't any implementation:

/usr/include/netinet/tcp.h
/usr/include/xlocale.h
/usr/include/arpa/inet.h
/usr/include/asm-generic/socket.h
...

Also, some variable have not UA_STRING_NULL implementation in C.

@eugeis
Copy link
Author

eugeis commented Nov 14, 2018

ok, thank you for your fixes.
I understand that the source code complex is, maybe be in some time it will be possible to achieve better results.

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

2 participants