by gabiruh · 4y ago · 0 comments
my $s = Struct("foo",
UBInt8("a"),
UBInt16("b"),
Struct("bar",
UBInt8("a"),
UBInt16("b"),
)
);
my $data = $s->parse("ABBabb");
# $data is { a => 65, b => 16962, bar => { a => 97, b => 25186 } } length u32
data u32[length]
This is a huge problem for traditional parsers since the input modifies the grammar dynamically.