You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently to create new rules it's necessary to know the internals of the grammar and look at the generated AST using the zpa-toolkit. Ideally we should provide an easier API to navigate through the AST.
if (table != null && table.getTokenOriginalValue().equalsIgnoreCase("user")) {
addIssue(table, "Replace this query by a function of the USER_WRAPPER package.");
}
}
With a strongly typed AST it could be write like:
publicvoidvisit(TableExpressionClausetableExpression) {
TableReferencetable = tableExpression.getTableReference();
if (table != null && table.getName().equalsIgnoreCase("user")) {
addIssue(table, "Replace this query by a function of the USER_WRAPPER package.");
}
}
The SSLR library provides a API to create a typed AST but it only works with lexerless grammars, but we can't migrate to a lexerless grammar because it's much slower than the lexerful one.
The text was updated successfully, but these errors were encountered:
Currently to create new rules it's necessary to know the internals of the grammar and look at the generated AST using the zpa-toolkit. Ideally we should provide an easier API to navigate through the AST.
Example:
zpa/plsql-custom-rules/src/main/java/com/company/plsql/ForbiddenDmlCheck.java
Lines 28 to 34 in 304aa89
With a strongly typed AST it could be write like:
The SSLR library provides a API to create a typed AST but it only works with lexerless grammars, but we can't migrate to a lexerless grammar because it's much slower than the lexerful one.
The text was updated successfully, but these errors were encountered: