예제 #1
0
 def typer(hint):
     """
     :param lal.AdaNode hint: the lal type.
     :return: The corresponding lalcheck type.
     :rtype: types.Boolean | types.IntRange
     """
     if hint == bool_type:
         return types.Boolean()
     elif hint == int_type:
         return types.IntRange(-2 ** 31, 2 ** 31 - 1)
     elif hint == char_type:
         return types.ASCIICharacter()
예제 #2
0
 def to_int_range(xs):
     return types.IntRange(*xs)
예제 #3
0
 def to_int_range(modulus):
     return types.IntRange(0, modulus - 1)