Maybe I'm trying to pet the cat backwards because I come from a 010 background, so if I could hold things better please let me know! Essentially I'm trying to write a pattern for a file format that holds multiple string tables and then I have objects that have indices into these string tables. Over in 010 land I would just do something like this:
typedef struct (StringTable &table)
{
ubyte index;
local string value = table.entries[index].value;
} StringTableReference <read=ReadStringTableReference>;
string ReadStringTableReference(StringTableReference &ref)
{
return ref.value;
}
struct Foo(StringTable &table)
{
StringTableReference name(table);
};
struct Header
{
StringTable foo_string_table;
};
struct NestedThing(Header &header)
{
ubyte count;
Foo my_foos(header.foo_string_table)[count];
};
Header header;
NestedThing nested(header);
Hope that kinda makes sense. With ImHex patterns this doesn't look like an option, instead my best option is to actually nest the structs and then use parent to navigate back up the chain to get the string table again. Is that true, or am I missing something in the pattern language?