summaryrefslogtreecommitdiff
path: root/src/analysis/scan/grammar.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/grammar.y')
-rw-r--r--src/analysis/scan/grammar.y23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/analysis/scan/grammar.y b/src/analysis/scan/grammar.y
index e1f0e9e..741b394 100644
--- a/src/analysis/scan/grammar.y
+++ b/src/analysis/scan/grammar.y
@@ -116,7 +116,7 @@ YY_DECL;
%token INCLUDE "include"
%token RAW_RULE
-%token RULE_NAME
+%token RULE_IDENTIFIER
%token META "meta"
%token BYTES "bytes"
@@ -216,7 +216,7 @@ YY_DECL;
%token IN "in"
-%type <sized_cstring> RULE_NAME
+%type <sized_cstring> RULE_IDENTIFIER
%type <sized_cstring> INFO_KEY
@@ -346,12 +346,12 @@ YY_DECL;
* Définition de règle.
*/
- rule : rule_flags RAW_RULE RULE_NAME
+ rule : rule_flags RAW_RULE RULE_IDENTIFIER
{
*built_rule = g_scan_rule_new($1, $3.data);
$<rule>$ = *built_rule;
}
- BRACE_IN meta bytes condition BRACE_OUT
+ tags BRACE_IN meta bytes condition BRACE_OUT
{
$$ = $<rule>4;
}
@@ -379,6 +379,21 @@ YY_DECL;
;
+ tags : /* empty */
+ | ":" tag_list
+ ;
+
+ tag_list : RULE_IDENTIFIER
+ {
+ g_scan_rule_add_tag(*built_rule, $1.data);
+ }
+ | tag_list RULE_IDENTIFIER
+ {
+ g_scan_rule_add_tag(*built_rule, $2.data);
+ }
+ ;
+
+
/**
* Section "meta:" d'une définition de règle.
*/