2 * 2007 Victor Hugo Borja <vic@rubyforge.org>
3 * Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
6 /* This file is part of Ragel.
8 * Ragel is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * Ragel is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Ragel; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef _RUBY_FFLATCODEGEN_H
24 #define _RUBY_FFLATCODEGEN_H
27 #include "ruby-flatcodegen.h"
29 class RubyFFlatCodeGen : public RubyFlatCodeGen
32 RubyFFlatCodeGen( ostream &out ) :
33 RubyFlatCodeGen(out) {}
36 std::ostream &TO_STATE_ACTION_SWITCH();
37 std::ostream &FROM_STATE_ACTION_SWITCH();
38 std::ostream &EOF_ACTION_SWITCH();
39 std::ostream &ACTION_SWITCH();
41 void GOTO( ostream &out, int gotoDest, bool inFinish );
42 void GOTO_EXPR( ostream &out, GenInlineItem *ilItem, bool inFinish );
43 void CALL( ostream &out, int callDest, int targState, bool inFinish );
44 void CALL_EXPR(ostream &out, GenInlineItem *ilItem, int targState, bool inFinish );
45 void RET( ostream &out, bool inFinish );
46 void BREAK( ostream &out, int targState );
48 virtual int TO_STATE_ACTION( RedStateAp *state );
49 virtual int FROM_STATE_ACTION( RedStateAp *state );
50 virtual int EOF_ACTION( RedStateAp *state );
51 virtual int TRANS_ACTION( RedTransAp *trans );
53 virtual void writeData();
54 virtual void writeExec();
57 #endif /* _RUBY_FFLATCODEGEN_H */