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

Full and flattened tree #36

Closed
ch3njust1n opened this issue Mar 1, 2017 · 2 comments
Closed

Full and flattened tree #36

ch3njust1n opened this issue Mar 1, 2017 · 2 comments

Comments

@ch3njust1n
Copy link

Is there a way I can just get the full tree flattened without having to reconstruct it with the paths and nodes from each iteration?

@c2nes
Copy link
Owner

c2nes commented Mar 1, 2017

You can walk any AST node (depth first) by iterating over it,

tree = javalang.parse.parse(java_source)
for path, node in tree:
    print path, node

is this what you're looking for?

@ch3njust1n
Copy link
Author

Not exactly what I was looking for, but I figured it out. Thanks.

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