[Nice-commit] Nice/src/bossa/parser Parser.jj,1.257,1.258
Brought to you by:
bonniot
From: Bryn K. <xo...@us...> - 2004-08-13 06:24:48
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24699/src/bossa/parser Modified Files: Parser.jj Log Message: Added new [] overloads for lists - slicing, relative-to-end indexing, filters, etc. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.257 retrieving revision 1.258 diff -C2 -d -r1.257 -r1.258 *** Parser.jj 12 Aug 2004 23:21:42 -0000 1.257 --- Parser.jj 13 Aug 2004 06:24:39 -0000 1.258 *************** *** 1366,1370 **** { Expression exp; } "=" ! ( ".." "." { return null; } // toplevel function in interface file | exp=Expression() ";" { code = bossa.syntax.dispatch.createReturnStmt(exp, /* fake */ true); } --- 1366,1370 ---- { Expression exp; } "=" ! ( "..." { return null; } // toplevel function in interface file | exp=Expression() ";" { code = bossa.syntax.dispatch.createReturnStmt(exp, /* fake */ true); } *************** *** 2106,2119 **** Expression RangeExpression() : ! { Expression e1,e2; Token t; } { ! e1=ShiftExpression() ! ( t=".." e2=ShiftExpression() ! { e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } ! )* { return e1; } } - Expression ShiftExpression() : { Expression e1,e2; Token t,t1=null; boolean left=false; } --- 2106,2130 ---- Expression RangeExpression() : ! { Expression e1 = null,e2 = null; Token t = null; } { ! ((e1=ShiftExpression() ! [(t=<RANGE>) [e2=ShiftExpression()]]) ! | ! ((t = <RANGE>) [e2 = ShiftExpression()])) ! { ! if (t != null) ! { ! if (e1 == null) ! e1 = ConstantExp.makeNumber( ! new LocatedString("0", makeLocation(t))); ! if (e2 == null) ! e2 = NullExp.create(makeLocation(t)); ! e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); ! } ! } ! { return e1; } } Expression ShiftExpression() : { Expression e1,e2; Token t,t1=null; boolean left=false; } *************** *** 2245,2248 **** --- 2256,2260 ---- } + Expression PrimarySuffix(Expression start) : { *************** *** 2304,2311 **** --- 2316,2334 ---- )* | res=multiLineStringExp() + | res=atExpression() ) { return res; } } + Expression atExpression() : + { + Token t; + } + { + (t = <AT>) + { return bossa.syntax.dispatch.createCallExp(symb(t), Arguments.noArguments()); } + } + + ConstantExp patternLiteral() : //restricted literal for use in dispatch patterns |