From c2d0c3d4c31164ece386a61ef3326bb40c348fdb Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Feb 2008 15:43:55 +0000 Subject: - added "contains" and "startwith" comparison operations - defined initial set of opcodes --- vmop.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'vmop.h') diff --git a/vmop.h b/vmop.h index 319232a0..031d03e4 100644 --- a/vmop.h +++ b/vmop.h @@ -22,10 +22,33 @@ #ifndef INCLUDED_VMOP_H #define INCLUDED_VMOP_H +#include "ctok_token.h" + /* machine instructions types */ typedef enum { /* do NOT start at 0 to detect uninitialized types after calloc() */ opcode_INVALID = 0, - opcode_PUSH = 1 + /* for simplicity of debugging and reading dumps, we use the same IDs + * that the tokenizer uses where this applicable. + */ + opcode_OR = ctok_OR, + opcode_AND = ctok_AND, + opcode_PLUS = ctok_PLUS, + opcode_MINUS = ctok_MINUS, + opcode_TIMES = ctok_TIMES, /* "*" */ + opcode_DIV = ctok_DIV, + opcode_MOD = ctok_MOD, + opcode_NOT = ctok_NOT, + opcode_CMP_EQ = ctok_CMP_EQ, /* all compare operations must be in a row */ + opcode_CMP_NEQ = ctok_CMP_NEQ, + opcode_CMP_LT = ctok_CMP_LT, + opcode_CMP_GT = ctok_CMP_GT, + opcode_CMP_LTEQ = ctok_CMP_LTEQ, + opcode_CMP_CONTAINS = ctok_CMP_CONTAINS, + opcode_CMP_STARTSWITH = ctok_CMP_STARTSWITH, + opcode_CMP_GTEQ = ctok_CMP_GTEQ, /* end compare operations */ + /* here we start our own codes */ + opcode_PUSH = 1000, /* requires var operand */ + opcode_POP = 1001, /* requires var operand to receive result */ } opcode_t; /* the vmop object */ -- cgit v1.2.3