SML datatypes struggle
I have the following grammar that I need to translate into SML datatypes:

    Integer ranges over SML integer constants.
    Boolean ::= 'true' | 'false'
    Operator ::= 'ADD' | 'IF' | 'LESS_THAN'
    Arguments ::= ( ',' Expression ) *
    Expression ::= 'INT' '(' Integer ')'
                | 'BOOL' '(' Boolean ')'
                | 'OPERATION' '(' Operator ',' '[' Expression ( ',' Expression ) * ']' ')'

I have managed the following:


    datatype BOOL = true | false;
    datatype OPERATOR = ADD | IF | LESS_THAN;
    datatype INT = INT of int;

However I am struggling with datatypes Arguments and Expression. Any help would be appreciated.

Thanks
SML datatypes struggle
===

I have the following grammar that I need to translate into SML datatypes:

    Integer ranges over SML integer constants.
    Boolean ::= 'true' | 'false'
    Operator ::= 'ADD' | 'IF' | 'LESS_THAN'
    Arguments ::= ( ',' Expression ) *
    Expression ::= 'INT' '(' Integer ')'
                | 'BOOL' '(' Boolean ')'
                | 'OPERATION' '(' Operator ',' '[' Expression ( ',' Expression ) * ']' ')'

I have managed the following:


    datatype BOOL = true | false;
    datatype OPERATOR = ADD | IF | LESS_THAN;
    datatype INT = INT of int;

However I am struggling with datatypes Arguments and Expression. Any help would be appreciated.

Thanks