diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 74e28dd837f7e8eb7a819e1a0a4ed2ebda032ffb..e0d8e7ecc46136b01cb84546ba1d3e11d7fb9e2b 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
fetch_statement
list_statement
lookup_statement
- expression
+ condition
%type <m> matcher
compare_matcher
if (parser_mode != SDB_PARSE_DEFAULT) {
sdb_fe_yyerror(&yylloc, scanner,
YY_("syntax error, unexpected statement, "
- "expecting expression"));
+ "expecting condition"));
sdb_object_deref(SDB_OBJ($3));
YYABORT;
}
if (parser_mode != SDB_PARSE_DEFAULT) {
sdb_fe_yyerror(&yylloc, scanner,
YY_("syntax error, unexpected statement, "
- "expecting expression"));
+ "expecting condition"));
sdb_object_deref(SDB_OBJ($1));
YYABORT;
}
}
}
|
- expression
+ condition
{
- /* only accept this in expression parse mode */
- if (! (parser_mode & SDB_PARSE_EXPR)) {
+ /* only accept this in condition parse mode */
+ if (! (parser_mode & SDB_PARSE_COND)) {
sdb_fe_yyerror(&yylloc, scanner,
- YY_("syntax error, unexpected expression, "
+ YY_("syntax error, unexpected condition, "
"expecting statement"));
sdb_object_deref(SDB_OBJ($1));
YYABORT;
;
/*
- * LOOKUP <type> MATCHING <expression>;
+ * LOOKUP <type> MATCHING <condition>;
*
- * Returns detailed information about <type> matching expression.
+ * Returns detailed information about <type> matching condition.
*/
lookup_statement:
- LOOKUP IDENTIFIER MATCHING expression
+ LOOKUP IDENTIFIER MATCHING condition
{
/* TODO: support other types as well */
if (strcasecmp($2, "hosts")) {
}
;
-expression:
+condition:
matcher
{
if (! $1) {
/* TODO: improve error reporting */
sdb_fe_yyerror(&yylloc, scanner,
- YY_("syntax error, invalid expression"));
+ YY_("syntax error, invalid condition"));
YYABORT;
}