|
| term-read-in | --> subterm(1200) full-stop
|
|
| subterm(N) | --> term(M) | {where M is less than or equal to N}
|
|
| term(N) | --> op(N,fx)
|
| | | op(N,fy)
|
| | | op(N,fx) subterm(N-1) | {except the case - number}
|
| | | {if subterm starts with a (, op must be followed by a space}
|
| | | op(N,fy) subterm(N) | {if subterm starts with a (, op must be followed by a space}
|
| | | subterm(N-1) op(N,xfx) subterm(N-1)
|
| | | subterm(N-1) op(N,xfy) subterm(N)
|
| | | subterm(N) op(N,yfx) subterm(N-1)
|
| | | subterm(N-1) op(N,xf)
|
| | | subterm(N) op(N,yf)
|
|
| term(1000) | --> subterm(999) , subterm(1000)
|
|
| term(0) | --> functor ( arguments )
|
| | | {provided there is no space between functor and the (}
|
| | | ( subterm(1200) )
|
| | | { subterm(1200) }
|
| | | list
|
| | | string
|
| | | constant
|
| | | variable
|
|
| op(N,T) | --> name | {where name has been declared as an operator of type T and precedence N}
|
|
| arguments | --> subterm(999)
|
| | | subterm(999) , arguments
|
|
| list | --> []
|
| | | [ listexpr ]
|
|
| listexpr | --> subterm(999)
|
| | | subterm(999) , listexpr
|
| | | subterm(999) | subterm(999)
|
|
| constant | --> atom | number
|
|
| number | --> integer | float
|
|
| atom | --> name | {where name is not a prefix operator}
|
|
| integer | --> natural-number
|
| | | - natural-number
|
|
| float | --> unsigned-float
|
| | | - unsigned-float
|
|
| functor | --> name
|