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"
37 public AvlTreeEl<RedActionTable>
39 RedActionTable( const ActionTable &key )
45 const ActionTable &getKey()
52 typedef AvlTree<RedActionTable, ActionTable, CmpActionTable> ActionTableMap;
63 lowKey = trans->lowKey;
64 highKey = trans->highKey;
68 NextRedTrans( TransAp *t ) {
82 XMLCodeGen( char *fsmName, ParseData *pd, FsmAp *fsm,
83 std::ostream &out, XmlParser &xmlParser );
87 void appendTrans( TransListVect &outList, Key lowKey, Key highKey, TransAp *trans );
88 void writeStateActions( StateAp *state );
89 void writeStateList();
90 void writeStateConditions( StateAp *state );
92 void writeKey( Key key );
93 void writeText( InlineItem *item );
94 void writeGoto( InlineItem *item );
95 void writeGotoExpr( InlineItem *item );
96 void writeCall( InlineItem *item );
97 void writeCallExpr( InlineItem *item );
98 void writeNext( InlineItem *item );
99 void writeNextExpr( InlineItem *item );
100 void writeEntry( InlineItem *item );
101 void writeLmSetActId( InlineItem *item );
102 void writeLmOnLast( InlineItem *item );
103 void writeLmOnNext( InlineItem *item );
104 void writeLmOnLagBehind( InlineItem *item );
107 bool writeNameInst( NameInst *nameInst );
108 void writeEntryPoints();
109 void writeConditions();
110 void writeInlineList( InlineList *inlineList );
111 void writeActionList();
112 void writeActionTableList();
113 void reduceTrans( TransAp *trans );
114 void reduceActionTables();
115 void writeTransList( StateAp *state );
116 void writeEofTrans( StateAp *state );
117 void writeTrans( Key lowKey, Key highKey, TransAp *defTrans );
118 void writeAction( Action *action );
119 void writeLmSwitch( InlineItem *item );
121 void writeActionExec( InlineItem *item );
127 XmlParser &xmlParser;
129 ActionTableMap actionTableMap;
130 int nextActionTableId;
134 #endif /* _XMLDOTGEN_H */