抽象語法樹

import ast

tree = ast.parse('def hello_word(): print("hello world!")')

def hell_word():
    print(1)

print(ast.dump(tree))
  • 語法樹
  • 可以基於這個實現另外一種編程語言
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章