2 * Copyright 2007 Victor Hugo Borja <vic@rubyforge.org>
3 * 2006-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_TABCODEGEN_H
24 #define _RUBY_TABCODEGEN_H
31 #include "rubycodegen.h"
40 class RubyTabCodeGen : public RubyCodeGen
43 RubyTabCodeGen( ostream &out ) :
45 virtual ~RubyTabCodeGen() {}
48 void BREAK( ostream &ret, int targState );
49 void GOTO( ostream &ret, int gotoDest, bool inFinish );
50 void GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish );
51 void CALL( ostream &ret, int callDest, int targState, bool inFinish );
52 void CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish );
53 void RET( ostream &ret, bool inFinish );
55 void COND_TRANSLATE();
58 virtual void writeExec();
59 virtual void writeData();
62 virtual std::ostream &TO_STATE_ACTION_SWITCH();
63 virtual std::ostream &FROM_STATE_ACTION_SWITCH();
64 virtual std::ostream &EOF_ACTION_SWITCH();
65 virtual std::ostream &ACTION_SWITCH();
67 std::ostream &COND_KEYS();
68 std::ostream &COND_SPACES();
70 std::ostream &INDICIES();
71 std::ostream &COND_OFFSETS();
72 std::ostream &KEY_OFFSETS();
73 std::ostream &INDEX_OFFSETS();
74 std::ostream &COND_LENS();
75 std::ostream &SINGLE_LENS();
76 std::ostream &RANGE_LENS();
77 std::ostream &TO_STATE_ACTIONS();
78 std::ostream &FROM_STATE_ACTIONS();
79 std::ostream &EOF_ACTIONS();
80 std::ostream &EOF_TRANS();
81 std::ostream &TRANS_TARGS();
82 std::ostream &TRANS_ACTIONS();
83 std::ostream &TRANS_TARGS_WI();
84 std::ostream &TRANS_ACTIONS_WI();
87 void NEXT( ostream &ret, int nextDest, bool inFinish );
88 void NEXT_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish );
90 virtual int TO_STATE_ACTION( RedStateAp *state );
91 virtual int FROM_STATE_ACTION( RedStateAp *state );
92 virtual int EOF_ACTION( RedStateAp *state );
100 void EXEC( ostream &ret, GenInlineItem *item, int targState, int inFinish );
101 void EXECTE( ostream &ret, GenInlineItem *item, int targState, int inFinish );
102 void LM_SWITCH( ostream &ret, GenInlineItem *item, int targState, int inFinish );
103 void SET_ACT( ostream &ret, GenInlineItem *item );
104 void INIT_TOKSTART( ostream &ret, GenInlineItem *item );
105 void INIT_ACT( ostream &ret, GenInlineItem *item );
106 void SET_TOKSTART( ostream &ret, GenInlineItem *item );
107 void SET_TOKEND( ostream &ret, GenInlineItem *item );
108 void GET_TOKEND( ostream &ret, GenInlineItem *item );
109 void SUB_ACTION( ostream &ret, GenInlineItem *item,
110 int targState, bool inFinish );
121 * indent-tabs-mode: 1
122 * c-file-style: "bsd"