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 extern char *lelNames[];
58 token TAG_unknown, TAG_ragel, TAG_ragel_def, TAG_host, TAG_state_list,
59 TAG_state, TAG_trans_list, TAG_t, TAG_machine, TAG_start_state,
60 TAG_action_list, TAG_action_table_list, TAG_action,
61 TAG_action_table, TAG_alphtype, TAG_element, TAG_getkey,
62 TAG_state_actions, TAG_entry_points, TAG_sub_action,
63 TAG_cond_space_list, TAG_cond_space, TAG_cond_list, TAG_c;
65 # Inline block tokens.
66 token TAG_text, TAG_goto, TAG_call, TAG_next, TAG_goto_expr,
67 TAG_call_expr, TAG_next_expr, TAG_ret, TAG_pchar, TAG_char,
68 TAG_hold, TAG_exec, TAG_holdte, TAG_execte, TAG_curs, TAG_targs,
69 TAG_entry, TAG_data, TAG_lm_switch, TAG_init_act, TAG_set_act,
70 TAG_set_tokend, TAG_get_tokend, TAG_init_tokstart,
71 TAG_set_tokstart, TAG_write, TAG_curstate, TAG_access, TAG_break,
75 %%{ write instance_data; }%%
78 int parseLangEl( int type, const Token *token );
80 Parser( char *fileName )
81 : fileName(fileName), sourceFileName(0) { }
83 int token( int tokenId, Token &token );
84 int token( int tokenId, int col, int line );
85 int token( XMLTag *tag, int col, int line );
87 /* Report an error encountered by the parser. */
88 ostream &warning( const InputLoc &loc );
90 ostream &error( const InputLoc &loc );
91 ostream &parser_error( int tokId, Token &token );
93 /* The name of the root section, this does not change during an include. */
96 /* Collected during parsing. */
107 CodeGenMap codeGenMap;
110 %%{ write token_defs; }%%
112 #endif /* _XMLPARSE_H */