Open glass-ships opened 4 years ago
Currently it is not possible to access the data from the original KSY. I remember there was an issue about it.
The names of variables are though derived from id
in known way. More precisely, the names are transformed from snake_lower_case to the style convention used in the lang. If there are no trailing and leading underscores, you can compute the original names given language-specific variable names.
Ah, apologies - so this is in the context of kaitai-struct-compiler
, so the language in question is scala
.
Currently I'm working on implementing a new target language, cpp_awk
which will use C++ to store data in Awkward arrays.
The fork can be found here
What I'm really wondering is whether the classes in scala allow me to access those variable names, and how to do so.
So I've done some investigating and inside ConstructClassCompiler.scala
there's an instance where ClassSpecs
gets passed in, which may contain the information i need.
Does anyone know of a way to inspect this class in command line, and see what objects it contains? Perhaps using sbt
in command line?
Just bumping this thread in case anyone has some thoughts
Using this ksy for reference-
I'm wondering how I can generate, for example
animal_entry_t
,m_entry
,weight
, etc. generally?Things like
${privateMemberName(id)}
are scoped only within certain functions, and some like${types2class(typeProvider.nowClass.name)}
return different strings depending on where they are called.Is there a consistent way to access the
id
s andtype
s described in a ksy file?