2 * Copyright 2005-2007 Adrian Thurston <thurston@complang.org>
5 /* This file is part of Ragel.
7 * Ragel is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * Ragel is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Ragel; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "parsedata.h"
38 public AvlTreeEl<RedActionTable>
40 RedActionTable( const ActionTable &key )
46 const ActionTable &getKey()
53 typedef AvlTree<RedActionTable, ActionTable, CmpActionTable> ActionTableMap;
64 lowKey = trans->lowKey;
65 highKey = trans->highKey;
69 NextRedTrans( TransAp *t ) {
83 XMLCodeGen( char *fsmName, ParseData *pd, FsmAp *fsm,
84 std::ostream &out, XmlParser &xmlParser );
89 void appendTrans( TransListVect &outList, Key lowKey, Key highKey, TransAp *trans );
90 void writeStateActions( StateAp *state );
91 void writeStateList();
92 void writeStateConditions( StateAp *state );
94 void writeKey( Key key );
95 void writeText( InlineItem *item );
96 void writeGoto( InlineItem *item );
97 void writeGotoExpr( InlineItem *item );
98 void writeCall( InlineItem *item );
99 void writeCallExpr( InlineItem *item );
100 void writeNext( InlineItem *item );
101 void writeNextExpr( InlineItem *item );
102 void writeEntry( InlineItem *item );
103 void writeLmSetActId( InlineItem *item );
104 void writeLmOnLast( InlineItem *item );
105 void writeLmOnNext( InlineItem *item );
106 void writeLmOnLagBehind( InlineItem *item );
109 bool writeNameInst( NameInst *nameInst );
110 void writeEntryPoints();
111 void writeConditions();
112 void writeInlineList( InlineList *inlineList );
113 void writeActionList();
114 void writeActionTableList();
115 void reduceTrans( TransAp *trans );
116 void reduceActionTables();
117 void writeTransList( StateAp *state );
118 void writeEofTrans( StateAp *state );
119 void writeTrans( Key lowKey, Key highKey, TransAp *defTrans );
120 void writeAction( Action *action );
121 void writeLmSwitch( InlineItem *item );
123 void writeActionExec( InlineItem *item );
125 void makeGenInlineList( GenInlineList *outList, InlineList *inList );
126 void makeKey( GenInlineList *outList, Key key );
127 void makeText( GenInlineList *outList, InlineItem *item );
128 void makeGoto( GenInlineList *outList, InlineItem *item );
129 void makeGotoExpr( GenInlineList *outList, InlineItem *item );
130 void makeCall( GenInlineList *outList, InlineItem *item );
131 void makeCallExpr( GenInlineList *outList, InlineItem *item );
132 void makeNext( GenInlineList *outList, InlineItem *item );
133 void makeNextExpr( GenInlineList *outList, InlineItem *item );
134 void makeEntry( GenInlineList *outList, InlineItem *item );
135 void makeLmSetActId( GenInlineList *outList, InlineItem *item );
136 void makeLmOnLast( GenInlineList *outList, InlineItem *item );
137 void makeLmOnNext( GenInlineList *outList, InlineItem *item );
138 void makeLmOnLagBehind( GenInlineList *outList, InlineItem *item );
139 void makeActionExec( GenInlineList *outList, InlineItem *item );
140 void makeLmSwitch( GenInlineList *outList, InlineItem *item );
146 XmlParser &xmlParser;
148 ActionTableMap actionTableMap;
149 int nextActionTableId;
153 #endif /* _XMLDOTGEN_H */