"Fossies" - the Fresh Open Source Software Archive  

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

About:

binary.cc  (ragel-7.0.0.9):binary.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 "binary.h" #include "binary.h"
#include "redfsm.h" #include "redfsm.h"
#include "gendata.h" #include "gendata.h"
#include <assert.h> #include <assert.h>
Binary::Binary( const CodeGenArgs &args ) Binary::Binary( const CodeGenArgs &args )
skipping to change at line 941 skipping to change at line 942
" }\n" " }\n"
" }\n" " }\n"
" " << vCS() << " = " << ERROR_STATE() << ";\n" " " << vCS() << " = " << ERROR_STATE() << ";\n"
" goto _again;\n" " goto _again;\n"
" }\n" " }\n"
; ;
} }
void Binary::GOTO( ostream &ret, int gotoDest, bool inFinish ) void Binary::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;" << CLOSE_GEN_BLOCK();
} }
void Binary::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) void Binary::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 Binary::CURS( ostream &ret, bool inFinish ) void Binary::CURS( ostream &ret, bool inFinish )
{ {
ret << OPEN_GEN_EXPR() << "_ps" << CLOSE_GEN_EXPR(); ret << OPEN_GEN_EXPR() << "_ps" << CLOSE_GEN_EXPR();
} }
void Binary::TARGS( ostream &ret, bool inFinish, int targState ) void Binary::TARGS( ostream &ret, bool inFinish, int targState )
{ {
ret << OPEN_GEN_EXPR() << vCS() << CLOSE_GEN_EXPR(); ret << OPEN_GEN_EXPR() << vCS() << CLOSE_GEN_EXPR();
skipping to change at line 986 skipping to change at line 998
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() << "] = " << ret << STACK() << "[" << TOP() << "] = " <<
vCS() << "; " << TOP() << " += 1;" << vCS() << " = " << 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 Binary::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) void Binary::CALL_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();
} }
ret << STACK() << "[" << TOP() << "] = " << ret << STACK() << "[" << TOP() << "] = " <<
vCS() << "; " << TOP() << " += 1;" << vCS() << vCS() << "; " << TOP() << " += 1;" << vCS() <<
" = " << OPEN_HOST_EXPR(); " = " << 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 Binary::NCALL( ostream &ret, int callDest, int targState, bool inFinish ) void Binary::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 1048 skipping to change at line 1074
void Binary::RET( ostream &ret, bool inFinish ) void Binary::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 Binary::NRET( ostream &ret, bool inFinish ) void Binary::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 50 lines changed or added

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