Commit 4762d40f by Zachary Snow

cleanup in Lex.x and Tokens.hs

parent 659461b8
{ {
{-# OPTIONS_GHC -w #-} module Language.SystemVerilog.Parser.Lex (alexScanTokens) where
module Language.SystemVerilog.Parser.Lex
( alexScanTokens
) where
import Language.SystemVerilog.Parser.Tokens import Language.SystemVerilog.Parser.Tokens
} }
%wrapper "posn" %wrapper "posn"
...@@ -39,9 +35,6 @@ $decimalDigit = [0-9] ...@@ -39,9 +35,6 @@ $decimalDigit = [0-9]
@octalNumber = @size? @octalBase @octalValue @octalNumber = @size? @octalBase @octalValue
@hexNumber = @size? @hexBase @hexValue @hexNumber = @size? @hexBase @hexValue
-- $exp = [eE]
-- $sign = [\+\-]
-- @realNumber = unsignedNumber "." unsignedNumber | unsignedNumber ( "." unsignedNumber)? exp sign? unsignedNumber
@number = @decimalNumber | @octalNumber | @binaryNumber | @hexNumber @number = @decimalNumber | @octalNumber | @binaryNumber | @hexNumber
-- Strings -- Strings
...@@ -193,5 +186,3 @@ tokens :- ...@@ -193,5 +186,3 @@ tokens :-
tok :: TokenName -> AlexPosn -> String -> Token tok :: TokenName -> AlexPosn -> String -> Token
tok t (AlexPn _ l c) s = Token t s $ Position "" l c tok t (AlexPn _ l c) s = Token t s $ Position "" l c
} }
...@@ -335,254 +335,3 @@ data TokenName ...@@ -335,254 +335,3 @@ data TokenName
| Sym_gt_gt_gt_eq | Sym_gt_gt_gt_eq
| Unknown | Unknown
deriving (Show, Eq) deriving (Show, Eq)
{-
keywordOrId :: String -> TokenName
keywordOrId s = findWithDefault Id_simple s keywords
keywords :: Map String TokenName
keywords = fromList
[ ("alias", KW_alias)
, ("always", KW_always)
, ("always_comb", KW_always_comb)
, ("always_ff", KW_always_ff)
, ("always_latch", KW_always_latch)
, ("and", KW_and)
, ("assert", KW_assert)
, ("assign", KW_assign)
, ("assume", KW_assume)
, ("automatic", KW_automatic)
, ("before", KW_before)
, ("begin", KW_begin)
, ("bind", KW_bind)
, ("bins", KW_bins)
, ("binsof", KW_binsof)
, ("bit", KW_bit)
, ("break", KW_break)
, ("buf", KW_buf)
, ("bufif0", KW_bufif0)
, ("bufif1", KW_bufif1)
, ("byte", KW_byte)
, ("case", KW_case)
, ("casex", KW_casex)
, ("casez", KW_casez)
, ("cell", KW_cell)
, ("chandle", KW_chandle)
, ("class", KW_class)
, ("clocking", KW_clocking)
, ("cmos", KW_cmos)
, ("config", KW_config)
, ("const", KW_const)
, ("constraint", KW_constraint)
, ("context", KW_context)
, ("continue", KW_continue)
, ("cover", KW_cover)
, ("covergroup", KW_covergroup)
, ("coverpoint", KW_coverpoint)
, ("cross", KW_cross)
, ("deassign", KW_deassign)
, ("default", KW_default)
, ("defparam", KW_defparam)
, ("design", KW_design)
, ("disable", KW_disable)
, ("dist", KW_dist)
, ("do", KW_do)
, ("edge", KW_edge)
, ("else", KW_else)
, ("end", KW_end)
, ("endcase", KW_endcase)
, ("endclass", KW_endclass)
, ("endclocking", KW_endclocking)
, ("endconfig", KW_endconfig)
, ("endfunction", KW_endfunction)
, ("endgenerate", KW_endgenerate)
, ("endgroup", KW_endgroup)
, ("endinterface", KW_endinterface)
, ("endmodule", KW_endmodule)
, ("endpackage", KW_endpackage)
, ("endprimitive", KW_endprimitive)
, ("endprogram", KW_endprogram)
, ("endproperty", KW_endproperty)
, ("endspecify", KW_endspecify)
, ("endsequence", KW_endsequence)
, ("endtable", KW_endtable)
, ("endtask", KW_endtask)
, ("enum", KW_enum)
, ("event", KW_event)
, ("expect", KW_expect)
, ("export", KW_export)
, ("extends", KW_extends)
, ("extern", KW_extern)
, ("final", KW_final)
, ("first_match", KW_first_match)
, ("for", KW_for)
, ("force", KW_force)
, ("foreach", KW_foreach)
, ("forever", KW_forever)
, ("fork", KW_fork)
, ("forkjoin", KW_forkjoin)
, ("function", KW_function)
, ("function_prototype", KW_function_prototype)
, ("generate", KW_generate)
, ("genvar", KW_genvar)
, ("highz0", KW_highz0)
, ("highz1", KW_highz1)
, ("if", KW_if)
, ("iff", KW_iff)
, ("ifnone", KW_ifnone)
, ("ignore_bins", KW_ignore_bins)
, ("illegal_bins", KW_illegal_bins)
, ("import", KW_import)
, ("incdir", KW_incdir)
, ("include", KW_include)
, ("initial", KW_initial)
, ("inout", KW_inout)
, ("input", KW_input)
, ("inside", KW_inside)
, ("instance", KW_instance)
, ("int", KW_int)
, ("integer", KW_integer)
, ("interface", KW_interface)
, ("intersect", KW_intersect)
, ("join", KW_join)
, ("join_any", KW_join_any)
, ("join_none", KW_join_none)
, ("large", KW_large)
, ("liblist", KW_liblist)
, ("library", KW_library)
, ("local", KW_local)
, ("localparam", KW_localparam)
, ("logic", KW_logic)
, ("longint", KW_longint)
, ("macromodule", KW_macromodule)
, ("matches", KW_matches)
, ("medium", KW_medium)
, ("modport", KW_modport)
, ("module", KW_module)
, ("nand", KW_nand)
, ("negedge", KW_negedge)
, ("new", KW_new)
, ("nmos", KW_nmos)
, ("nor", KW_nor)
, ("noshowcancelled", KW_noshowcancelled)
, ("not", KW_not)
, ("notif0", KW_notif0)
, ("notif1", KW_notif1)
, ("null", KW_null)
, ("option", KW_option)
, ("or", KW_or)
, ("output", KW_output)
, ("package", KW_package)
, ("packed", KW_packed)
, ("parameter", KW_parameter)
, ("pathpulse_dollar", KW_pathpulse_dollar)
, ("pmos", KW_pmos)
, ("posedge", KW_posedge)
, ("primitive", KW_primitive)
, ("priority", KW_priority)
, ("program", KW_program)
, ("property", KW_property)
, ("protected", KW_protected)
, ("pull0", KW_pull0)
, ("pull1", KW_pull1)
, ("pulldown", KW_pulldown)
, ("pullup", KW_pullup)
, ("pulsestyle_onevent", KW_pulsestyle_onevent)
, ("pulsestyle_ondetect", KW_pulsestyle_ondetect)
, ("pure", KW_pure)
, ("rand", KW_rand)
, ("randc", KW_randc)
, ("randcase", KW_randcase)
, ("randsequence", KW_randsequence)
, ("rcmos", KW_rcmos)
, ("real", KW_real)
, ("realtime", KW_realtime)
, ("ref", KW_ref)
, ("reg", KW_reg)
, ("release", KW_release)
, ("repeat", KW_repeat)
, ("return", KW_return)
, ("rnmos", KW_rnmos)
, ("rpmos", KW_rpmos)
, ("rtran", KW_rtran)
, ("rtranif0", KW_rtranif0)
, ("rtranif1", KW_rtranif1)
, ("scalared", KW_scalared)
, ("sequence", KW_sequence)
, ("shortint", KW_shortint)
, ("shortreal", KW_shortreal)
, ("showcancelled", KW_showcancelled)
, ("signed", KW_signed)
, ("small", KW_small)
, ("solve", KW_solve)
, ("specify", KW_specify)
, ("specparam", KW_specparam)
, ("static", KW_static)
, ("strength0", KW_strength0)
, ("strength1", KW_strength1)
, ("string", KW_string)
, ("strong0", KW_strong0)
, ("strong1", KW_strong1)
, ("struct", KW_struct)
, ("super", KW_super)
, ("supply0", KW_supply0)
, ("supply1", KW_supply1)
, ("table", KW_table)
, ("tagged", KW_tagged)
, ("task", KW_task)
, ("this", KW_this)
, ("throughout", KW_throughout)
, ("time", KW_time)
, ("timeprecision", KW_timeprecision)
, ("timeunit", KW_timeunit)
, ("tran", KW_tran)
, ("tranif0", KW_tranif0)
, ("tranif1", KW_tranif1)
, ("tri", KW_tri)
, ("tri0", KW_tri0)
, ("tri1", KW_tri1)
, ("triand", KW_triand)
, ("trior", KW_trior)
, ("trireg", KW_trireg)
, ("type", KW_type)
, ("typedef", KW_typedef)
, ("type_option", KW_type_option)
, ("union", KW_union)
, ("unique", KW_unique)
, ("unsigned", KW_unsigned)
, ("use", KW_use)
, ("var", KW_var)
, ("vectored", KW_vectored)
, ("virtual", KW_virtual)
, ("void", KW_void)
, ("wait", KW_wait)
, ("wait_order", KW_wait_order)
, ("wand", KW_wand)
, ("weak0", KW_weak0)
, ("weak1", KW_weak1)
, ("while", KW_while)
, ("wildcard", KW_wildcard)
, ("wire", KW_wire)
, ("with", KW_with)
, ("within", KW_within)
, ("wor", KW_wor)
, ("xnor", KW_xnor)
, ("xor", KW_xor)
]
-- \$fullskew
-- \$hold
-- \$nochange
-- \$period
-- \$randomize
-- \$recovery
-- \$recrem
-- \$removal
-- \$root
-- \$setup
-- \$setuphold
-- \$skew
-- \$timeskew
-- \$unit
-- \$width
-}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment