-
Notifications
You must be signed in to change notification settings - Fork 33
"Expression is empty" error when using arrays #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
and what do you use as child class? you have provided duplication of parent class instead of child class |
if you have an array field then DSL builder needs information about length of the array and it should be provided through expression in
|
I will update that in a minute. But the child class should just have a single byte field in it. |
Updated the child object. I was using this with the binary code I committed on another branch and the output I get from that is this:
To me that makes the most sense. Can this be supported? I'd like to combine efforts here and have this wrapped into your library rather than maintain the external interface I built. |
If you check out that branch and want to simply run this in a test to see what it does you can use this JUnit test code: import org.junit.Test;
import java.io.IOException;
public class BinaryTest {
@Test
public void test1() throws IOException {
System.out.println(new BreakJBBPDslBuilderParent().getFormat());
}
} |
I have improved message in the exception to provide more information what does mean the error and how to fix |
If the field is going to be an array without a fixed size (e.g. a structure that repeats 0 or more times) what is the size I should specify there? Do I use the underscore like the DSL? |
if array should be read till end of stream then underscore should be used, extra="_" |
I have a parent class:
And a child class:
If I try to use the JBBPDslBuilder on the parent class like this:
I get an IllegalArgumentException with the message "Expression is empty" that is thrown by this line:
java-binary-block-parser/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java
Line 115 in 790058d
Is this the correct way I'd use the JBBPDslBuilder to work with a structure that has arrays in it?
The text was updated successfully, but these errors were encountered: