def analyzer_functions_get(ModeDB): code = [] # (*) Get list of modes that are actually implemented # (abstract modes only serve as common base) mode_name_list = ModeDB.keys() for name, mode_descr in ModeDB.iteritems(): dial_db.clear() # -- Generate 'Mode' from 'ModeDescriptions' mode = Mode(mode_descr) blackboard.mode_db[name] = mode if not mode.is_implemented(): continue txt_analyzer = cpp_generator.do(mode, mode_name_list) txt_counter = cpp_generator.do_default_counter(mode) code.extend(txt_counter) code.extend(txt_analyzer) code.append( do_comment_pattern_action_pairs(blackboard.mode_db.itervalues())) if not Setup.token_class_only_f: determine_start_mode(blackboard.mode_db) # (*) perform consistency check on newly generated mode_db consistency_check.do(blackboard.mode_db) # generate frame for analyser code return cpp_generator.frame_this("".join(code)), blackboard.mode_db
def analyzer_functions_get(ModeDB): code = [] # (*) Get list of modes that are actually implemented # (abstract modes only serve as common base) mode_name_list = ModeDB.keys() for name, mode_descr in ModeDB.iteritems(): dial_db.clear() # -- Generate 'Mode' from 'ModeDescriptions' mode = Mode(mode_descr) blackboard.mode_db[name] = mode if not mode.is_implemented(): continue txt_analyzer = cpp_generator.do(mode, mode_name_list) txt_counter = cpp_generator.do_default_counter(mode) code.extend(txt_counter) code.extend(txt_analyzer) code.append(do_comment_pattern_action_pairs(blackboard.mode_db.itervalues())) if not Setup.token_class_only_f: determine_start_mode(blackboard.mode_db) # (*) perform consistency check on newly generated mode_db consistency_check.do(blackboard.mode_db) # generate frame for analyser code return cpp_generator.frame_this("".join(code)), blackboard.mode_db
def do_plot(): mode_description_db = quex_file_parser.do(Setup.input_mode_files) for mode_descr in mode_description_db.itervalues(): mode = Mode(mode_descr) # -- some modes only define event handlers that are inherited if len(mode.pattern_list) == 0: continue plotter = grapviz_generator.Generator(mode.pattern_list, StateMachineName=mode.name) plotter.do(Option=Setup.character_display)
def enter(Name, ModeDescr): mode = Mode(mode_descr) # -- Generate 'Mode' from 'ModeDescriptions' blackboard.mode_db[name] = mode return mode