1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/dev/aldi.bnf

26 lines
657 B
BNF
Raw Normal View History

2024-09-10 18:50:51 -05:00
declarations ::= <declaration> <declarations>
declaration ::= <enum_decl> | <struct_decl> | <type_decl> | <protocol_decl>
<type_decl> ::= "type" <ident> <ident> ";"
enum_decl ::= "enum" <ident> "{" "}"
| "enum" <ident> "{" <enum_members> "}"
enum_members ::= <enum_member> ["," <enum_member>]+ [","]
enum_member ::= <ident> "=" <number>
struct_decl ::= "struct" <ident> "{" "}"
| "struct" <ident> "{" <struct_members> "}"
struct_members ::= <struct_member>
| <struct_member> ","
| <struct_member> "," <struct_members>
| <struct_member> "," <struct_members>
// TODO protocol_decl