2 tre-parse.c - Regexp parser definitions
4 This software is released under a BSD-style license.
5 See the file LICENSE for details and copyright.
13 #include <xlocale_private.h>
16 #endif /* !__LIBC__ */
20 /* Memory allocator. The AST is allocated using this. */
22 /* Stack used for keeping track of regexp syntax. */
24 /* The parse result. */
25 tre_ast_node_t
*result
;
26 /* The regexp to parse and its length. */
28 /* The first character of the entire regexp. */
29 const tre_char_t
*re_start
;
30 /* The first character after the end of the regexp. */
31 const tre_char_t
*re_end
;
32 /* The current locale */
35 /* Current submatch ID. */
37 /* Current invisible submatch ID. */
38 int submatch_id_invisible
;
39 /* Current position (number of literal). */
41 /* The highest back reference or -1 if none seen so far. */
43 /* Number of tags that need reordering. */
45 /* This flag is set if the regexp uses approximate matching. */
47 /* Compilation flags. */
49 /* If this flag is set the top-level submatch is not captured. */
51 /* The currently set approximate matching parameters. */
52 int params
[TRE_PARAM_LAST
];
55 /* Parses a wide character regexp pattern into a syntax tree. This parser
56 handles both syntaxes (BRE and ERE), including the TRE extensions. */
57 __private_extern__ reg_errcode_t
58 tre_parse(tre_parse_ctx_t
*ctx
);
60 #endif /* TRE_PARSE_H */