Closed fafok29 closed 11 months ago
Looking at parser.y from babeltrace:
ctf_assignment_expression: unary_expression CTF_EQUAL unary_expression [...]
where:
unary_expression:
postfix_expression
[...]
where:
postfix_expression: IDENTIFIER [...] | ID_TYPE [...] | keywords [...]
So indeed, it appears that keywords should be considered at least as postfix expressions, and probably as primary expressions within this grammar.
But please don't put too much effort on TSDL and CTF 1.8, as the active work is happening on CTF 2 (https://diamon.org/ctf/files/CTF2-SPECRC-8.1rA.html), which replaces TSDL by JSON-seq. It will remove the need for a custom grammar altogether.
So indeed, it appears that keywords should be considered at least as postfix expressions, and probably as primary expressions within this grammar.
Good to know, thank you, could you please point me to parser.y, maybe I can use it as a reference instead.
But please don't put too much effort on TSDL and CTF 1.8, as the active work is happening on CTF 2 (https://diamon.org/ctf/files/CTF2-SPECRC-8.1rA.html), which replaces TSDL by JSON-seq. It will remove the need for a custom grammar altogether.
This is something I'm doing in my free time so it is not a big deal, but I'd like to use it for traces produced with certain DPDK LTS version and I doubt the LTS version will be updated with the new format, so it is fine for now.
Also, what is the planned release date of CTF2? if there is any defined?
Consider this TSDL snippet from the specification
The second line ("event.header" ) would be parsed in the following sequence(simplified):
But "event" is a keyword, and primary-expression doesn't mention that keywords are allowed. So the question is should event and other keywords(all of them? some of them?) be considered as identifiers in this context, or am I missing something?