summaryrefslogtreecommitdiffstats
path: root/ctok_token.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
commitf02d615052e325616d7042096cea6e5247a980dc (patch)
treefed57a226daf1f0e052ead727fe99b858c3f1331 /ctok_token.h
parent0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (diff)
downloadrsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.gz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.xz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.zip
- basic implementation of expression parser parsing done
- improved ABNF a bit
Diffstat (limited to 'ctok_token.h')
-rw-r--r--ctok_token.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/ctok_token.h b/ctok_token.h
index 45aeb017..ccde6325 100644
--- a/ctok_token.h
+++ b/ctok_token.h
@@ -46,19 +46,23 @@ typedef struct {
ctok_MSGVAR = 13,
ctok_SIMPSTR = 14,
ctok_TPLSTR = 15,
- ctok_CMP_EQ = 16,
- ctok_CMP_NEQ = 17,
- ctok_CMP_LT = 18,
- ctok_CMP_GT = 19,
- ctok_CMP_LTEQ = 20,
- ctok_CMP_GTEQ = 21,
- ctok_NUMBER = 22,
- ctok_FUNCTION = 23
+ ctok_NUMBER = 16,
+ ctok_FUNCTION = 17,
+ ctok_THEN = 18,
+ ctok_CMP_EQ = 100, /* all compare operations must be in a row */
+ ctok_CMP_NEQ = 101,
+ ctok_CMP_LT = 102,
+ ctok_CMP_GT = 103,
+ ctok_CMP_LTEQ = 104,
+ ctok_CMP_GTEQ = 105, /* end compare operations */
} tok;
rsCStrObj *pstrVal;
int64 intVal;
} ctok_token_t;
+/* defines to handle compare operation tokens in a single if... */
+#define ctok_tokenIsCmpOp(x) ((x)->tok >= ctok_CMP_EQ && (x)->tok <= ctok_CMP_GTEQ)
+
/* prototypes */
rsRetVal ctok_tokenConstruct(ctok_token_t **ppThis);