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

Begin implementing STEF IDL #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Begin implementing STEF IDL #43

wants to merge 1 commit into from

Conversation

tigrannajaryan
Copy link
Collaborator

This adds formal support for the IDL that is used in the specification.
I plan to eventually replace the JSON representation by this IDL. It is
much easier to use for humans. For example the Otel STEF IDL is 151 easily
readable lines, whereas the equivalent in JSON is 487 harder to read lines.

The IDL will only be used by the generator. The lexer/parser is not subject
to inputs that may come malicious sources, so I am setting the testing and fuzzing
bar relatively low since there is no attack risk and the worse case the generator
will fail to run or will run incorrectly.

The IDL implementation is not yet used anywhere. It is only verified in tests.
Future PRs will replace JSON usage by IDL in the generator.

The parser is a hand-coded recursive descent parser with separate lexer
for tokenization. I looked at alternates, particular at defining the grammar
in ABNF and using ABNF parsers available in Go. Unfortunately none that I tried
worked and it was simpler to just hand code it.

This adds formal support for the IDL that is used in the specification.
I plan to eventually replace the JSON representation by this IDL. It is
much easier to use for humans. For example the Otel STEF IDL is 151 easily
readable lines, whereas the equivalent in JSON is 487 harder to read lines.

The IDL will only be used by the generator. The lexer/parser is not subject
to inputs that may come malicious sources, so I am setting the testing and fuzzing
bar relatively low since there is no attack risk and the worse case the generator
will fail to run or will run incorrectly.

The IDL implementation is not yet used anywhere. It is only verified in tests.
Future PRs will replace JSON usage by IDL in the generator.

The parser is a hand-coded recursive descent parser with separate lexer
for tokenization. I looked at alternates, particular at defining the grammar
in ABNF and using ABNF parsers available in Go. Unfortunately none that I tried
worked and it was simpler to just hand code it.
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

Successfully merging this pull request may close these issues.

2 participants