Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.