A BNF
body:
constituents ;opt
constituents:
constituent ; ...
constituent:
definition
local-declaration
expression
macro:
definition-macro-call
statement
function-macro-call
property-list:
property , ...
property:
symbol value
value:
basic-fragment
list-fragment:
non-statement-list-fragment
statement non-statement-list-fragmentopt
basic-fragment:
non-statement-basic-fragment
statement non-statement-basic-fragmentopt
non-statement-body-fragment:
definition semicolon-fragmentopt
local-declaration semicolon-fragmentopt
simple-fragment body-fragmentopt
, body-fragmentopt
; body-fragmentopt
semicolon-fragment:
; body-fragmentopt
non-statement-list-fragment:
simple-fragment list-fragmentopt
, list-fragmentopt
non-statement-basic-fragment:
simple-fragment basic-fragmentopt
simple-fragment:
variable-name
constant-fragment
binary-operator
unary-operator
bracketed-fragment
function-macro-call
#-word
one of . :: => ? ?? ?= ... ## otherwise
bracketed-fragment:
( body-fragmentopt )
[ body-fragmentopt ]
{ body-fragmentopt }
constant-fragment:
number
character-literal
string
symbol
#( constants . constant )
#( constantsopt )
#[ constantsopt ]
definition-macro-call:
define modifiersopt define-body-word body-fragmentopt definition-tail
define modifiersopt define-list-word list-fragmentopt
modifier:
unreserved-name
modifiers:
modifier ...
definition-tail:
end define-body-wordopt nameopt
condition:
type
( type comma-property-listopt )
handler:
expression
local-methods:
methodopt method-definition , ...
bindings:
variable = expression
( variable-list ) = expression
variable-list:
variables
variables , #rest variable-name
#rest variable-name
variables:
variable , ...
variable:
variable-name
variable-name :: type
variable-name:
ordinary-name
type:
operand
expression:
binary-operand binary-operator ...
binary-operand:
symbol
unary-operatoropt operand
operand:
operand ( argumentsopt )
operand [ arguments ]
operand . variable-name
function-macro-call
leaf
arguments:
symbolopt expression , ...
function-macro-call:
function-word ( body-fragmentopt )
function-word ( body-fragmentopt ) := expression
leaf:
literal
variable-name
( expression )
statement
literal:
number
character-literal
string-literal
#t
#f
#( constants . constant )
#( constantsopt )
#[ constantsopt ]
string-literal:
string ...
constants:
constant , ...
constant:
literal
symbol
end-clause:
end begin-wordopt
case-body:
cases ;opt
cases:
case-label constituentsopt ; ...
case-label:
expressions =>
( expressions ) =>
otherwise =>opt
parameter-list :
( parametersopt ) ;opt
( parametersopt ) => variable ;
( parametersopt ) => ( values-listopt ) ;opt
parameters:
required-parameters
required-parameters , next-rest-key-parameter-list
next-rest-key-parameter-list
next-rest-key-parameter-list:
#next variable-name
#next variable-name , rest-key-parameter-list
rest-key-parameter-list
rest-key-parameter-list:
#rest variable-name
#rest variable-name , key-parameter-list
key-parameter-list
key-parameter-list:
#key keyword-parametersopt
#key keyword-parametersopt , #all-keys
#all-keys
required-parameters:
required-parameter , ...
required-parameter:
variable
variable-name == expression
keyword-parameters:
keyword-parameter , ...
keyword-parameter:
symbolopt variable defaultopt
default:
= expression
values-list:
variables
variables , #rest variable
#rest variable
main-rule-set:
body-style-definition-rule ...
list-style-definition-rule ...
statement-rule ...
function-rule ...
body-style-definition-rule :
{ define definition-headopt name patternopt ;opt end } => rhs
list-style-definition-rule :
{ define definition-headopt name patternopt } => rhs
rhs:
{ templateopt } ;opt
definition-head :
modifier-pattern ...
modifier-pattern:
modifier
pattern-variable
statement-rule:
{ name patternopt ;opt end } => rhs
function-rule:
{ name ( patternopt ) } => rhs
pattern-list:
pattern-sequence
property-list-pattern
pattern-sequence , pattern-list
pattern-sequence:
simple-pattern ...
simple-pattern:
name
=>
bracketed-pattern
binding-pattern
pattern-variable
bracketed-pattern:
( patternopt )
[ patternopt ]
{ patternopt }
binding-pattern:
pattern-variable :: pattern-variable
pattern-variable = pattern-variable
pattern-variable :: pattern-variable = pattern-variable
pattern-variable:
? name
? constrained-name
...
property-list-pattern:
#rest pattern-variable
#key pattern-keywordsopt
#rest pattern-variable , #key pattern-keywordsopt
pattern-keywords:
#all-keys
pattern-keyword
pattern-keyword , pattern-keywords
pattern-keyword:
? name defaultopt
? constrained-name defaultopt
?? name defaultopt
?? constrained-name defaultopt
template-element:
name
symbol
number
character-literal
string
unary-operator
separator
#-word
one of . :: =>
( templateopt )
[ templateopt ]
{ templateopt }
#( templateopt )
#[ templateopt ]
substitution
separator:
one of ; ,
binary-operator
substitution:
name-prefixopt ? name-string-or-symbol name-suffixopt
?? name separatoropt ...
...
?= name
name-prefix:
string ##
name-suffix:
## string
name-string-or-symbol:
name
string
symbol
auxiliary-rule-set:
symbol auxiliary-rules
auxiliary-rules:
auxiliary-rule ...
auxiliary-rule:
{ patternopt } => rhs
Generated with Harlequin WebMaker