These instructions apply to iotdb-core/antlr/ and supplement the
repository instructions.
- When adding a keyword token to
SqlLexer.g4, add the same token to
the
keyWordsrule in IdentifierParser.g4 in the same change. A new dedicated lexer token no longer matches the genericIDalternative; omitting it fromkeyWordscan break its use as an unquoted measurement or path node name. - Preserve the existing identifier and path rules in
IoTDBSqlParser.g4, which imports
IdentifierParser. Do not make users quote previously valid unquoted names to work around a missing keyword entry, or change existing reserved/special-token behavior incidentally. - This synchronization applies to keyword tokens. Do not add punctuation, operators,
whitespace, lexer fragments, or literal rules to
keyWordsmerely because they are defined in the lexer.
- Verify both the newly introduced SQL syntax and the same word used as an unquoted measurement and path component in create/insert/query statements. Include case variants; testing only quoted identifiers does not cover this compatibility requirement. The existing IoTDBSyntaxConventionIdentifierIT provides identifier/path regression coverage. Follow integration-test/AGENTS.md before editing or running ITs.
- Edit the
.g4sources and regenerate through Maven; do not edit generated Java,.tokens, or.interpfiles. Rebuild the affected grammar and DataNode consumers and run the affected parser/identifier tests. Successful grammar generation alone does not prove that existing names still parse correctly.