You've already forked libadalang
mirror of
https://github.com/AdaCore/libadalang.git
synced 2026-02-12 12:28:54 -08:00
Move most of "ada/*" to the root directory (this makes sense, as this repository has been dedicated to Libadalang for years), and rename "ada/language" to "ada". TN: T914-010
19 lines
399 B
Python
19 lines
399 B
Python
from libadalang import AnalysisContext
|
|
|
|
|
|
def dump(node, indent=0):
|
|
indent_str = '| ' * indent
|
|
if node is None:
|
|
print('{}<null node>'.format(indent_str))
|
|
return
|
|
|
|
print('{}<{}>'.format(indent_str, node.kind_name))
|
|
for child in node:
|
|
dump(child, indent + 1)
|
|
|
|
|
|
ctx = AnalysisContext('iso-8859-1')
|
|
unit = ctx.get_from_file('foo.adb')
|
|
dump(unit.root)
|
|
print('Done')
|