summaryrefslogtreecommitdiff
path: root/conf/cf-lex.l
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-07-25 22:33:57 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2013-07-25 22:33:57 +0200
commit1103b32e830fbf98d9b3e32c0425b9a589773bf8 (patch)
tree9d3577cf205e74002ea43e7754f3391cc1e4992d /conf/cf-lex.l
parentac5745134847c044b21c311e5ab11d92d05bacc1 (diff)
Allows to define constants of all filter types.
Diffstat (limited to 'conf/cf-lex.l')
-rw-r--r--conf/cf-lex.l19
1 files changed, 9 insertions, 10 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index e0430485..50f390e0 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -15,10 +15,10 @@
* symbols and keywords.
*
* Each symbol is represented by a &symbol structure containing name
- * of the symbol, its lexical scope, symbol class (%SYM_PROTO for a name of a protocol,
- * %SYM_NUMBER for a numeric constant etc.) and class dependent data.
- * When an unknown symbol is encountered, it's automatically added to the
- * symbol table with class %SYM_VOID.
+ * of the symbol, its lexical scope, symbol class (%SYM_PROTO for a
+ * name of a protocol, %SYM_CONSTANT for a constant etc.) and class
+ * dependent data. When an unknown symbol is encountered, it's
+ * automatically added to the symbol table with class %SYM_VOID.
*
* The keyword tables are generated from the grammar templates
* using the |gen_keywords.m4| script.
@@ -623,24 +623,23 @@ cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos)
char *
cf_symbol_class_name(struct symbol *sym)
{
+ if ((sym->class & 0xff00) == SYM_CONSTANT)
+ return "constant";
+
switch (sym->class)
{
case SYM_VOID:
return "undefined";
case SYM_PROTO:
return "protocol";
- case SYM_NUMBER:
- return "numeric constant";
+ case SYM_TEMPLATE:
+ return "protocol template";
case SYM_FUNCTION:
return "function";
case SYM_FILTER:
return "filter";
case SYM_TABLE:
return "routing table";
- case SYM_IPA:
- return "network address";
- case SYM_TEMPLATE:
- return "protocol template";
case SYM_ROA:
return "ROA table";
default: