summaryrefslogtreecommitdiff
path: root/tools/d2c/d2c_tok.l
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-01-10 16:37:34 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-01-10 16:37:34 (GMT)
commit8ef66a1e0225c9e00175fbaf3f3038f537de511f (patch)
treedd7112dd50c02e0ad1565ce7a890991b5e1270c6 /tools/d2c/d2c_tok.l
parentcc3e31eecd90766ae4f0bb391428c5c59567ef4c (diff)
Extended the grammar to allow hooks inclusion.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@453 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tools/d2c/d2c_tok.l')
-rw-r--r--tools/d2c/d2c_tok.l13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/d2c/d2c_tok.l b/tools/d2c/d2c_tok.l
index 71f1a15..8f54c8d 100644
--- a/tools/d2c/d2c_tok.l
+++ b/tools/d2c/d2c_tok.l
@@ -33,6 +33,8 @@ void free_flex_memory(void) ;
%x conv_begin conv_content conv_arg conv_arg_binval
+%x hooks_begin hooks_content
+
%x rules_begin rules_content rules_cond rules_cond_binval rules_action rules_action_see
@@ -145,6 +147,17 @@ void free_flex_memory(void) ;
+<encoding_content>"@hooks" { BEGIN(hooks_begin); return HOOKS; }
+<hooks_begin>[ ]+ { }
+<hooks_begin>"{" { BEGIN(hooks_content); }
+<hooks_content>"}" { BEGIN(encoding_content); }
+
+<hooks_content>[ \t\n]+ { }
+<hooks_content>[a-z_][a-z0-9_]* { d2c_lval.string = strdup(yytext); return NAME; }
+<hooks_content>"=" { return EQ; }
+
+
+
<encoding_content>"@rules" { BEGIN(rules_begin); return RULES; }
<rules_content>\/\/[^\n]+ { printf("SKIP '%s'\n", yytext); }
<rules_begin>[ ]+ { }