forked from AbleOS/ableos
26 lines
657 B
BNF
26 lines
657 B
BNF
|
|
||
|
|
||
|
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
|