%{
/*
 Copyright (c) 2006-2009 Trevor Williams

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 See the GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along with this program;
 if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/*
 Command-line: gperf -o -i 1 -C -k 1-3,$ -L C -H keyword_hash_1995 -N check_identifier_1995 -tT keywords_1995.gperf
 */

#include <string.h>
#include "keywords.h"
#include "defines.h"
#include "vsignal.h"
#include "parser.h"
#include "profiler.h"

%}
struct keyword_1995 { char *name; int type; };
%%
always,         K_always
and,            K_and
assign,         K_assign
begin,          K_begin
buf,            K_buf
bufif0,         K_bufif0
bufif1,         K_bufif1
case,           K_case
casex,          K_casex
casez,          K_casez
cmos,           K_cmos
deassign,       K_deassign
default,        K_default
defparam,       K_defparam
disable,        K_disable
edge,           K_edge
else,           K_else
end,            K_end
endcase,        K_endcase
endfunction,    K_endfunction
endmodule,      K_endmodule
endprimitive,   K_endprimitive
endspecify,     K_endspecify
endtable,       K_endtable
endtask,        K_endtask
event,          K_event
for,            K_for
force,          K_force
forever,        K_forever
fork,           K_fork
function,       K_function
highz0,         K_highz0
highz1,         K_highz1
if,             K_if
initial,        K_initial
inout,          K_inout
input,          K_input
integer,        K_integer
join,           K_join
large,          K_large
macromodule,    K_macromodule
medium,         K_medium
module,         K_module
nand,           K_nand
negedge,        K_negedge
nmos,           K_nmos
nor,            K_nor
not,            K_not
notif0,         K_notif0
notif1,         K_notif1
or,             K_or
output,         K_output
parameter,      K_parameter
pmos,           K_pmos
posedge,        K_posedge
primitive,      K_primitive
pull0,          K_pull0
pull1,          K_pull1
pulldown,       K_pulldown
pullup,         K_pullup
rcmos,          K_rcmos
real,           K_real
realtime,       K_realtime
reg,            K_reg
release,        K_release
repeat,         K_repeat
rnmos,          K_rnmos
rpmos,          K_rpmos
rtran,          K_rtran
rtranif0,       K_rtranif0
rtranif1,       K_rtranif1
scalered,       K_scalered
signed,         K_signed
small,          K_small
specify,        K_specify
specparam,      K_specparam
strong0,        K_strong0
strong1,        K_strong1
supply0,        K_supply0
supply1,        K_supply1
table,          K_table
task,           K_task
time,           K_time
tran,           K_tran
tranif0,        K_tranif0
tranif1,        K_tranif1
tri,            K_tri
tri0,           K_tri0
tri1,           K_tri1
triand,         K_triand
trior,          K_trior
trireg,         K_trireg
vectored,       K_vectored
wait,           K_wait
wand,           K_wand
weak0,          K_weak0
weak1,          K_weak1
while,          K_while
wire,           K_wire
wor,            K_wor
xnor,           K_xnor
xor,            K_xor
%%

int lexer_keyword_1995_code(
  const char* str,
  int         length
) { PROFILE(LEXER_KEYWORD_1995_CODE);

  const struct keyword_1995* rc   = check_identifier_1995(str, length);
  int                        type = IDENTIFIER;

  if( rc != 0 ) {
    type = rc->type;
  }

  PROFILE_END;

  return( type );

}

