本文整理匯總了Python中pyparsing.LineEnd方法的典型用法代碼示例。如果您正苦於以下問題:Python pyparsing.LineEnd方法的具體用法?Python pyparsing.LineEnd怎麽用?Python pyparsing.LineEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyparsing
的用法示例。
在下文中一共展示了pyparsing.LineEnd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: lexical_analysis
# 需要導入模塊: import pyparsing [as 別名]
# 或者: from pyparsing import LineEnd [as 別名]
def lexical_analysis(self, src):
string = pp.Regex('[a-zA-Z0-9_{}"=+\-*/\.:;&%@$#<>? a-zA-Zぁ-ゔゞァ-・ヽヾ゛゜ー一-龯]+')
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)