Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
parser
src
Teuchos_regex.hpp
1
#ifndef TEUCHOS_REGEX_HPP
2
#define TEUCHOS_REGEX_HPP
3
4
#include <
Teuchos_Language.hpp
>
5
#include <Teuchos_FiniteAutomaton.hpp>
6
#include <
Teuchos_ReaderTables.hpp
>
7
#include <
Teuchos_Reader.hpp
>
8
9
namespace
Teuchos
{
10
namespace
regex {
11
12
enum
{
13
PROD_REGEX,
14
PROD_UNION_DECAY,
15
PROD_UNION,
16
PROD_CONCAT_DECAY,
17
PROD_CONCAT,
18
PROD_QUAL_DECAY,
19
PROD_STAR,
20
PROD_PLUS,
21
PROD_MAYBE,
22
PROD_SINGLE_CHAR,
23
PROD_ANY,
24
PROD_SINGLE_SET,
25
PROD_PARENS_UNION,
26
PROD_SET_POSITIVE,
27
PROD_SET_NEGATIVE,
28
PROD_POSITIVE_SET,
29
PROD_NEGATIVE_SET,
30
PROD_SET_ITEMS_DECAY,
31
PROD_SET_ITEMS_ADD,
32
PROD_SET_ITEM_CHAR,
33
PROD_SET_ITEM_RANGE,
34
PROD_RANGE
35
};
36
37
enum
{ NPRODS = PROD_RANGE + 1 };
38
39
enum
{
40
TOK_CHAR,
41
TOK_DOT,
42
TOK_LRANGE,
43
TOK_RRANGE,
44
TOK_LPAREN,
45
TOK_RPAREN,
46
TOK_UNION,
47
TOK_RANGE,
48
TOK_NEGATE,
49
TOK_STAR,
50
TOK_PLUS,
51
TOK_MAYBE
52
};
53
54
enum
{ NTOKS = TOK_MAYBE + 1 };
55
56
Language make_language();
57
LanguagePtr
ask_language();
58
59
void
make_lexer(FiniteAutomaton& result);
60
61
ReaderTablesPtr
ask_reader_tables();
62
63
void
make_dfa(FiniteAutomaton& result, std::string
const
& name, std::string
const
& regex,
int
token);
64
65
class
Reader :
public
Teuchos::Reader {
66
public
:
67
Reader(
int
result_token_in);
68
virtual
~Reader
() {}
69
protected
:
70
virtual
void
at_shift(any& result,
int
token, std::string& text);
71
virtual
void
at_reduce(any& result,
int
token, std::vector<any>& rhs);
72
private
:
73
int
result_token;
74
};
75
76
}
// end namespace regex
77
}
// end namespace Teuchos
78
79
#endif
Teuchos_Language.hpp
Declares Teuchos::Language.
Teuchos_ReaderTables.hpp
Declares Teuchos::ReaderTables.
Teuchos_Reader.hpp
Declares Teuchos::Reader.
Teuchos::Reader::~Reader
virtual ~Reader()
Virtual destructor, allows polymorphism.
Definition
Teuchos_Reader.hpp:89
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Teuchos::ReaderTablesPtr
RCP< const ReaderTables > ReaderTablesPtr
an RCP to a const ReaderTables
Definition
Teuchos_ReaderTables.hpp:72
Teuchos::LanguagePtr
RCP< const Language > LanguagePtr
an RCP to a const Language
Definition
Teuchos_Language.hpp:180
Generated by
1.17.0