mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2024-11-26 03:40:48 +00:00
16 lines
617 B
Python
16 lines
617 B
Python
from pyparsing import Group, OneOrMore, Optional, Suppress, Word, alphanums, restOfLine
|
|
|
|
|
|
class Parser:
|
|
def __init__(self):
|
|
self.widget = Group(OneOrMore(Word(alphanums)))
|
|
self.widget_token = Suppress("||")
|
|
self.identifier = Group(OneOrMore(Word(alphanums)))
|
|
self.event = Group(OneOrMore(Word(alphanums)))
|
|
self.menu_token = Suppress("::")
|
|
self.match = (
|
|
self.widget + self.widget_token + self.identifier + Optional(self.widget_token) + Optional(self.event)
|
|
| self.identifier + self.menu_token + self.event
|
|
| restOfLine
|
|
)
|