"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/goto.cc" between
ragel-7.0.0.9.tar.gz and ragel-7.0.0.10.tar.gz

About:

goto.cc  (ragel-7.0.0.9):goto.cc  (ragel-7.0.0.10)
/* /*
* Copyright 2001-2014 Adrian Thurston <thurston@complang.org> * Copyright 2001-2014 Adrian Thurston <thurston@colm.net>
*/
/* This file is part of Ragel.
* *
* Ragel is free software; you can redistribute it and/or modify * Permission is hereby granted, free of charge, to any person obtaining a copy
* it under the terms of the GNU General Public License as published by * of this software and associated documentation files (the "Software"), to
* the Free Software Foundation; either version 2 of the License, or * deal in the Software without restriction, including without limitation the
* (at your option) any later version. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* Ragel is distributed in the hope that it will be useful, * The above copyright notice and this permission notice shall be included in al
* but WITHOUT ANY WARRANTY; without even the implied warranty of l
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * copies or substantial portions of the Software.
* GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* along with Ragel; if not, write to the Free Software * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/ */
#include "ragel.h" #include "ragel.h"
#include "goto.h" #include "goto.h"
#include "redfsm.h" #include "redfsm.h"
#include "bstmap.h" #include "bstmap.h"
#include "gendata.h" #include "gendata.h"
#include <sstream> #include <sstream>
skipping to change at line 743 skipping to change at line 744
for ( RedNfaTargs::Iter targ = *st->nfaTargs; targ.lte(); targ++ ) for ( RedNfaTargs::Iter targ = *st->nfaTargs; targ.lte(); targ++ )
NFA_POP_TEST( targ ); NFA_POP_TEST( targ );
} }
} }
nfaPopTrans.finish(); nfaPopTrans.finish();
} }
void Goto::GOTO( ostream &ret, int gotoDest, bool inFinish ) void Goto::GOTO( ostream &ret, int gotoDest, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK() << vCS() << " = " << gotoDest << "; " << ret << OPEN_GEN_BLOCK() << vCS() << " = " << gotoDest << "; ";
"goto _again;" << CLOSE_GEN_BLOCK();
if ( inFinish && !noEnd )
EOF_CHECK( ret );
ret << "goto _again;";
ret << CLOSE_GEN_BLOCK();
} }
void Goto::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) void Goto::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK() << vCS() << " = " << OPEN_HOST_EXPR(); ret << OPEN_GEN_BLOCK() << vCS() << " = " << OPEN_HOST_EXPR();
INLINE_LIST( ret, ilItem->children, 0, inFinish, false ); INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << CLOSE_HOST_EXPR() << "; " << "goto _again;" << CLOSE_GEN_BLOCK(); ret << CLOSE_HOST_EXPR() << ";";
if ( inFinish && !noEnd )
EOF_CHECK( ret );
ret << " goto _again;";
ret << CLOSE_GEN_BLOCK();
} }
void Goto::CURS( ostream &ret, bool inFinish ) void Goto::CURS( ostream &ret, bool inFinish )
{ {
ret << "(_ps)"; ret << "(_ps)";
} }
void Goto::TARGS( ostream &ret, bool inFinish, int targState ) void Goto::TARGS( ostream &ret, bool inFinish, int targState )
{ {
ret << "(" << vCS() << ")"; ret << "(" << vCS() << ")";
skipping to change at line 788 skipping to change at line 802
ret << OPEN_GEN_BLOCK(); ret << OPEN_GEN_BLOCK();
if ( red->prePushExpr != 0 ) { if ( red->prePushExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->prePushExpr ); ret << OPEN_HOST_BLOCK( red->prePushExpr );
INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ;
ret << CLOSE_HOST_BLOCK(); ret << CLOSE_HOST_BLOCK();
} }
ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " <<
TOP() << " += 1;" << vCS() << " = " << TOP() << " += 1;" << vCS() << " = " <<
callDest << "; " << "goto _again;" << CLOSE_GEN_BLOCK(); callDest << ";";
if ( inFinish && !noEnd )
EOF_CHECK( ret );
ret << " goto _again;";
ret << CLOSE_GEN_BLOCK();
} }
void Goto::NCALL( ostream &ret, int callDest, int targState, bool inFinish ) void Goto::NCALL( ostream &ret, int callDest, int targState, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK(); ret << OPEN_GEN_BLOCK();
if ( red->prePushExpr != 0 ) { if ( red->prePushExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->prePushExpr ); ret << OPEN_HOST_BLOCK( red->prePushExpr );
INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ;
ret << CLOSE_HOST_BLOCK(); ret << CLOSE_HOST_BLOCK();
skipping to change at line 819 skipping to change at line 840
if ( red->prePushExpr != 0 ) { if ( red->prePushExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->prePushExpr ); ret << OPEN_HOST_BLOCK( red->prePushExpr );
INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ;
ret << CLOSE_HOST_BLOCK(); ret << CLOSE_HOST_BLOCK();
} }
ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << TOP() << " += 1;" << ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << TOP() << " += 1;" <<
vCS() << " = " << OPEN_HOST_EXPR(); vCS() << " = " << OPEN_HOST_EXPR();
INLINE_LIST( ret, ilItem->children, targState, inFinish, false ); INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << CLOSE_HOST_EXPR() << "; goto _again;" << CLOSE_GEN_BLOCK(); ret << CLOSE_HOST_EXPR() << ";";
if ( inFinish && !noEnd )
EOF_CHECK( ret );
ret << " goto _again;";
ret << CLOSE_GEN_BLOCK();
} }
void Goto::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) void Goto::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK(); ret << OPEN_GEN_BLOCK();
if ( red->prePushExpr != 0 ) { if ( red->prePushExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->prePushExpr ); ret << OPEN_HOST_BLOCK( red->prePushExpr );
INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->prePushExpr->inlineList, 0, false, false ) ;
ret << CLOSE_HOST_BLOCK(); ret << CLOSE_HOST_BLOCK();
skipping to change at line 848 skipping to change at line 876
void Goto::RET( ostream &ret, bool inFinish ) void Goto::RET( ostream &ret, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK() << TOP() << "-= 1;" << vCS() << " = " << STACK() << "[" << TOP() << "];"; ret << OPEN_GEN_BLOCK() << TOP() << "-= 1;" << vCS() << " = " << STACK() << "[" << TOP() << "];";
if ( red->postPopExpr != 0 ) { if ( red->postPopExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->postPopExpr ); ret << OPEN_HOST_BLOCK( red->postPopExpr );
INLINE_LIST( ret, red->postPopExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->postPopExpr->inlineList, 0, false, false ) ;
ret << CLOSE_HOST_BLOCK(); ret << CLOSE_HOST_BLOCK();
} }
if ( inFinish && !noEnd )
EOF_CHECK( ret );
ret << "goto _again;" << CLOSE_GEN_BLOCK(); ret << "goto _again;" << CLOSE_GEN_BLOCK();
} }
void Goto::NRET( ostream &ret, bool inFinish ) void Goto::NRET( ostream &ret, bool inFinish )
{ {
ret << OPEN_GEN_BLOCK() << TOP() << "-= 1;" << vCS() << " = " << STACK() << "[" << TOP() << "];"; ret << OPEN_GEN_BLOCK() << TOP() << "-= 1;" << vCS() << " = " << STACK() << "[" << TOP() << "];";
if ( red->postPopExpr != 0 ) { if ( red->postPopExpr != 0 ) {
ret << OPEN_HOST_BLOCK( red->postPopExpr ); ret << OPEN_HOST_BLOCK( red->postPopExpr );
INLINE_LIST( ret, red->postPopExpr->inlineList, 0, false, false ) ; INLINE_LIST( ret, red->postPopExpr->inlineList, 0, false, false ) ;
 End of changes. 9 change blocks. 
20 lines changed or deleted 52 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS