21 lines
787 B
EBNF
21 lines
787 B
EBNF
# (*
|
|
# Trixy is fully whitespace independent, this means that you can
|
|
# interleave whitespace in the definitions.
|
|
# The same applies to comments:
|
|
# - Line comments (`// \n`) and
|
|
# - Block comments (`/* */`).
|
|
# *)
|
|
|
|
CommandSpec = { Function | Namespace | Enumeration | Structure } ;
|
|
Function = "fn" Identifier "(" [NamedType {"," NamedType }] ")" [ "->" Type ] ";" ;
|
|
Namespace = "nasp" Identifier "{" {Function | Namespace | Enumeration | Structure} "}" ;
|
|
Structure = "struct" Identifier "{" [NamedType {"," NamedType } [","]] "}" ";";
|
|
Enumeration = "enum" Identifier "{" [Identifier {"," Identifier} [","]] "}" ";";
|
|
Identifier = (CHARACTER | "_") { NUMBER | CHARACTER | "_" } ;
|
|
NamedType = Identifier ":" Type;
|
|
Type = Identifier ["<" Type {"," Type} ">"];
|
|
|
|
# (*
|
|
# vim: ft=ebnf
|
|
# *)
|