Nice/src/bossa/parser Parser.jj,1.324,1.325

Artem Gr Kozarezov <[email protected]> Sat, 02 Apr 2005 09:14:26 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23393/src/bossa/parser

Modified Files:
	Parser.jj 
Log Message:
Forced assertions (RFE 1153220) and automatic assertion message.

Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.324
retrieving revision 1.325
diff -C2 -d -r1.324 -r1.325
*** Parser.jj	28 Mar 2005 14:20:23 -0000	1.324
--- Parser.jj	2 Apr 2005 09:14:24 -0000	1.325
***************
*** 211,214 ****
--- 211,216 ----
  // Assertions
  | < ASSERT:     "assert"	>
+ | < SUREASSERT: "!assert"	> /* Nice specific */
+ | < MAYBEASSERT: "?assert"	> /* Nice specific */
  | < REQUIRE:    "requires"	>
  | < ENSURE:     "ensures"	>
***************
*** 2920,2929 ****
  }
  {
!   t = "assert"
    condition = SideEffectFreeExpression()
    ( ":" message = SideEffectFreeExpression()
      { call = bossa.syntax.dispatch.createCallExp(symb(t), condition, message); }
    |
!     { call = bossa.syntax.dispatch.createCallExp(symb(t), condition); }
    )
    { return bossa.syntax.dispatch.createExpressionStmt(call); }
--- 2922,2935 ----
  }
  {
!   ( t = <ASSERT> | t = <SUREASSERT> | t = <MAYBEASSERT> )
    condition = SideEffectFreeExpression()
    ( ":" message = SideEffectFreeExpression()
      { call = bossa.syntax.dispatch.createCallExp(symb(t), condition, message); }
    |
!     {
!       message = bossa.syntax.dispatch.createStringConstantExp(condition.toString()
!         + " failed at " + condition.location().toString().replace('\\','/'));
!       call = bossa.syntax.dispatch.createCallExp(symb(t), condition, message);
!     }
    )
    { return bossa.syntax.dispatch.createExpressionStmt(call); }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click