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