[Nice-commit] Nice/src/bossa/parser Parser.jj,1.323,1.324
Brought to you by:
bonniot
|
From: Daniel B. <bo...@us...> - 2005-03-28 14:20:31
|
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); } ) } |