def lexical_analysis(self, src):
string = pp.Regex('[a-zA-Z0-9_{}"=+\-*/\.:;&%@$#<>? ?-??-??-???-???????-?]+')
blank = pp.LineStart() + pp.LineEnd()
start = '['
end = ']' + pp.LineEnd()
graph_tag = pp.LineStart() + '@'
graph = graph_tag + start + string + end
view_tag = pp.LineStart() + '#'
view = view_tag + start + string + end
server_process_tag = pp.LineStart() + '$'
server_process = server_process_tag + start + string + end
client_process_tag = pp.LineStart() + '%'
client_process = client_process_tag + start + string + end
view_transition_identifier = pp.LineStart() + '-->'
view_transition = view_transition_identifier + string
process_transition_identifier = pp.LineStart() + '==>'
process_transition = process_transition_identifier + string
state_machine = pp.OneOrMore(graph | view | server_process | client_process | view_transition | process_transition | string | blank)
return state_machine.parseString(src)
评论列表
文章目录