Skip to content
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

GO: Serialization #1076

Open
yywing opened this issue Nov 22, 2023 · 3 comments
Open

GO: Serialization #1076

yywing opened this issue Nov 22, 2023 · 3 comments

Comments

@yywing
Copy link
Author

yywing commented Nov 22, 2023

kaitai_struct_go_runtime:

  • add more function for compiler, make go translator like other language.
    • if case
    • err resolve
  • add function to support writer

kaitai_struct_compiler:

  • rewrite go translator supoprt writer

@mashiro01
Copy link

the changes we do:

  • kaitai_struct_go_runtime
  1. delete original reader and writer, and combined them into a new struct -> stream (like python and java's runtime)
  2. for go, add a new rws(read, write, seek) buffer struct
  3. for terminated string and bytes, add a new struct to describe them(util.go)
  • kaitai_stricuct_compiler
  1. splite common reader and common write into go reader and go writer (also works well for any other language)
  2. rewrite go translator to support writer
  3. complete functions in go compiler
  4. some type conversions are fixed(support go's interface{})
  5. clean up unuseful code generate

now we can use the compiler to generate go files which support serialize and unserialize

@yywing
Copy link
Author

yywing commented Dec 26, 2023

for terminated string and bytes, add a new struct to describe them

This change is used to calc length when write. We add this.SizeOf() to calc length of struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants