def __prepare(Language): global dial_db end_str = ' printf("end\\n");\n' end_str += "# define self (*me)\n" end_str += " self.send(&self, QUEX_TKN_TERMINATION);\n" end_str += " return;\n" end_str += "# undef self\n" __Setup_init_language_database(Language) dial_db = DialDB() variable_db.init() return end_str
def __prepare(Language, TokenQueueF=False): end_str = ' printf("end\\n");\n' if not TokenQueueF: end_str += ' return false;\n' else: end_str += "# define self (*me)\n" end_str += " self_send(QUEX_TKN_TERMINATION);\n" end_str += " return;\n" end_str += "# undef self\n" __Setup_init_language_database(Language) dial_db.clear() variable_db.init() return end_str
def __prepare(Language, TokenQueueF=False): end_str = ' printf("end\\n");\n' if not TokenQueueF: end_str += ' return false;\n' else: end_str += "# define self (*me)\n" end_str += " self_send(QUEX_TKN_TERMINATION);\n" end_str += " return;\n" end_str += "# undef self\n" __Setup_init_language_database(Language) dial_db.clear() variable_db.init() return end_str
print "CHOICES: 5, 6, 7, 8;" print "SAME;" sys.exit(0) if len(sys.argv) < 2: print "Argument not acceptable, use --hwut-info" sys.exit(0) BS = int(sys.argv[1]) if BS not in [5, 6, 7, 8]: print "Argument not acceptable, use --hwut-info" sys.exit(0) Language = "Cpp" __Setup_init_language_database(Language) trigger_set = NumberSet([Interval(0x600, 0x700)]) Setup.buffer_codec_set(bc_factory.do("utf8"), 1) def make(TriggerSet, BufferSize): Language = "ANSI-C-from-file" code = create_character_set_skipper_code(Language, "", TriggerSet, QuexBufferSize=BufferSize, InitialSkipF=False, OnePassOnlyF=True) exe_name, tmp_file_name = compile(Language, code) return exe_name, tmp_file_name
if len(sys.argv) < 2: print "Argument not acceptable, use --hwut-info" sys.exit(0) BS = int(sys.argv[1]) if BS not in [3, 4, 5, 6, 7, 8]: print "Argument not acceptable, use --hwut-info" sys.exit(0) trigger_set = NumberSet([Interval(ord('a'), ord('z') + 1), Interval(ord('A'), ord('Z') + 1)]) Language = "Cpp" __Setup_init_language_database(Language) trigger_set = NumberSet([Interval(ord('a'), ord('z') + 1), Interval(ord('A'), ord('Z') + 1)]) def make(TriggerSet, BufferSize): Language = "ANSI-C-from-file" code = create_character_set_skipper_code(Language, "", TriggerSet, QuexBufferSize=BufferSize) exe_name, tmp_file_name = compile(Language, code) return exe_name, tmp_file_name def core(Executable, BufferSize, TestStr): fh = open("test.txt", "wb") fh.write(TestStr) fh.close() run_this("./%s test.txt %i" % (Executable, BufferSize))