convert numbers to python format
[sv2nmigen.git] / parse_tokens.py
1 tokens = ['IDENTIFIER', 'SYSTEM_IDENTIFIER', 'STRING', 'TIME_LITERAL',
2 'TYPE_IDENTIFIER', 'PACKAGE_IDENTIFIER', 'DISCIPLINE_IDENTIFIER',
3 'PATHPULSE_IDENTIFIER', 'BASED_NUMBER', 'DEC_NUMBER', 'UNBASED_NUMBER',
4 'REALTIME', 'K_PLUS_EQ', 'K_MINUS_EQ', 'K_INCR', 'K_DECR', 'K_LE',
5 'K_GE', 'K_EG', 'K_EQ', 'K_NE', 'K_CEQ', 'K_CNE', 'K_WEQ', 'K_WNE',
6 'K_LP', 'K_LS', 'K_RS', 'K_RSS', 'K_SG', 'K_CONTRIBUTE', 'K_PO_POS',
7 'K_PO_NEG', 'K_POW', 'K_PSTAR', 'K_STARP', 'K_DOTSTAR', 'K_LOR',
8 'K_LAND', 'K_NAND', 'K_NOR', 'K_NXOR', 'K_TRIGGER', 'K_SCOPE_RES',
9 'K_edge_descriptor', 'K_always', 'K_and', 'K_assign', 'K_begin', 'K_buf',
10 'K_bufif0', 'K_bufif1', 'K_case', 'K_casex', 'K_casez', 'K_cmos',
11 'K_deassign', 'K_default', 'K_defparam', 'K_disable', 'K_edge', 'K_else',
12 'K_end', 'K_endcase', 'K_endfunction', 'K_endmodule', 'K_endprimitive',
13 'K_endspecify', 'K_endtable', 'K_endtask', 'K_event', 'K_for', 'K_force',
14 'K_forever', 'K_fork', 'K_function', 'K_highz0', 'K_highz1', 'K_if',
15 'K_ifnone', 'K_initial', 'K_inout', 'K_input', 'K_integer', 'K_join',
16 'K_large', 'K_macromodule', 'K_medium', 'K_module', 'K_nand', 'K_negedge',
17 'K_nmos', 'K_nor', 'K_not', 'K_notif0', 'K_notif1', 'K_or', 'K_output',
18 'K_parameter', 'K_pmos', 'K_posedge', 'K_primitive', 'K_pull0', 'K_pull1',
19 'K_pulldown', 'K_pullup', 'K_rcmos', 'K_real', 'K_realtime', 'K_reg',
20 'K_release', 'K_repeat', 'K_rnmos', 'K_rpmos', 'K_rtran', 'K_rtranif0',
21 'K_rtranif1', 'K_scalared', 'K_small', 'K_specify', 'K_specparam',
22 'K_strong0', 'K_strong1', 'K_supply0', 'K_supply1', 'K_table',
23 'K_task', 'K_time', 'K_tran', 'K_tranif0', 'K_tranif1', 'K_tri',
24 'K_tri0', 'K_tri1', 'K_triand', 'K_trior', 'K_trireg', 'K_vectored',
25 'K_wait', 'K_wand', 'K_weak0', 'K_weak1', 'K_while', 'K_wire',
26 'K_wor', 'K_xnor', 'K_xor', 'K_Shold', 'K_Snochange', 'K_Speriod',
27 'K_Srecovery', 'K_Ssetup', 'K_Ssetuphold', 'K_Sskew', 'K_Swidth',
28 'KK_attribute', 'K_bool', 'K_logic', 'K_automatic', 'K_endgenerate',
29 'K_generate', 'K_genvar', 'K_localparam', 'K_noshowcancelled',
30 'K_pulsestyle_onevent', 'K_pulsestyle_ondetect', 'K_showcancelled',
31 'K_signed', 'K_unsigned', 'K_Sfullskew', 'K_Srecrem', 'K_Sremoval',
32 'K_Stimeskew', 'K_cell', 'K_config', 'K_design', 'K_endconfig',
33 'K_incdir', 'K_include', 'K_instance', 'K_liblist', 'K_library',
34 'K_use', 'K_wone', 'K_uwire', 'K_alias', 'K_always_comb', 'K_always_ff',
35 'K_always_latch', 'K_assert', 'K_assume', 'K_before', 'K_bind', 'K_bins',
36 'K_binsof', 'K_bit', 'K_break', 'K_byte', 'K_chandle', 'K_class',
37 'K_clocking', 'K_const', 'K_constraint', 'K_context', 'K_continue',
38 'K_cover', 'K_covergroup', 'K_coverpoint', 'K_cross', 'K_dist',
39 'K_do', 'K_endclass', 'K_endclocking', 'K_endgroup', 'K_endinterface',
40 'K_endpackage', 'K_endprogram', 'K_endproperty', 'K_endsequence',
41 'K_enum', 'K_expect', 'K_export', 'K_extends', 'K_extern',
42 'K_final', 'K_first_match', 'K_foreach', 'K_forkjoin', 'K_iff',
43 'K_ignore_bins', 'K_illegal_bins', 'K_import', 'K_inside', 'K_int',
44 'K_interface', 'K_intersect', 'K_join_any', 'K_join_none', 'K_local',
45 'K_longint', 'K_matches', 'K_modport', 'K_new', 'K_null', 'K_package',
46 'K_packed', 'K_priority', 'K_program', 'K_property', 'K_protected',
47 'K_pure', 'K_rand', 'K_randc', 'K_randcase', 'K_randsequence',
48 'K_ref', 'K_return', 'K_sequence', 'K_shortint', 'K_shortreal',
49 'K_solve', 'K_static', 'K_string', 'K_struct', 'K_super', 'K_tagged',
50 'K_this', 'K_throughout', 'K_timeprecision', 'K_timeunit', 'K_type',
51 'K_typedef', 'K_union', 'K_unique', 'K_var', 'K_virtual', 'K_void',
52 'K_wait_order', 'K_wildcard', 'K_with', 'K_within', 'K_accept_on',
53 'K_checker', 'K_endchecker', 'K_eventually', 'K_global', 'K_implies',
54 'K_let', 'K_nexttime', 'K_reject_on', 'K_restrict', 'K_s_always',
55 'K_s_eventually', 'K_s_nexttime', 'K_s_until', 'K_s_until_with',
56 'K_strong', 'K_sync_accept_on', 'K_sync_reject_on', 'K_unique0',
57 'K_until', 'K_until_with', 'K_untyped', 'K_weak', 'K_implements',
58 'K_interconnect', 'K_nettype', 'K_soft', 'K_above', 'K_abs', 'K_absdelay',
59 'K_abstol', 'K_access', 'K_acos', 'K_acosh', 'K_ac_stim', 'K_aliasparam',
60 'K_analog', 'K_analysis', 'K_asin', 'K_asinh', 'K_atan', 'K_atan2',
61 'K_atanh', 'K_branch', 'K_ceil', 'K_connect', 'K_connectmodule',
62 'K_connectrules', 'K_continuous', 'K_cos', 'K_cosh', 'K_ddt',
63 'K_ddt_nature', 'K_ddx', 'K_discipline', 'K_discrete', 'K_domain',
64 'K_driver_update', 'K_endconnectrules', 'K_enddiscipline', 'K_endnature',
65 'K_endparamset', 'K_exclude', 'K_exp', 'K_final_step', 'K_flicker_noise',
66 'K_floor', 'K_flow', 'K_from', 'K_ground', 'K_hypot', 'K_idt', 'K_idtmod',
67 'K_idt_nature', 'K_inf', 'K_initial_step', 'K_laplace_nd', 'K_laplace_np',
68 'K_laplace_zd', 'K_laplace_zp', 'K_last_crossing', 'K_limexp', 'K_ln',
69 'K_log', 'K_max', 'K_merged', 'K_min', 'K_nature', 'K_net_resolution',
70 'K_noise_table', 'K_paramset', 'K_potential', 'K_pow', 'K_resolveto',
71 'K_sin', 'K_sinh', 'K_slew', 'K_split', 'K_sqrt', 'K_tan', 'K_tanh',
72 'K_timer', 'K_transition', 'K_units', 'K_white_noise', 'K_wreal',
73 'K_zi_nd', 'K_zi_np', 'K_zi_zd', 'K_zi_zp', 'K_TAND', 'K_PLUS_EQ',
74 'K_MINUS_EQ', 'K_MUL_EQ', 'K_DIV_EQ', 'K_MOD_EQ', 'K_AND_EQ', 'K_OR_EQ',
75 'K_XOR_EQ', 'K_LS_EQ', 'K_RS_EQ', 'K_RSS_EQ', 'K_inside', 'K_LOR',
76 'K_LAND', 'K_NXOR', 'K_NOR', 'K_NAND', 'K_EQ', 'K_NE', 'K_CEQ',
77 'K_CNE', 'K_WEQ', 'K_WNE', 'K_GE', 'K_LE', 'K_LS', 'K_RS', 'K_RSS',
78 'K_POW', 'UNARY_PREC', 'less_than_K_else', 'K_else', 'K_exclude',
79 'no_timeunits_declaration', 'one_timeunits_declaration', 'K_timeunit',
80 'K_timeprecision'
81 ]
82 # precedence = (\'right\', \'K_PLUS_EQ\', \'K_MINUS_EQ\', \'K_MUL_EQ\', \'K_DIV_EQ\', \'K_MOD_EQ\', \'K_AND_EQ\', \'K_OR_EQ\'), (\'right\', \'K_XOR_EQ\', \'K_LS_EQ\', \'K_RS_EQ\', \'K_RSS_EQ\'), (\'right\', "\'?\'", "\':\'", \'K_inside\'), (\'left\', \'K_LOR\'), (\'left\', \'K_LAND\'), (\'left\', "\'|\'"), (\'left\', "\'^\'", \'K_NXOR\', \'K_NOR\'), (\'left\', "\'&\'", \'K_NAND\'), (\'left\', \'K_EQ\', \'K_NE\', \'K_CEQ\', \'K_CNE\', \'K_WEQ\', \'K_WNE\'), (\'left\', \'K_GE\', \'K_LE\', "\'<\'", "\'>\'"), (\'left\', \'K_LS\', \'K_RS\', \'K_RSS\'), (\'left\', "\'+\'", "\'-\'"), (\'left\', "\'*\'", "\'/\'", "\'%\'"), (\'left\', \'K_POW\'), (\'left\', \'UNARY_PREC\'), (\'nonassoc\', \'less_than_K_else\'), (\'nonassoc\', \'K_else\'), (\'nonassoc\', "\'(\'"), (\'nonassoc\', \'K_exclude\'), (\'nonassoc\', \'no_timeunits_declaration\'), (\'nonassoc\', \'one_timeunits_declaration\'), (\'nonassoc\', \'K_timeunit\', \'K_timeprecision\')]')