[Prev][Next][Index]

More questions about LSL syntax



I have a few more questions and remarks about LSL syntax.  (I am working
towards the definition of an abstract syntax for LCL.  At this point though, I
am still trying to make sure that I fully understanding the concrete syntax of
LCL (and LSL).)


The grammar for LSL allows one to overload logicalOp's and eqOp's and to
define them with arity less than two (as can be seen from the production for
opForm):

   opForm	::=  ...
 	   	     | [markerSym] { simpleOp | logicalOp | eqOp } [markerSym]

Also, the following is accepted by the LSL checker (2.4x):

	test1: trait
	  introduces
	    __\and  : S -> S
	    = __    : S -> S

On the otherhand, the definition of term does not seem to allow the use of
logicalOp's or eqOp's with arity other than two.  The following is not
accepted by the LSL checker:

	test2: trait
	  introduces
	    a : -> S
	    __\and  : S -> S
	    = __    : S -> S
	  asserts
	    a \and == = a

	./test2.lsl:7,11: expecting variable, simple operator, or term


Was it intended that logicalOp's and eqOp's be required to have arity two?
I.e. opForm defined as

   opForm	::=  ...
 	   	     | markerSym { logicalOp | eqOp } markerSym
 	   	     | [markerSym] { simpleOp } [markerSym]
		     | ...

Are there any other restrictions to be enforced---e.g. that the range of an
eqOp must be Bool?


Based rules for determining tokens in LSL I can't see how /\ can be
considered a single token.  According to the rules, /\ consists of two tokens
the first being `/` and the second being the extensionChar `\' (provided it has
not been redefined, of course).

Also, why are // and -/, not accepted as simpleOp's?  Consider the following
trait and the error reported by the LSL checker:

	test3: trait
	  introduces
	    __ // __ : S,S -> S
	    __ -/ : S -> S

	./test3.lsl:3,8: expecting `:' before domain

Patrice

Follow-Up(s):