@@ -274,12 +274,12 @@ class Supply(_ParameterVairable): pass
274274#-------------------------------------------------------------------------------
275275class _Constant (_Numeric ):
276276 def __init__ (self , value , width = None , base = None ):
277- self .type_check_value (value )
278- self .type_check_width (width )
279- self .type_check_base (base )
280- def type_check_value (self , value ): pass
281- def type_check_width (self , width ): pass
282- def type_check_base (self , base ): pass
277+ self ._type_check_value (value )
278+ self ._type_check_width (width )
279+ self ._type_check_base (base )
280+ def _type_check_value (self , value ): pass
281+ def _type_check_width (self , width ): pass
282+ def _type_check_base (self , base ): pass
283283
284284 def __str__ (self ):
285285 return str (value )
@@ -292,16 +292,16 @@ def __init__(self, value, width=None, base=None, signed=False):
292292 self .base = base
293293 self .signed = signed
294294
295- def type_check_value (self , value ):
295+ def _type_check_value (self , value ):
296296 if not isinstance (value , int ):
297297 raise TypeError ('value of Int must be int, not %s.' % type (value ))
298298
299- def type_check_width (self , width ):
299+ def _type_check_width (self , width ):
300300 if width is None : return
301301 if not isinstance (width , int ):
302302 raise TypeError ('width of Int must be int, not %s.' % type (width ))
303303
304- def type_check_base (self , base ):
304+ def _type_check_base (self , base ):
305305 if base is None : return
306306 if not isinstance (base , int ):
307307 raise TypeError ('base of Int must be int, not %s.' % type (base ))
@@ -354,7 +354,7 @@ def __init__(self, width=None, base=None, signed=False):
354354 self .base = base
355355 self .signed = signed
356356
357- def type_check_value (self , value ):
357+ def _type_check_value (self , value ):
358358 pass
359359
360360 def __str__ (self ):
@@ -405,7 +405,7 @@ def __init__(self, width=None, base=None, signed=False):
405405 self .base = base
406406 self .signed = False
407407
408- def type_check_value (self , value ):
408+ def _type_check_value (self , value ):
409409 pass
410410
411411 def __str__ (self ):
@@ -453,7 +453,7 @@ def __init__(self, value):
453453 _Constant .__init__ (self , value , None , None )
454454 self .value = value
455455
456- def type_check_value (self , value ):
456+ def _type_check_value (self , value ):
457457 if not isinstance (value , (float , int )):
458458 raise TypeError ('value of Float must be float, not %s.' % type (value ))
459459
@@ -465,7 +465,7 @@ def __init__(self, value):
465465 _Constant .__init__ (self , value , None , None )
466466 self .value = value
467467
468- def type_check_value (self , value ):
468+ def _type_check_value (self , value ):
469469 if not isinstance (value , str ):
470470 raise TypeError ('value of Str must be str, not %s.' % type (value ))
471471
@@ -478,11 +478,11 @@ class _Operator(_Numeric): pass
478478#-------------------------------------------------------------------------------
479479class _BinaryOperator (_Operator ):
480480 def __init__ (self , left , right ):
481- self .type_check (left , right )
481+ self ._type_check (left , right )
482482 self .left = left
483483 self .right = right
484484
485- def type_check (self , left , right ):
485+ def _type_check (self , left , right ):
486486 if not isinstance (left , (_Numeric , bool , int , float , str )):
487487 raise TypeError ('BinaryOperator does not support Type %s' % str (type (left )))
488488 if not isinstance (right , (_Numeric , bool , int , float , str )):
@@ -494,10 +494,10 @@ def __str__(self):
494494
495495class _UnaryOperator (_Operator ):
496496 def __init__ (self , right ):
497- self .type_check (right )
497+ self ._type_check (right )
498498 self .right = right
499499
500- def type_check (self , right ):
500+ def _type_check (self , right ):
501501 if not isinstance (right , (_Numeric , bool , int , float , str )):
502502 raise TypeError ('BinaryOperator does not support Type %s' % str (type (right )))
503503
@@ -822,7 +822,7 @@ def __call__(self, *args):
822822 return self .set_statement (* args )
823823 raise ValueError ("Case statement list is already assigned." )
824824
825- def type_check_statement (self , * statement ):
825+ def _type_check_statement (self , * statement ):
826826 for s in statement :
827827 if not isinstance (s , When ):
828828 raise TypeError ("Case statement requires When() object as statement list." )
@@ -832,22 +832,22 @@ def type_check_statement(self, *statement):
832832 self .last = True
833833
834834 def set_statement (self , * statement ):
835- self .type_check_statement (* statement )
835+ self ._type_check_statement (* statement )
836836 self .statement = tuple (statement )
837837 return self
838838
839839 def add (self , * statement ):
840840 if self .statement is None :
841841 return self .set_statement (* statement )
842- self .type_check_statement (* statement )
842+ self ._type_check_statement (* statement )
843843 self .statement = tuple (self .statement + statement )
844844 return self
845845
846846class Casex (Case ): pass
847847
848848class When (VeriloggenNode ) :
849849 def __init__ (self , * condition ):
850- self .type_check_condition (* condition )
850+ self ._type_check_condition (* condition )
851851 self .condition = None if len (condition ) == 0 or condition [0 ] is None else tuple (condition )
852852 self .statement = None
853853
@@ -856,7 +856,7 @@ def __call__(self, *args):
856856 return self .set_statement (* args )
857857 raise ValueError ("Statement body is already assigned." )
858858
859- def type_check_condition (self , * args ):
859+ def _type_check_condition (self , * args ):
860860 if len (args ) == 0 :
861861 return
862862 if len (args ) == 1 and args [0 ] is None :
@@ -867,18 +867,18 @@ def type_check_condition(self, *args):
867867 if isinstance (a , (_Numeric , bool , int , float , str )): continue
868868 raise TypeError ("Condition must be _Numeric object, not '%s'" % str (type (a )))
869869
870- def type_check_statement (self , * args ):
870+ def _type_check_statement (self , * args ):
871871 pass
872872
873873 def set_statement (self , * statement ):
874- self .type_check_statement (* statement )
874+ self ._type_check_statement (* statement )
875875 self .statement = tuple (statement )
876876 return self
877877
878878 def add (self , * statement ):
879879 if self .statement is None :
880880 return self .set_statement (* statement )
881- self .type_check_statement (* statement )
881+ self ._type_check_statement (* statement )
882882 self .statement = tuple (self .statement + statement )
883883 return self
884884
0 commit comments