-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdb_mi.peg
27 lines (27 loc) · 1.08 KB
/
gdb_mi.peg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
res <- output
output <- ( out_of_band_record )* result_record? "(gdb)" \n
result_record <- token? "^" result_class ( ',' result )* \n
out_of_band_record <- async_record / stream_record
async_record <- exec_async_output / status_async_output / notify_async_output
exec_async_output <- token? "*" async_output \n
status_async_output <- token? "+" async_output \n
notify_async_output <- token? "=" async_output \n
async_output <- async_class ( "," result )*
result_class <- "done" / "running" / "connected" / "error" / "exit"
async_class <- "stopped"
result <- variable "=" value
variable <- string
value <- const / tuple / list
const <- '"' c_string '"'
tuple <- "{}" / "{" result ( "," result )* "}"
list <- empty_list / value_list / result_list
empty_list <- "[]"
value_list <- "[" value ( "," value )* "]"
result_list <- "[" result ( "," result )* "]"
stream_record <- console_stream_output / target_stream_output / log_stream_output
console_stream_output <- "~" c_string \n
target_stream_output <- "@" c_string \n
log_stream_output <- "&" c_string \n
token <- \w+
string <- \w+
c_string <- (!'"' .)+