Skip to content

Commit

Permalink
Add initial implementation of grammar.lark
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrosss committed Oct 20, 2023
1 parent 225780b commit 587d643
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/grammar.lark
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
start: body footer

body: params data
params: detailed_params | simple_params
detailed_params: INT INT INT INT [INT] info
simple_params: INT INT INT INT
info: "5002" INFO_BODY "6002"
data: (info | "5000" | INT)+

footer: "5003" footer_line+ "6003"
footer_line: rate_line | stat_line | nr_line | log_line

rate_line: modality rate
rate: rate_prefix INT INT
rate_prefix: "Freq Per:"

stat_line: modality stat
stat: stat_prefix INT INT INT INT
stat_prefix: "Min Max Avg StdDiff:"

nr_line: nr_prefix INT INT INT INT
nr_prefix: "NrTrig NrMP NrArr AcqWin:"

log_line: log_prefix INT
log_prefix: "LogStartMDHTime:"
| "LogStopMDHTime:"
| "LogStartMPCUTime:"
| "LogStopMPCUTime:"

modality: "ECG" | "PULS" | "RESP" | "EXT" | "EXT2"

INFO_BODY: /[^\s]+.+?(?=\s*?6002)/

%import common.INT
%import common.WS
%ignore WS

0 comments on commit 587d643

Please sign in to comment.