[Nice-commit] Nice/src/bossa/parser Parser.jj,1.300,1.301
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2005-01-12 18:51:17
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31378/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Cleanup and preparation for Monotype conversion. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.300 retrieving revision 1.301 diff -C2 -d -r1.300 -r1.301 *** Parser.jj 11 Jan 2005 21:45:45 -0000 1.300 --- Parser.jj 12 Jan 2005 18:50:32 -0000 1.301 *************** *** 694,698 **** { FunType res = bossa.syntax.dispatch.createFunType(domain, codomain); ! res.nullness = maybe ? res.maybe : res.absent; return res; } --- 694,701 ---- { FunType res = bossa.syntax.dispatch.createFunType(domain, codomain); ! if (maybe) ! res.nullness = /*maybe*/1; ! else ! res.nullness = /*absent*/3; return res; } *************** *** 710,714 **** res = new TypeIdent(new LocatedString("void",makeLocation(start, end))); ! res.nullness = res.absent; return res; } --- 713,717 ---- res = new TypeIdent(new LocatedString("void",makeLocation(start, end))); ! res.nullness = /*absent*/3; return res; } *************** *** 734,738 **** domain = new Monotype[]{ res }; res = bossa.syntax.dispatch.createFunType_(domain, codomain); ! res.nullness = maybe ? res.maybe : res.absent; } ] { return res; } --- 737,744 ---- domain = new Monotype[]{ res }; res = bossa.syntax.dispatch.createFunType_(domain, codomain); ! if (maybe) ! res.nullness = /*maybe*/1; ! else ! res.nullness = /*absent*/3; } ] { return res; } *************** *** 765,769 **** bossa.syntax.dispatch.createTypeParameters(tp), loc); ! res.nullness = maybe ? res.maybe : res.absent; } ] --- 771,778 ---- bossa.syntax.dispatch.createTypeParameters(tp), loc); ! if (maybe) ! res.nullness = /*maybe*/1; ! else ! res.nullness = /*absent*/3; } ] *************** *** 791,812 **** start="alike" [ "<" p=monotypes() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } ! { res.nullness = res.absent; } | LOOKAHEAD(monotypeConstructor()) res=monotypeConstructor() ! { res.nullness = res.absent; } | res=typeIdent() ! { res.nullness = res.absent; } ) { if ((maybe || sure) && ! (res.nullness != res.absent)) throw bossa.util.User.error (res, "Nullness is specified in two ways for " + res); if (maybe) ! res.nullness = res.maybe; else if (sure) ! res.nullness = res.sure; } { return res; } --- 800,821 ---- start="alike" [ "<" p=monotypes() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } ! { res.nullness = /*absent*/3; } | LOOKAHEAD(monotypeConstructor()) res=monotypeConstructor() ! { res.nullness = /*absent*/3; } | res=typeIdent() ! { res.nullness = /*absent*/3; } ) { if ((maybe || sure) && ! (res.nullness != /*absent*/3)) throw bossa.util.User.error (res, "Nullness is specified in two ways for " + res); if (maybe) ! res.nullness = /*maybe*/1; else if (sure) ! res.nullness = /*sure*/2; } { return res; } *************** *** 848,852 **** last=")" { Monotype t = new TupleType(types, makeLocation(first, last)); ! t.nullness = Monotype.absent; monotypes.add(t); return new TupleExp(parts); } --- 857,861 ---- last=")" { Monotype t = new TupleType(types, makeLocation(first, last)); ! t.nullness = /*absent*/3; monotypes.add(t); return new TupleExp(parts); } *************** *** 884,888 **** statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); ! t.nullness = Monotype.absent; return bossa.syntax.dispatch.createParameter(t, ident ,val); --- 893,897 ---- statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); ! t.nullness = /*absent*/3; return bossa.syntax.dispatch.createParameter(t, ident ,val); *************** *** 1208,1212 **** if (bound != null) { ! bound.nullness = Monotype.absent; atoms.add(new MonotypeLeqCst(Monotype.createVar(mv), bound)); } --- 1217,1221 ---- if (bound != null) { ! bound.nullness = /*absent*/3; atoms.add(new MonotypeLeqCst(Monotype.createVar(mv), bound)); } *************** *** 1750,1754 **** statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); ! type.nullness = Monotype.absent; return bossa.syntax.dispatch.createMonoSymbol(name, type); } --- 1759,1763 ---- statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); ! type.nullness = /*absent*/3; return bossa.syntax.dispatch.createMonoSymbol(name, type); } |