Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (40 sloc) 1.42 KB

poly-record-ml

Build Status

requirements

  • menhir
  • ounit (for testing)

BNF

<program> ::= <term> ";;"

<term> ::= <variable>
         | <integer>
         | <boolean>
         | "()"
         | <term> <op> <term>
         | "if" <term> "then" <term> "else" <term>
         | "fun" (<variable>+ | "()") "->" <term>
         | <term> <term>
         | "let" <variable> (<variable>+ | "()")? "=" <term> "in" <term>
         | "{" <record> "}"
         | <term> "." <label>
         | "modify" "(" <term> "," <label> "," <term> ")"
         | <term> ";" <term>
         | "ref" <term>
         | "!" <term>
<variable> ::= <small> | <alphanum>+
<alphanum> ::= <alphabet> | <number> | ['_' '\'']
<integer> ::= '-'? <number>
<number> ::= <digit>+
<alphabet> ::= <small> | <capital>
<small> ::= ['a' - 'z']
<capital> ::= ['A' - 'Z']
<digit> ::= ['0' - '9']
<boolean> ::= "true" | "false"
<op> ::= "+" | "*" | "<" | ":="
<record_body> ::= <record_field> ("," <record_field>)*
<field> ::= <label> "=" <term>
<label> ::= <variable>

References