2
tre-parse.c - Regexp parser definitions
4
Copyright (c) 2001-2006 Ville Laurikari <vl@iki.fi>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
/* Memory allocator. The AST is allocated using this. */
29
/* Stack used for keeping track of regexp syntax. */
31
/* The parse result. */
32
tre_ast_node_t *result;
33
/* The regexp to parse and its length. */
35
/* The first character of the entire regexp. */
36
const tre_char_t *re_start;
37
/* The first character after the end of the regexp. */
38
const tre_char_t *re_end;
40
/* Current submatch ID. */
42
/* Current position (number of literal). */
44
/* The highest back reference or -1 if none seen so far. */
46
/* This flag is set if the regexp uses approximate matching. */
48
/* Compilation flags. */
50
/* If this flag is set the top-level submatch is not captured. */
52
/* The currently set approximate matching parameters. */
53
int params[TRE_PARAM_LAST];
56
/* Parses a wide character regexp pattern into a syntax tree. This parser
57
handles both syntaxes (BRE and ERE), including the TRE extensions. */
59
tre_parse(tre_parse_ctx_t *ctx);
61
#endif /* TRE_PARSE_H */