Skip to content
UPEEC

Lexers, Parsers and ASTs

Break code into tokens, build syntax trees, and analyse them.

Advanced
Comments 0
import ast
tree = ast.parse("x = a + 2")
print(ast.dump(tree, indent=2))

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.