本文整理汇总了Python中pyparsing.LineStart方法的典型用法代码示例。如果您正苦于以下问题:Python pyparsing.LineStart方法的具体用法?Python pyparsing.LineStart怎么用?Python pyparsing.LineStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyparsing
的用法示例。
在下文中一共展示了pyparsing.LineStart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: lexical_analysis
# 需要导入模块: import pyparsing [as 别名]
# 或者: from pyparsing import LineStart [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)