struct Keyword { char *name; int token; int32_t syntax; }
%%
const,			T_CONST,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
select,			T_SELECT,	SYNTAX_NEW
guard,			T_GUARD,	SYNTAX_OLD | SYNTAX_NEW
sync,			T_SYNC,		SYNTAX_OLD | SYNTAX_NEW
assign,			T_ASSIGN,	SYNTAX_OLD | SYNTAX_NEW
process,		T_PROCESS,	SYNTAX_OLD | SYNTAX_NEW
state,			T_STATE,	SYNTAX_OLD | SYNTAX_NEW
init,			T_INIT,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
trans,			T_TRANS,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
urgent,			T_URGENT,	SYNTAX_OLD | SYNTAX_NEW
commit,			T_COMMIT,	SYNTAX_OLD | SYNTAX_NEW
broadcast,       	T_BROADCAST,	SYNTAX_OLD | SYNTAX_NEW
system,			T_SYSTEM,	SYNTAX_OLD | SYNTAX_NEW
true,			T_TRUE,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
false,			T_FALSE,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
and,			T_KW_AND,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
or,			T_KW_OR,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
not,			T_KW_NOT,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
imply,			T_KW_IMPLY,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
for,			T_FOR,		SYNTAX_NEW | SYNTAX_SSQL
while,			T_WHILE,	SYNTAX_NEW | SYNTAX_SSQL
do, 			T_DO,		SYNTAX_NEW | SYNTAX_SSQL
if, 			T_IF,		SYNTAX_NEW | SYNTAX_SSQL
else, 			T_ELSE,		SYNTAX_NEW | SYNTAX_SSQL
default, 		T_DEFAULT,	SYNTAX_NEW | SYNTAX_SSQL
return, 		T_RETURN,	SYNTAX_NEW | SYNTAX_SSQL
typedef,		T_TYPEDEF,	SYNTAX_NEW | SYNTAX_SSQL
struct,			T_STRUCT,	SYNTAX_NEW | SYNTAX_SSQL
meta,			T_META,		SYNTAX_NEW | SYNTAX_SSQL
before_update,		T_BEFORE,	SYNTAX_NEW
after_update,		T_AFTER,	SYNTAX_NEW
progress,		T_PROGRESS,	SYNTAX_NEW
assert,			T_ASSERT,	SYNTAX_NEW
forall, 		T_FORALL,	SYNTAX_NEW | SYNTAX_PROPERTY
exists, 		T_EXISTS,	SYNTAX_NEW | SYNTAX_PROPERTY
deadlock,		T_DEADLOCK,	SYNTAX_PROPERTY
priority,		T_PRIORITY,	SYNTAX_OLD | SYNTAX_NEW
bool,			T_BOOL,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
int,			T_INT,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
chan,			T_CHAN,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
clock,			T_CLOCK,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
void,			T_VOID,		SYNTAX_OLD | SYNTAX_NEW | SYNTAX_SSQL
scalar,			T_SCALAR,	SYNTAX_OLD | SYNTAX_NEW | SYNTAX_PROPERTY
control,                T_CONTROL,      SYNTAX_PROPERTY | SYNTAX_TIGA
control_t,              T_CONTROL_T,    SYNTAX_PROPERTY | SYNTAX_TIGA
inf,                    T_INF,          SYNTAX_PROPERTY | SYNTAX_TIGA
sup,                    T_SUP,          SYNTAX_PROPERTY | SYNTAX_TIGA
resultset,              T_RESULTSET,    SYNTAX_SSQL
%%

bool isKeyword(const char *id, uint32_t syntax)
{
    const Keyword *keyword = Keywords::in_word_set(id, strlen(id));
    return (keyword != NULL && (keyword->syntax & syntax));
}
