kaitai_struct icon indicating copy to clipboard operation
kaitai_struct copied to clipboard

List of all built-in variables

Open Mingun opened this issue 3 years ago • 1 comments

I notice that KSC recognises that list of variables in expressions, but not all of them described neigher in User Guide or KSY Reference. Because I implementing alternative compiler I need to known which variables availible and in which contexts.

I found, that KSC has following list of variables (https://github.com/kaitai-io/kaitai_struct_compiler/blob/eb420a617ae91a803659dfc29c8a8b54516b7b70/shared/src/main/scala/io/kaitai/struct/format/Identifier.scala#L77-L86)

  • _root
  • _parent
  • _io
  • _
  • _buf
  • _index
  • _on
  • _is_le
  • _sizeof

Can someone helps me to fill the following table:

Variable Context Meaning
_root instances.<...>.io Reference to root type in the current file
... ... ...

(Context -- name of KSY property in which expression can be used)

Mingun avatar Jul 29 '20 09:07 Mingun

Once such documentation is created, it will be easier to implement #404

Mingun avatar Jul 29 '20 09:07 Mingun