NEST  2.6.0,not_revisioned_source_dir@0
sliregexp.h
Go to the documentation of this file.
1 /*
2  * sliregexp.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SLIREGEXP_H
24 #define SLIREGEXP_H
25 /*
26  SLI's array access functions
27 */
28 #include "slimodule.h"
29 #include "slifunction.h"
30 #include "lockptrdatum.h"
31 
32 #include <sys/types.h>
33 #include <regex.h>
34 
35 class Regex
36 {
37  regex_t r;
38 
39  public:
40  Regex();
41  ~Regex();
42  regex_t* get(void);
43 };
44 
45 class RegexpModule: public SLIModule
46 {
48  {
49  public:
50  void execute(SLIInterpreter *) const;
51  };
53  {
54  public:
55  void execute(SLIInterpreter *) const;
56  };
58  {
59  public:
60  void execute(SLIInterpreter *) const;
61  };
62 
63  public:
64 
68 
70 
89 
91 
92  RegexpModule(void):
93  regexdict_name("regexdict"),
94  REG_NOTBOL_name("REG_NOTBOL"),
95  REG_NOTEOL_name("REG_NOTEOL"),
96  REG_ESPACE_name("REG_ESPACE"),
97  REG_BADPAT_name("REG_BADPAT"),
98  REG_EXTENDED_name("REG_EXTENDED"),
99  REG_ICASE_name("REG_ICASE"),
100  REG_NOSUB_name("REG_NOSUB"),
101  REG_NEWLINE_name("REG_NEWLINE"),
102  REG_ECOLLATE_name("REG_ECOLLATE"),
103  REG_ECTYPE_name("REG_ECTYPE"),
104  REG_EESCAPE_name("REG_EESCAPE"),
105  REG_ESUBREG_name("REG_ESUBREG"),
106  REG_EBRACK_name("REG_EBRACK"),
107  REG_EPAREN_name("REG_EPAREN"),
108  REG_EBRACE_name("REG_EBRACE"),
109  REG_BADBR_name("REG_BADBR"),
110  REG_ERANGE_name("REG_ERANGE"),
111  REG_BADRPT_name("REG_BADRPT")
112  {}
113 
114  ~RegexpModule();
115 
116  void init(SLIInterpreter *);
117  const std::string name(void) const;
118  const std::string commandstring(void) const;
119 };
120 
121 #endif
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
const Name REG_ICASE_name
Definition: sliregexp.h:76
static SLIType RegexType
Definition: sliregexp.h:90
const Name REG_BADPAT_name
Definition: sliregexp.h:74
Definition: sliregexp.h:45
RegexecFunction regexecfunction
Definition: sliregexp.h:66
const Name REG_EPAREN_name
Definition: sliregexp.h:84
regex_t r
Definition: sliregexp.h:37
const Name REG_EBRACK_name
Definition: sliregexp.h:83
const Name REG_ECTYPE_name
Definition: sliregexp.h:80
const Name REG_NOTEOL_name
Definition: sliregexp.h:72
Definition: slifunction.h:35
void execute(SLIInterpreter *) const
Definition: sliregexp.cc:102
const Name REG_BADBR_name
Definition: sliregexp.h:86
const Name REG_EBRACE_name
Definition: sliregexp.h:85
Represent strings by ints to facilitate fast comparison.
Definition: name.h:53
const Name REG_ESUBREG_name
Definition: sliregexp.h:82
Definition: sliregexp.h:35
RegcompFunction regcompfunction
Definition: sliregexp.h:65
void init(SLIInterpreter *)
Initialise the module.
Definition: sliregexp.cc:57
const Name REG_ECOLLATE_name
Definition: sliregexp.h:79
const Name REG_NOTBOL_name
Definition: sliregexp.h:71
const Name REG_EXTENDED_name
Definition: sliregexp.h:75
const Name REG_NOSUB_name
Definition: sliregexp.h:77
Definition: sliregexp.h:57
Definition: interpret.h:69
Definition: slitype.h:49
void execute(SLIInterpreter *) const
Definition: sliregexp.cc:133
Definition: sliregexp.h:52
RegerrorFunction regerrorfunction
Definition: sliregexp.h:67
const Name REG_ESPACE_name
Definition: sliregexp.h:73
Definition: sliregexp.h:47
const std::string name(void) const
Return name of the module.
Definition: sliregexp.cc:91
const Name regexdict_name
Definition: sliregexp.h:69
const Name REG_EESCAPE_name
Definition: sliregexp.h:81
const std::string commandstring(void) const
Return sli command sequence to be executed for initialisation.
Definition: sliregexp.cc:96
const Name REG_BADRPT_name
Definition: sliregexp.h:88
Base class for all SLI Interpreter modules.
Definition: slimodule.h:34
const Name REG_NEWLINE_name
Definition: sliregexp.h:78
void execute(SLIInterpreter *) const
Definition: sliregexp.cc:158
~RegexpModule()
Definition: sliregexp.cc:52
~Regex()
Definition: sliregexp.cc:41
RegexpModule(void)
Definition: sliregexp.h:92
Regex()
Definition: sliregexp.cc:39
const Name REG_ERANGE_name
Definition: sliregexp.h:87