mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-04-24 07:09:00 +00:00
28 lines
867 B
Plaintext
28 lines
867 B
Plaintext
@top Program { Chord* }
|
|
|
|
ExplicitAction { ExplicitDelimStart (HexNumber | DecimalNumber | ActionId) ExplicitDelimEnd }
|
|
EscapedSingleAction { Escape EscapedLetter }
|
|
Action { SingleLetter | ExplicitAction | EscapedSingleAction }
|
|
ActionString { Action* }
|
|
ChordInput { (ActionString CompoundDelim)* ActionString }
|
|
ChordPhrase { ActionString }
|
|
Chord { ChordInput PhraseDelim ChordPhrase ChordDelim }
|
|
|
|
@tokens {
|
|
@precedence {HexNumber, DecimalNumber}
|
|
@precedence {CompoundDelim, PhraseDelim, ExplicitDelimStart, ChordDelim, SingleLetter}
|
|
@precedence {EscapedLetter}
|
|
ExplicitDelimStart {"<"}
|
|
ExplicitDelimEnd {">"}
|
|
CompoundDelim {"+>"}
|
|
PhraseDelim {"=>"}
|
|
Escape { "\\" }
|
|
HexNumber { "0x" $[a-fA-F0-9]+ }
|
|
DecimalNumber { $[0-9]+ }
|
|
ActionId { $[a-zA-Z_]$[a-zA-Z0-9_]* }
|
|
SingleLetter { ![\\] }
|
|
EscapedLetter { ![] }
|
|
ChordDelim { ($[\n] | @eof) }
|
|
}
|
|
|