Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variable ::= lower{ lower | upper | digit }
- lower ::= a | b | c | ... | z
- upper ::= A | B | C | ... | Z
- digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
- oper ::= symoper ("normal", symbolic operators)
- | ` variable ` (variable names in "back-ticks")
- symoper ::= symbol { symbol }
- symbol ::= ! | # | $ | % | & | * | + | . | / | <|=|> | ? | @ | \ | ^ | | | - | ~
- literal ::= boollit | intlit | floatlit | charlit | stringlit
- boollit ::= True | False
- intlit ::= digit { digit }
- floatlit ::= [ + | - ] intlit . intlit [ e | E [ + | - ] intlit ]
- charlit ::= 'nonapost '
- nonapost ::= (any character except apostrophe)
- stringlit ::= " { nonqchar } "
- nonqchar ::= (any character except quote mark)
- atomic ::= literal (a constant)
- | variable (a variable)
- | ( expr ) (a parenthesized expression)
- | ( expr1 , ... , exprk ) (a tuple, for k>=2)
- | [ expr1 , ... , exprk ] (a list)
- | [ expr1 [ , exp2 ] .. [ expr3 ] ] (an arithmetic sequence)
- | ( atomic oper ) (a left operator section)
- | ( oper atomic ) (a right operator section)
- | ( symoper ) (an operator by itself, not infix)
- expr ::= atomic
- | expr atomic (function application)
- | expr oper expr (infix operator application)
- | - expr (negative numbers)
- | let decls in expr
- | expr where decls
- | if expr then expr else expr
- | \ { variable } -> expr (lambda abstractions)
- decls ::= pattern = expr { ; decls }
- | variable { pattern } = expr { ; decls } (functions with parameters)
- pattern ::= literal (a constant)
- | variable (a variable)
- | ( pattern ) (a parenthesized pattern)
- | ( pattern1 , ... , patternk ) (a tuple pattern, for k>=2)
- | [ pattern1 , ... , patternk ] (a list of patterns)
- | constr pattern (constructor application)
- | pattern con-opr pattern (infix constructor application)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement