本文整理汇总了Python中quex.engine.misc.interval_handling.NumberSet.get_string方法的典型用法代码示例。如果您正苦于以下问题:Python NumberSet.get_string方法的具体用法?Python NumberSet.get_string怎么用?Python NumberSet.get_string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quex.engine.misc.interval_handling.NumberSet
的用法示例。
在下文中一共展示了NumberSet.get_string方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_string [as 别名]
def test(UC):
global trafo_cp037
x = NumberSet(UC)
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%02X --> 0x%s" % (UC, x.get_string(Option="hex"))
示例2: NumberSet
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_string [as 别名]
x = NumberSet(UC)
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%02X --> 0x%s" % (UC, x.get_string(Option="hex"))
for letter in xrange(-2, 258):
test(letter)
elif "all" in sys.argv:
x = NumberSet(Interval(0, 0x100))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
elif "some" in sys.argv:
x = NumberSet(Interval(0, 0x32))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
x = NumberSet(Interval(0x42, 0x80))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
x = NumberSet(Interval(0xA0, 0xFF))