字句
<alphabet> ::= <upper alphabet> | <lower alphabet>
<upper alphabet> ::= '[A-Z]'
<lower alphabet> ::= '[a-z]'
<number> ::= '[0-9]'

<name> ::= <variable name> | <function name>
<variable name> ::= <global variable name> | <local variable name>
<global variable name> ::= '$' (<alphabet> | <number> | '_')+
<local variable name> ::= <lower alphabet> (<alphabet> | <number> | '_')*
<function name> ::= <upper alphabet> (<alphabet> | <number> | '_')*

<type> ::= 'int' | 'float' | 'string'

<literal> ::= <int> | <float> | <string> | <null>
<int> ::= '[1-9][0-9]*' | '0'
<float> ::= '[1-9][0-9]*.[0-9]+' | '0.[0-9]+'
<string> ::= '"' <literation>* '"'
<literation> ::= UTF8で表される文字表記全体（ただし'"'を除く）
<null> ::= 'null'

<operator> ::= <unary operator> | <binary operator>
<unary operator> ::= '+' | '-' | '!' | '(' <type> ')'
<binary operator> ::=
	<additive operator> | <multicative operator> | <comparator>
	| <equivalence operator> | <logical operator> | <assignment operator>
<additive operator> ::= '+' | '-'
<multicative operator> ::= '*' | '/' | '%'
<comparator> ::= '<' | '<=' | '>' | '>='
<equivalence operator> ::= '==' | '!='
<logical operator> ::= '&&' | '||'
<assignment operator> ::= '='

式
<primary> ::= <variable name> | <literal>
	| <function name> <argument> | '[' <expression> ']' | '(' <expression> ')'
<argument> ::= ('(' (<expression> (',' <expression>)*)? ')')?

<suffixed expression> ::= <primary> <subscript>*
<subscript> ::= '[' <expression> ']'

<prefixed expression> ::=
	<suffixed expresion> | (<at operator> | <unary operator>) <prefixed expression>
<at operator> ::= '{' <expression> '}'

<arithmetic term> ::=
	<prefixed expression> (<multicative operator> <prefixed expression>)*

<arithmetic expression> ::=
	<arithmetic term> (<additive operator> <arithmetic term>)*

<comparison> ::= <arithmetic term> (<comparator> <arithmetic term>)*

<equivalence comparison> ::= <comparison> (<equivalence operator> <comparison>)*

<logical term> ::= <equivalence comparison> ('&&' <equivalence comparison>)*

<logical expression> ::= <logical term> ('||' <logical term>)*

<expression> ::=
	<logical expression> | <variable name> <subscript>* '=' <expression>

文
<empty statement> ::= ';'

<expression statement> ::= <expression> ';'

<return statement> ::= 'return' ';' | 'return ' <expression> ';'

<break statement> ::= 'break' ';'

<continue statement> ::= 'continue' ';'

<if statement> ::=
	'if ' <expression> ';' <statement>*
	('elsif ' <expression> ';' <statement>*)*
	('else' ';' <statement>*)?
	'end' ';'
	
<while statement> ::=
	'while ' <expression> ';' <statement>* 'end' ';'

<statement> ::=
	<empty statement> | <expression statement> | <return statement>
	| <break statement> | <continue statement> | <if statement> | <while statement>

関数定義
<function definition> ::=
	'def ' <name> <argument> ';' <statement>* 'end' ';'

プログラム
<program> ::= (<function definition> | <statement>)*
