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].
Nice. I am still playing with my BMP script - with repetitions it
almost works but it would be very helpful to have some simple
expressions. At least comparisons and adding/multiplying with a
constant.

I also started working on a GIF script (to try something more cryptic)
and I encountered a problem which I think is actually a bug. Below is
my minimal example:

transform main = struct {
        .kind <- uint8;
        switch (.kind) {
                0: { };
                else: {
                        .str <- ascii <- known_length(.kind);
                };
        }
};

I would say that such script is syntactically okay and semantically it
shall express: treat some values specifically (here only 0) and for
the rest just skip following .kind bytes.

Running Bithenge with hex:00 works as expected and {"kind":0} is printed.
I would expect that for hex:0120, the output would be { "kind": 1,
"str": " "}. However, Bithenge prints  {"kind": 1Error printing node:
No such file or directory.
But if the known_length(.kind) is changed to known_length(1), hex:0120
works as expected.

Ideas what could be wrong?

Otherwise, good job. I like the simple syntax though sometimes I am a
bit confused where is the semicolon required and where it is
prohibited ;-).

Bye,
- 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

Reply via email to