-
Notifications
You must be signed in to change notification settings - Fork 20
Convert a UAST into Python AST #91
Comments
Hi @pcyin. The short answer: it's not possible at the moment. Can you share more information about your use case? It looks like you are parsing Python sources (since you want python AST at the end) from Python (since you are using this client). If it's the only use case, it will be easier for you to use Python parser itself, without Babelfish server. On the other hand, if you want to convert any AST to Python AST, then the problem is on a totally different level. We are currently working on a new implementation of UAST that might make this conversion possible. |
If the problem is getting the Python AST you can use ParseNative instead of parse. |
@juanjux But it will not be directly compatible with Python's |
It's the same structure with added positions in some cases and json format. |
Sure, the structure is the same, but these object will not be of a class ast.AST defined in mentioned Python module. This might make a difference in some cases. |
Closing, as the question seems to be answered and there is no further discussion. |
I think it's relevant, but it should be addressed in SDK first: |
Hi. I am new to bblfsh and was wondering if I could convert a UAST into Python's AST structure defined by the
ast
module. Thanks!The text was updated successfully, but these errors were encountered: