Nice/src/bossa/parser Parser.jj,1.323,1.324

Daniel Bonniot <[email protected]> Mon, 28 Mar 2005 14:20:25 +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-serv20940/src/bossa/parser

Modified Files:
	Parser.jj 
Log Message:
Optimization.


Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.323
retrieving revision 1.324
diff -C2 -d -r1.323 -r1.324
*** Parser.jj	28 Mar 2005 11:35:15 -0000	1.323
--- Parser.jj	28 Mar 2005 14:20:23 -0000	1.324
***************
*** 834,838 ****
    { res.nullness = /*absent*/3; }
  |
!   LOOKAHEAD(monotypeConstructor())
    res=monotypeConstructor()
    { res.nullness = /*absent*/3; }
--- 834,838 ----
    { res.nullness = /*absent*/3; }
  |
!   LOOKAHEAD( typeConstructorIdent() "<" )
    res=monotypeConstructor()
    { res.nullness = /*absent*/3; }
***************
*** 906,926 ****
  }
  
! Parameter formalParameter(List statements):
  {
    Monotype t;
    LocatedString id = null;
    Expression val = null;
! }
! {
! (
!   LOOKAHEAD(monotype())
!   t=monotype() [ id=ident() [ "=" val=Expression() ]]
!   { return t.createParameter(id ,val); }
! |
!   { Token first,last;
    List parts = new LinkedList();
    Expression part;
    List types = new LinkedList();
!   LocatedString ident; }
    first="("
    part = ParameterTuplePart(statements, types) { parts.add(part); }
--- 906,922 ----
  }
  
! Parameter tupleParameter(List statements):
  {
    Monotype t;
    LocatedString id = null;
    Expression val = null;
! 
!   Token first,last;
    List parts = new LinkedList();
    Expression part;
    List types = new LinkedList();
!   LocatedString ident;
! }
! {
    first="("
    part = ParameterTuplePart(statements, types) { parts.add(part); }
***************
*** 940,943 ****
--- 936,953 ----
      return t.createParameter(ident ,val);
    }
+ }
+ 
+ Parameter formalParameter(List statements):
+ {}
+ {
+ (
+   LOOKAHEAD( "(" monotype() ident() )
+   { Parameter res; }
+   res=tupleParameter(statements)
+   { return res; }
+ |
+   { Monotype t; LocatedString id = null; Expression val = null; }
+   t=monotype() [ id=ident() [ "=" val=Expression() ]]
+   { return t.createParameter(id ,val); }
  )
  }



-------------------------------------------------------
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