Newsgroups: comp.object,comp.lang.c++,comp.lang.eiffel,comp.lang.java,comp.lang.objective-c,comp.lang.sather,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!news.mathworks.com!newsfeed.internetmci.com!uwm.edu!math.ohio-state.edu!newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
From: shang@corp.mot.com (David L. Shang)
Subject: Re: # ANNOUNCEMENT #: The Developer - A New Object-Oriented Language And IDE
Reply-To: shang@corp.mot.com
Organization: MOTOROLA 
Date: Tue, 23 Jul 1996 20:46:56 GMT
Message-ID: <1996Jul23.204656.9838@schbbs.mot.com>
References: <4t29m2$ggl@dfw-ixnews9.ix.netcom.com>
Sender: news@schbbs.mot.com (SCHBBS News Account)
Nntp-Posting-Host: 129.188.128.126
Lines: 73
Xref: glinda.oz.cs.cmu.edu comp.object:52555 comp.lang.c++:201805 comp.lang.eiffel:15304 comp.lang.java:70692 comp.lang.objective-c:5522 comp.lang.sather:2881 comp.lang.smalltalk:41252

In article <4t29m2$ggl@dfw-ixnews9.ix.netcom.com> mitsuh@ix.netcom.com  
(Mitsuharu Hadeishi) writes:
> 
> Good.  I'd like to see the BNF formulation of your system.
> 
Okay, Here is the BNF for Transframe's expression:

E(n) (13>=n>=3):
	En-1
	En AttchedExpression(n)
AttchedExpression(n):
	[InffixExpression(n)] SuffixExpression(n)
InffixExpression(n):
	OperatorExpression(n)
	InffixExpression(n)  OperatorExpression(n)
SuffixExpression(n):
	LeftOperatorExpression(n)
	RightOperatorExpression(n)
OperatorExpression(n):
	ClassName  E(13)
LeftOperatorExpression(n):
	ClassName  E(n-1)
RightOperatorExpression(n):
	ClassName  E(n)
E(2) (PrefixExpression):
	SimpleExpression
	OperatorIdentifier PrefixExpression AttachedExpression(2)
E(1) (SimpleExpression):
	PrimaryExpression
	SubscriptExpression
	ObjectInstantiation
	MemberExpression

Transframe's expressions are divided into 13 priority levels. This
recursive definition is terminated at E(0), the primitive expressions
such as literals, identifiers, etc.

This generalized expression format can produce most of the C++-alike
expressions, and also many other expressions that C++ does not have.

Some ugly expressions would be disabled. Expamples are:

	x--+--y   
	x-----y  // this is actually an invalid C++ expression  
	x---++y

In Transframe, you have to write them this way:  

	x-- + --y   
	x-- - --y   
	x-- - ++y

Examples of some interesting expressions that C++ does not have:

	matrix[i,j]
	    // Transframe does not regulate the format of a
	    // particular operator, i.e., you can defined the
	    // way you use "[]" in any format you would like
	brids fly to tree
	    // "fly to" is a user defined operator
	s := sum x y z;
	(x,y) := f(a,b,c);
	x: Animal... = (aTiger, aLion, aBear);
	    // equivalent to Java's heterogeneous array
 	does x have Tiger?
	    // "does have ?" is an user-defined operator, and
 	    // "Tiger" is a class
	y: Tiger... := x select Tiger;
	    // "select" is an user-defined operator
	z: Tiger... := x chose Tiger satisfying someCondition; 
	    // "chose satisfying" is an user-defined operator

David Shang
