Extracting typehierarchy with lgbtypes


Hi all,

I am trying to extract the expanded hierarchy with the lgbtypes but I haven’t had much luck. I tried reading through the source files but they are a bit obscure. The output format could be a tdl, or hash table or whatever. My guess is this should be possible, given that the functions to parse and process the hierarchy are there…

Thanks a lot!


There is a function lkb:output-types that may do what you want.

I have a patched version here that outputs them as xml:

I would like the opposite, output types without the glbs, if anyone
knows how to do that :-).


This works, thanks! Btw, is there any way to run this as a script without having to click through the lkb interface?


Glad to help!

take a look at: https://github.com/fcbond/ltdb/blob/master/make-ltdb.bash


Perfect, thank you!


I think this should be fairly easily doable with PyDelphin’s tdl module, since it does not compute glb types. You would use tdl.iterparse() to enumerate the objects in some top-level TDL file, then look for TypeDefinition events and extract the object’s identifier and supertypes in order to build the hierarchy, and look for FileInclude events to parse an included TDL file.