本文整理汇总了Python中state.State.makeStartState方法的典型用法代码示例。如果您正苦于以下问题:Python State.makeStartState方法的具体用法?Python State.makeStartState怎么用?Python State.makeStartState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.makeStartState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import makeStartState [as 别名]
def main():
dirName = sys.argv[1]
path = "../tmd_dirs/" + dirName + "/"
try:
functions = [string.strip(x) for x in open(path + "functions", "r").readlines()]
except:
print "No functions file found in directory " + path
raise
functionLabelDictionary, functionDictionary, _, _ = getFunctionLabelDictionary(functions, path)
functionVariableDictionary = getFunctionVariableDictionary(functions, path)
###################################################################
try:
initValueString = string.strip(open(path + "initvar", "r").read()) + "H"
except:
print "No initvar file found in directory " + path
raise
###################################################################
inState = State("start_processor")
inState.makeStartState()
listOfStates = []
mainFunctionInputLine = open(path + functions[0] + ".tmd", "r").readlines()[0]
numberOfVariables = len(string.split(mainFunctionInputLine)) - 1
numberOfFunctions = len(functions)
inState = incrementLineNumberIDs(listOfStates, inState)
inState = markFunctionNames(listOfStates, inState)
inState = incrementFunctionIDs(listOfStates, inState)
inState = firstPrepTopFunction(inState, listOfStates, "first_prep")
inState = processCentrally(inState, listOfStates)
# print "States in processor:", len(listOfStates)
convertStatesToString(listOfStates, open("../../tm/tm4/tm4_files/" + dirName + "_proc.tm4", "w"))