Thread: [Nice-commit] Nice/src/bossa/parser Parser.jj,1.252,1.253
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-08-05 10:45:38
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30128/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Converted CallExp to nice code. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.252 retrieving revision 1.253 diff -C2 -d -r1.252 -r1.253 *** Parser.jj 4 Aug 2004 18:36:06 -0000 1.252 --- Parser.jj 5 Aug 2004 10:45:29 -0000 1.253 *************** *** 1950,1954 **** { if(op.image.length()!=1) ! e2=CallExp.create(symb(op.image.substring(0, 1),op),e1,e2); e1=bossa.syntax.dispatch.createAssignExp(e1,e2); --- 1950,1954 ---- { if(op.image.length()!=1) ! e2=bossa.syntax.dispatch.createCallExp(symb(op.image.substring(0, 1),op),e1,e2); e1=bossa.syntax.dispatch.createAssignExp(e1,e2); *************** *** 2010,2014 **** e1=ConditionalAndExpression() ( t="||" e2=ConditionalOrExpression() ! { e1=CallExp.create(symb(t), e1, e2); } )? { return e1; } } --- 2010,2014 ---- e1=ConditionalAndExpression() ( t="||" e2=ConditionalOrExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t), e1, e2); } )? { return e1; } } *************** *** 2019,2023 **** e1=InclusiveOrExpression() ( t="&&" e2=ConditionalAndExpression() ! { e1=CallExp.create(symb(t), e1, e2); } )? { return e1; } } --- 2019,2023 ---- e1=InclusiveOrExpression() ( t="&&" e2=ConditionalAndExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t), e1, e2); } )? { return e1; } } *************** *** 2028,2032 **** e1=ExclusiveOrExpression() ( t="|" e2=ExclusiveOrExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } } --- 2028,2032 ---- e1=ExclusiveOrExpression() ( t="|" e2=ExclusiveOrExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } } *************** *** 2037,2041 **** e1=AndExpression() ( t="^" e2=AndExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } } --- 2037,2041 ---- e1=AndExpression() ( t="^" e2=AndExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } } *************** *** 2046,2050 **** e1=EqualityExpression() ( t="&" e2=EqualityExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } } --- 2046,2050 ---- e1=EqualityExpression() ( t="&" e2=EqualityExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } } *************** *** 2055,2059 **** e1=InstanceOfExpression() ( ( t="==" | t="!=" ) e2=InstanceOfExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } --- 2055,2059 ---- e1=InstanceOfExpression() ( ( t="==" | t="!=" ) e2=InstanceOfExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } *************** *** 2066,2070 **** [ { Token t; TypeConstantExp type; } t="instanceof" type=typeExpression() ! { type.isLiteral = true; return CallExp.create(symb(t), res, type); } ] { return res; } --- 2066,2070 ---- [ { Token t; TypeConstantExp type; } t="instanceof" type=typeExpression() ! { type.isLiteral = true; return bossa.syntax.dispatch.createCallExp(symb(t), res, type); } ] { return res; } *************** *** 2077,2084 **** ( (t=">"|t=">="|t="<"|t="<=") e2=RangeExpression() { ! if(e3 == null) e1=CallExp.create(symb(t),e1,e2); else { ! e1=CallExp.create(symb("&&",t),e1,CallExp.create(symb(t),e3,e2)); if (t.image.charAt(0) != t_prev.image.charAt(0)) User.error(makeLocation(t), "All chained comparisons should be in the same direction"); --- 2077,2084 ---- ( (t=">"|t=">="|t="<"|t="<=") e2=RangeExpression() { ! if(e3 == null) e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); else { ! e1=bossa.syntax.dispatch.createCallExp(symb("&&",t),e1,bossa.syntax.dispatch.createCallExp(symb(t),e3,e2)); if (t.image.charAt(0) != t_prev.image.charAt(0)) User.error(makeLocation(t), "All chained comparisons should be in the same direction"); *************** *** 2096,2100 **** e1=ShiftExpression() ( t=".." e2=ShiftExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } --- 2096,2100 ---- e1=ShiftExpression() ( t=".." e2=ShiftExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } *************** *** 2117,2121 **** else func = t1==null ? ">>" : ">>>"; ! e1=CallExp.create(symb(func,t),e1,e2); } )* { return e1; } --- 2117,2121 ---- else func = t1==null ? ">>" : ">>>"; ! e1=bossa.syntax.dispatch.createCallExp(symb(func,t),e1,e2); } )* { return e1; } *************** *** 2127,2131 **** e1=MultiplicativeExpression() ( ( t="+" | t="-" ) e2=MultiplicativeExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } --- 2127,2131 ---- e1=MultiplicativeExpression() ( ( t="+" | t="-" ) e2=MultiplicativeExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } *************** *** 2137,2141 **** e1=ExponentialExpression() ( (t="*"|t="/"|t="%") e2=ExponentialExpression() ! { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } --- 2137,2141 ---- e1=ExponentialExpression() ( (t="*"|t="/"|t="%") e2=ExponentialExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } )* { return e1; } *************** *** 2149,2153 **** // '**' has right associativity [ t="**" e2=ExponentialExpression() ! { e1=CallExp.create(symb(t),e1,e2); } ] { return e1; } --- 2149,2153 ---- // '**' has right associativity [ t="**" e2=ExponentialExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } ] { return e1; } *************** *** 2159,2163 **** ( ( ( t="~" | t="!" ) res=PrimaryExpression() ! { res=CallExp.create(symb(t),res); } | ( t="+" | t="-" ) res=PrimaryExpression() --- 2159,2163 ---- ( ( ( t="~" | t="!" ) res=PrimaryExpression() ! { res=bossa.syntax.dispatch.createCallExp(symb(t),res); } | ( t="+" | t="-" ) res=PrimaryExpression() *************** *** 2168,2172 **** } else ! res=CallExp.create(symb(t),res); } ) --- 2168,2172 ---- } else ! res=bossa.syntax.dispatch.createCallExp(symb(t),res); } ) *************** *** 2239,2243 **** { Token t; } t="[" res=Expression() "]" ! { return CallExp.create(symb("get",t,false),start,res); } | "." res=identExp() --- 2239,2243 ---- { Token t; } t="[" res=Expression() "]" ! { return bossa.syntax.dispatch.createCallExp(symb("get",t,false),start,res); } | "." res=identExp() *************** *** 2255,2263 **** else args.addReceiver(start); ! return new CallExp(res, args, true, hasBrackets); } | args = arguments(false) ! { return new CallExp(start, args); } } --- 2255,2263 ---- else args.addReceiver(start); ! return bossa.syntax.dispatch.createCallExp(res, args, true, hasBrackets); } | args = arguments(false) ! { return bossa.syntax.dispatch.createCallExp(start, args); } } *************** *** 2284,2290 **** | res=stringConstantExp() ( {Expression e;} e=StringLiteralSuffixExpression() ! { res = CallExp.create(symb("+", e.location()), res, e); } [ e=stringConstantExp() ! { res = CallExp.create(symb("+", e.location()), res, e); } ] )* --- 2284,2290 ---- | res=stringConstantExp() ( {Expression e;} e=StringLiteralSuffixExpression() ! { res = bossa.syntax.dispatch.createCallExp(symb("+", e.location()), res, e); } [ e=stringConstantExp() ! { res = bossa.syntax.dispatch.createCallExp(symb("+", e.location()), res, e); } ] )* *************** *** 2580,2584 **** block=Block() { if ( exp instanceof CallExp && ((CallExp)exp).hasBrackets && ! (exp instanceof NewExp) ) ! ((CallExp)exp).addBlockArgument(block, null); else throw bossa.util.User.error(exp,"Block arguments can only be added to normal function calls"); --- 2580,2584 ---- block=Block() { if ( exp instanceof CallExp && ((CallExp)exp).hasBrackets && ! (exp instanceof NewExp) ) ! bossa.syntax.dispatch.addBlockArgument(exp,block, null); else throw bossa.util.User.error(exp,"Block arguments can only be added to normal function calls"); *************** *** 2665,2669 **** { if(op.image.length()!=1) ! e2=CallExp.create(symb(op.image.substring(0, 1),op),e1,e2); e1=bossa.syntax.dispatch.createAssignExp(e1,e2); --- 2665,2669 ---- { if(op.image.length()!=1) ! e2=bossa.syntax.dispatch.createCallExp(symb(op.image.substring(0, 1),op),e1,e2); e1=bossa.syntax.dispatch.createAssignExp(e1,e2); *************** *** 2810,2814 **** { t="throw" e=Expression() ! { return new ExpressionStmt(CallExp.create(symb(t),e)); } } --- 2810,2814 ---- { t="throw" e=Expression() ! { return new ExpressionStmt(bossa.syntax.dispatch.createCallExp(symb(t),e)); } } *************** *** 2836,2840 **** Token t; Expression condition, message; ! CallExp call; } { --- 2836,2840 ---- Token t; Expression condition, message; ! Expression call; } { *************** *** 2842,2848 **** condition = SideEffectFreeExpression() ( ":" message = SideEffectFreeExpression() ! { call = CallExp.create(symb(t), condition, message); } | ! { call = CallExp.create(symb(t), condition); } ) { return new ExpressionStmt(call); } --- 2842,2848 ---- condition = SideEffectFreeExpression() ( ":" message = SideEffectFreeExpression() ! { call = bossa.syntax.dispatch.createCallExp(symb(t), condition, message); } | ! { call = bossa.syntax.dispatch.createCallExp(symb(t), condition); } ) { return new ExpressionStmt(call); } |