Nice/src/bossa/parser Parser.jj,1.327,1.328

Daniel Bonniot <[email protected]> Sat, 09 Apr 2005 10:58:20 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10391/src/bossa/parser

Modified Files:
	Parser.jj 
Log Message:
Fix generics syntax with constructed monotypes.


Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.327
retrieving revision 1.328
diff -C2 -d -r1.327 -r1.328
*** Parser.jj	3 Apr 2005 03:05:14 -0000	1.327
--- Parser.jj	9 Apr 2005 10:58:17 -0000	1.328
***************
*** 592,613 ****
  
  TypeSymbol binder(Collection atomics):
! { TypeIdent ti;
!   TypeConstructor typevar;
! }
  {
! ( LOOKAHEAD( typeConstructor() "extends" )
!   { TypeIdent typevarid; Monotype m2; }
!   typevarid=typeIdent() "extends"
!   { typevar = new TypeConstructor(typevarid.getName().toString()); }
    ( LOOKAHEAD(typeIdent() ( "," | "|" | ">"))
      ti=typeIdent()
      {
!       atomics.add(new TypeConstructorLeqCst(typevar, ti));
!       return typevar;
      }
    |
      m2=monotype()
      {
!       atomics.add(new MonotypeLeqCst(typevarid, m2));
        return typevar;
      }
--- 592,613 ----
  
  TypeSymbol binder(Collection atomics):
! { TypeIdent ti; }
  {
! ( LOOKAHEAD( unlocIdent() "extends" )
!   { String ident; }
!   ident=unlocIdent() "extends"
    ( LOOKAHEAD(typeIdent() ( "," | "|" | ">"))
      ti=typeIdent()
      {
!       TypeConstructor tc = new TypeConstructor(ident);
!       atomics.add(new TypeConstructorLeqCst(tc, ti));
!       return tc;
      }
    |
+     { Monotype m2; }
      m2=monotype()
      {
!       MonotypeVar typevar = new MonotypeVar(ident);
!       atomics.add(new MonotypeLeqCst(new MonotypeWrapper(typevar), m2));
        return typevar;
      }
***************
*** 615,618 ****
--- 615,619 ----
  |
    LOOKAHEAD( typeIdent() typeConstructor() )
+   { TypeConstructor typevar; }
    ti=typeIdent()
    typevar=typeConstructor()



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click