Hello, Sean.
2012/8/4 Sean Bartell <[email protected]>:
> Hello, everyone,
>
> I've implemented conditions and repetition in Bithenge[0]. There are
> more examples in the test files[1].
I have two more comments and one question.
First, if you specify an unknown field in a switch (run with hex:00)
transform main = struct {
switch (.non_existent) {
1: { };
else: { };
}
};
Bithenge would enter some endless recursion and eventually die.
Next, I have a suggestion on error reporting. Right now, any error is
reported via its number only. If you have an error in your script
(logical, not syntactical), printing stops somewhere in the middle
with "invalid value" or similar, giving almost no hint what is the
root cause.
Do you think you can improve that somehow? Either by defining more
fine-grained error codes or returning bigger context or ...?
Last thing - do you think it would be possible to support recursive
structures? At least a simple variant that a structure can reference
itself? I am not sure that it is possible at all with current design
but it might be a natural way of describing some data...
What I have in mind is this:
transform recursive = struct {
.have_next <- nonzero_boolean <- uint8;
.data <- whatever;
if (.have_next) {
.next <- recursive;
}
}
Thanks
- Vojta
>
> My next task is to implement bitfields. Decoding a sequence of bits is
> similar to decoding a sequence of bytes, so I will reuse the existing
> code and syntax as much as possible. I'm still two days late, partly
> because repetitions required more thought than I expected, but I'm still
> hoping to catch up.
>
> Thanks,
> Sean Bartell
>
> [0] http://trac.helenos.org/wiki/StructuredBinaryData#FlowControl
> [1]
> https://bazaar.launchpad.net/~wtachi/helenos/bithenge/files/head:/uspace/dist/src/bithenge/
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel