[Nice-commit] Nice/src/bossa/parser Parser.jj,1.253,1.254
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-08-07 14:20:36
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27902/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Split up Pattern.java in subclasses and converted the subclasses to nice code. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.253 retrieving revision 1.254 diff -C2 -d -r1.253 -r1.254 *** Parser.jj 5 Aug 2004 10:45:29 -0000 1.253 --- Parser.jj 7 Aug 2004 14:20:28 -0000 1.254 *************** *** 1275,1281 **** TypeConstructor runtimeTC = null; ConstantExp val = null; ! boolean exactlyAt = false; ! int kind = Pattern.NONE; ! Location loc = null; } { --- 1275,1279 ---- TypeConstructor runtimeTC = null; ConstantExp val = null; ! Token t; } { *************** *** 1289,1305 **** ] name=ident() ! { loc = tc.location(); } | "#" tc=typeIdent() [ "(" additional=typeIdent() ")" ] [ name=ident() ] ! {exactlyAt = true; loc = tc.location();} | ( ! val=patternLiteral() { loc = val.location(); } | "@" tc=typeIdent() ! { loc = tc.location(); ! User.warning(loc, "This syntax is deprecated, use 'Type paramName' instead."); } | --- 1287,1306 ---- ] name=ident() ! { return bossa.syntax.dispatch.createPattern(tc, name, false, additional, runtimeTC); } | "#" tc=typeIdent() [ "(" additional=typeIdent() ")" ] [ name=ident() ] ! { return bossa.syntax.dispatch.createPattern(tc, name, true, additional, null); } | ( ! val=patternLiteral() ! [ "(" additional=typeIdent() ")" ] ! { return bossa.syntax.dispatch.createPattern(val, additional);} | "@" tc=typeIdent() ! [ "(" additional=typeIdent() ")" ] ! { User.warning(tc.location(), "This syntax is deprecated, use 'Type paramName' instead."); ! return bossa.syntax.dispatch.createPattern(tc, null, false, additional, null); } | *************** *** 1309,1337 **** tc=typeIdent() [ ":" runtimeTC=typeConstructor() ] | "#" tc=typeIdent() ! { exactlyAt = true; ! User.warning(name.location(), "This syntax is deprecated, use '#Type paramName' instead."); } | ! ( ">" {kind = Pattern.GT;} ! | ">=" {kind = Pattern.GE;} ! | "<" {kind = Pattern.LT;} ! | "<=" {kind = Pattern.LE;} ! ) ( val=negativeIntConstantExp() | val=intConstantExp() | refName=ident() ) | ! {} //name only ) - { loc = name.location(); } ) - [ "(" additional=typeIdent() ")" ] ) - { - return new Pattern(name, tc, val, refName, exactlyAt, kind, additional, runtimeTC, loc); - } } --- 1310,1333 ---- tc=typeIdent() [ ":" runtimeTC=typeConstructor() ] + [ "(" additional=typeIdent() ")" ] + { return bossa.syntax.dispatch.createPattern(tc, name, false, additional, runtimeTC); } | "#" tc=typeIdent() ! [ "(" additional=typeIdent() ")" ] ! { User.warning(name.location(), "This syntax is deprecated, use '#Type paramName' instead."); ! return bossa.syntax.dispatch.createPattern(tc, name, true, additional, null); } | ! ( t=">" | t=">=" | t="<" | t="<=" ) ( val=negativeIntConstantExp() | val=intConstantExp() | refName=ident() ) + { return bossa.syntax.dispatch.createPattern(t.toString(), name, val, refName, name.location()); } | ! { return bossa.syntax.dispatch.createPattern(name); } //name only ) ) ) } |