logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Nice/src/bossa/syntax tools.nice,1.23,1.24 typecheck.nice,1.78,1.79: msg#00067

lang.nice.cvs

Subject: Nice/src/bossa/syntax tools.nice,1.23,1.24 typecheck.nice,1.78,1.79

Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv18438/F:/nice/src/bossa/syntax

Modified Files:
tools.nice typecheck.nice
Log Message:
Type inference for instanceof in a while loop.

Index: tools.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** tools.nice 27 Aug 2003 09:33:45 -0000 1.23
--- tools.nice 28 Sep 2003 17:16:33 -0000 1.24
***************
*** 93,102 ****
}

! ?(MonoSymbol, TypeConstructor) getInstanceof(IfExp ifExp)
{
! if (! (ifExp.condition instanceof CallExp))
return null;

! CallExp condition = cast(ifExp.condition);
if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2)
return null;
--- 93,102 ----
}

! ?(MonoSymbol, mlsub.typing.Monotype) getInstanceof(Expression cond)
{
! if (! (cond instanceof CallExp))
return null;

! CallExp condition = cast(cond);
if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2)
return null;
***************
*** 120,124 ****
return null;

! return (sym, notNull(type.representedType));
}

--- 120,138 ----
return null;

!
! TypeConstructor tc = notNull(type.representedType);
! mlsub.typing.Monotype[?] parameters;
!
! if (tc.arity() == 0)
! parameters = null;
! else if (sym.getMonotype() instanceof mlsub.typing.MonotypeConstructor)
! {
! mlsub.typing.MonotypeConstructor mc = cast(sym.getMonotype());
! parameters = mc.getTP();
! }
! else
! return null;
!
! return (sym, Monotype.sure(new mlsub.typing.MonotypeConstructor(tc,
parameters)));
}


Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** typecheck.nice 17 Sep 2003 00:14:06 -0000 1.78
--- typecheck.nice 28 Sep 2003 17:16:33 -0000 1.79
***************
*** 392,415 ****
});

! ?(MonoSymbol, TypeConstructor) test = getInstanceof(e);
if (test != null)
{
! (MonoSymbol variable, TypeConstructor tc) = test;
! mlsub.typing.Monotype[?] parameters = null;
! if (tc.arity() == 0)
! parameters = null;
! else if (variable.getMonotype() instanceof
mlsub.typing.MonotypeConstructor)
! {
! mlsub.typing.MonotypeConstructor mc = cast(variable.getMonotype());
! parameters = mc.getTP();
! }
! else
! test = null;
!
! if (test != null)
! {
! mlsub.typing.Monotype type = Monotype.sure(new
mlsub.typing.MonotypeConstructor(tc, parameters));
! setVarType(variable, now: type, otherBranch: variable.type);
! }
}

--- 392,400 ----
});

! ?(MonoSymbol, mlsub.typing.Monotype) test =
getInstanceof(notNull(e.condition));
if (test != null)
{
! (MonoSymbol variable, mlsub.typing.Monotype type) = test;
! setVarType(variable, now: type, otherBranch: variable.type);
}

***************
*** 657,660 ****
--- 642,652 ----
now: makeSure(variable.type),
out: variable.type));
+
+ ?(MonoSymbol, mlsub.typing.Monotype) test =
getInstanceof(notNull(whileExp));
+ if (test != null)
+ {
+ (MonoSymbol variable, mlsub.typing.Monotype type) = test;
+ setVarType(variable, now: type, otherBranch: variable.type);
+ }
}





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf





Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo