blob: 1662907fb7382fd3574c4e350433b22b508720b2 [file] [log] [blame]
struct: "struct"i id "{" struct_field* "}"
enum: "enum"i id ":" type "{" constant_entry* "}"
bitmap: "bitmap"i id ":" type "{" constant_entry* "}"
event: event_priority "event"i id "=" number "{" struct_field* "}"
?event_priority: "critical"i -> critical_priority
| "info"i -> info_priority
| "debug"i -> debug_priority
attribute: attribute_tag* "attribute"i struct_field
attribute_tag: "readonly"i -> attr_readonly
| "nosubscribe"i -> attr_nosubscribe
request_struct: "request"i struct
response_struct: "response"i struct
command_attribute: "timed"i -> timed_command
command_attributes: command_attribute*
command: command_attributes "command"i id "(" id? ")" ":" id "=" number ";"
cluster: cluster_side "cluster"i id "=" number "{" (enum|bitmap|event|attribute|struct|request_struct|response_struct|command)* "}"
?cluster_side: "server"i -> server_cluster
| "client"i -> client_cluster
endpoint: "endpoint"i number "{" endpoint_cluster* "}"
endpoint_cluster: endpoint_cluster_type "cluster"i id ";"
?endpoint_cluster_type: "server"i -> endpoint_server_cluster
| "binding"i -> endpoint_binding_to_cluster
constant_entry: id "=" number ";"
number: POSITIVE_INTEGER | HEX_INTEGER
struct_field: member_attribute* field
member_attribute: "optional"i -> optional
| "nullable"i -> nullable
field: data_type id list_marker? "=" number ";"
list_marker: "[" "]"
data_type: type ("<" number ">")?
id: ID
type: ID
COMMENT: "{" /(.|\n)+/ "}"
| "//" /.*/
POSITIVE_INTEGER: /\d+/
HEX_INTEGER: /0x[A-Fa-f0-9]+/
ID: /[a-zA-Z_][a-zA-Z0-9_]*/
idl: (struct|enum|cluster|endpoint)*
%import common.WS
%import common.C_COMMENT
%import common.CPP_COMMENT
%ignore WS
%ignore C_COMMENT
%ignore CPP_COMMENT