2 * Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
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
25 #include "rlcodegen.h"
47 struct LmSwitchAction;
49 //#include "xmlpdefs.h"
51 /* These come from the scanner and point back into the parser. We will borrow
52 * them for error reporting. */
53 //extern YYSTYPE *yylval;
54 //extern YYLTYPE *yylloc;
56 //int yylex( YYSTYPE *, YYLTYPE *);
59 extern char *lelNames[];
68 token TAG_unknown, TAG_ragel, TAG_ragel_def, TAG_host, TAG_state_list,
69 TAG_state, TAG_trans_list, TAG_t, TAG_machine, TAG_start_state,
70 TAG_action_list, TAG_action_table_list, TAG_action,
71 TAG_action_table, TAG_alphtype, TAG_element, TAG_getkey,
72 TAG_state_actions, TAG_entry_points, TAG_sub_action,
73 TAG_cond_space_list, TAG_cond_space, TAG_cond_list, TAG_c;
75 # Inline block tokens.
76 token TAG_text, TAG_goto, TAG_call, TAG_next, TAG_goto_expr,
77 TAG_call_expr, TAG_next_expr, TAG_ret, TAG_pchar, TAG_char,
78 TAG_hold, TAG_exec, TAG_holdte, TAG_execte, TAG_curs, TAG_targs,
79 TAG_entry, TAG_data, TAG_lm_switch, TAG_init_act, TAG_set_act,
80 TAG_set_tokend, TAG_get_tokend, TAG_init_tokstart,
81 TAG_set_tokstart, TAG_write, TAG_curstate, TAG_access, TAG_break,
87 Parser( char *fileName )
88 : fileName(fileName), sourceFileName(0)
90 //pd = new ParseData( fileName, sectionName, sectionLoc );
94 int token( int tokenId, Token &token );
95 int token( XMLTag *tag, int col, int line );
97 /* Report an error encountered by the parser. */
99 ostream &error( const InputLoc &loc );
100 ostream &parser_error( int tokId, Token &token );
102 /* The name of the root section, this does not change during an include. */
105 /* Collected during parsing. */
106 char *sourceFileName;
116 CodeGenMap codeGenMap;
119 #endif /* _XMLPARSE_H */