[Nice-commit] Nice/src/bossa/parser Parser.jj,1.233,1.234
Brought to you by:
bonniot
From: <bo...@pr...> - 2004-01-27 22:59:21
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26038/src/bossa/parser Modified Files: Parser.jj Log Message: Allow X <: Y <: Z in constraints. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** Parser.jj 27 Jan 2004 21:58:58 -0000 1.233 --- Parser.jj 27 Jan 2004 22:58:14 -0000 1.234 *************** *** 580,606 **** } ! AtomicConstraint atomicConstraint(): { Monotype m1,m2; TypeIdent t,i; - AtomicConstraint res; } { ( LOOKAHEAD(2) m1=monotype() "<:" m2=monotype() ! { res=new MonotypeLeqCst(m1,m2); } | t=typeConstructorIdent() ":" i=typeIdent() ! { res=new ImplementsCst(t,i); } ) - { return res; } } void atomics(List res): ! // if res is null, we just want lookahead ! { AtomicConstraint k; } { ! k=atomicConstraint() { res.add(k); } ! ( "," k=atomicConstraint() { res.add(k); } ) * } --- 580,606 ---- } ! void atomicConstraint(List list): { Monotype m1,m2; TypeIdent t,i; } { ( LOOKAHEAD(2) m1=monotype() "<:" m2=monotype() ! { list.add(new MonotypeLeqCst(m1,m2)); } ! ( "<:" { m1 = m2; } ! m2 = monotype() ! { list.add(new MonotypeLeqCst(m1,m2)); } ! )* | t=typeConstructorIdent() ":" i=typeIdent() ! { list.add(new ImplementsCst(t,i)); } ) } void atomics(List res): ! {} { ! atomicConstraint(res) ( "," atomicConstraint(res) )* } |