2. Implement the missing operators: (binary) "-", "<=", ">=", "==", "!=", "/", "%", "or"token float_constant {

[

| \d+ '.' \d*

| \d* '.' \d+

]

{*}

}

For sake of completeness (and easy copy-paste for you), here's the list of operator declarations as I wrote them for Squaak:

rule expression is optable { ... }

proto 'infix:or' is precedence('1')

is pasttype('unless') { ... }

proto 'infix:and' is tighter('infix:or')

is pasttype('if') { ... }

proto 'infix:<' is tighter('infix:and') { ... }

proto 'infix:<=' is equiv('infix:<') { ... }

proto 'infix:>' is equiv('infix:<') { ... }

proto 'infix:>=' is equiv('infix:<') { ... }

proto 'infix:==' is equiv('infix:<') { ... }

proto 'infix:!=' is equiv('infix:<') { ... }

proto 'infix:+' is tighter('infix:<')

is pirop('n_add') { ... }

proto 'infix:-' is equiv('infix:+')

is pirop('n_sub') { ... }

proto 'infix:..' is equiv('infix:+')

is pirop('n_concat') { ... }

proto 'infix:*' is tighter('infix:+')

is pirop('n_mul') { ... }

proto 'infix:%' is equiv('infix:*')

is pirop('n_mod') { ... }

proto 'infix:/' is equiv('infix:*')

is pirop('n_div') { ... }

proto 'prefix:not' is tighter('infix:*')

is pirop('n_not') { ... }

proto 'prefix:-' is tighter('prefix:not')

is pirop('n_neg') { ... }

proto 'term:' is tighter('prefix:-')

is parsed(&term) { ... }

## No comments:

Post a Comment