problem with types

ingenuit at at ingenuity-sw.com
Tue Sep 15 11:02:16 AEST 1998


I need to create a Mercury type for the operators
of another computer language, Java.  The Java operators
are just different enough that they conflict with Mercury's
parsing of such.

:- type javaOperator
	--->
	{;}	%this succeeds
	; {<<}	% these and most of the others fail
	;"+=".

I'd like to use something close to the original java
operators, but even this fails:

:- type operator(string).

:- type javaOperator
	--->
	operator(";")	%fails
	;operator("<<").

.....

io__write("<<"), % this succeeds, however.   why???

....


If I have to put abstract names on the java tokens in the
incoming java token stream it will reduce readability, increase
programing effort and reduce maintainability.

Is there another way to "escape" the java operators sufficiently
to use them as types?



Thanks,

Ann Tecklenburg



More information about the users mailing list