MPSIDL Logo

MpsLanguageMappings


MPS assumes ints are 32-bit signed quantities, and longs are 64-bit signed quantities.

 MPS Type		Java Type		C++ Type

 int			int			int
 long			long			long long
 char			char			char
 bool			boolean			bool
 float			float			float
 string			java.lang.String	std::string const &
 X []			X []			std::vector< X > const &
 X [][]			X [][]			std::vector< std::vector< X > > const &

 Structure		Class with accessors	Class with accessors
 Mutable Structure	Class with accessors/mutators (both Java and C++)
 Exception		Class with accessors    Class with accessors
 Interface		Class with behaviour	Class with behaviour
 Enum			Class with final ints	Class with contained enum
 Namespace		Package (nested)	Namespace (nested)

Structures are passed in C++ as const references. Exceptions should be caught by reference. Interfaces are passed in as ref<>s (see ReferenceCountingGc) to the Interface pure-abstract-class for that interface. Namespaces do not appear as first-class objects in either backend language, and thus cannot be directly manipulated. Enums only map to name definitions currently; you cannot mention an enum in a context which requires a type.

	int myfunction(MyStruct const &param);
	int myfunction(ref<MyInterface> const &param);

	try {
		...
	} catch (MyException &excp) {
		...
	}


(last modified 15 August 2001 by surazal)

SourceForge.net Logo