MCPcopy Create free account
hub / github.com/Genivia/ugrep / init

Method init

lib/pattern.cpp:185–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185void Pattern::init(const char *options, const char *pred)
186{
187 init_options(options);
188 nop_ = 0;
189 len_ = 0;
190 min_ = 0;
191 pin_ = 0;
192 lcp_ = 0;
193 lcs_ = 0;
194 bmd_ = 0;
195 npy_ = 0;
196 one_ = false;
197 bol_ = false;
198 vno_ = 0;
199 eno_ = 0;
200 hno_ = 0;
201 pms_ = 0.0;
202 vms_ = 0.0;
203 ems_ = 0.0;
204 wms_ = 0.0;
205 ams_ = 0.0;
206 cut_ = 0;
207 lbk_ = 0;
208 lbm_ = 0;
209 cbk_.reset();
210 fst_.reset();
211 if (opc_ != NULL || fsm_ != NULL )
212 {
213 if (pred != NULL)
214 {
215#ifndef WITH_NO_CODEGEN
216 len_ = gethex(pred);
217 uint8_t mode = gethex(pred);
218 min_ = mode & 0x0f;
219 one_ = mode & 0x10;
220 bol_ = mode & 0x40;
221 if (len_ == 0)
222 {
223 // load bit_[] parameters
224 for (int i = 0; i < 256; ++i)
225 bit_[i] = gethex(pred);
226 if (min_ > 7)
227 {
228 // load tap_[] parameters uncompressed
229 for (int i = 0; i < Const::BTAP; ++i)
230 tap_[i] = gethex(pred);
231 }
232 else
233 {
234 // load tap_[] parameters compressed
235 int i = 0;
236 while (i < Const::BTAP)
237 {
238 uint8_t byte = gethex(pred);
239 if ((byte & 128) != 0)
240 {
241 while (byte-- > 127 && i < Const::BTAP)
242 tap_[i++] = 0xff;

Callers

nothing calls this directly

Calls 14

gethexFunction · 0.85
timer_startFunction · 0.85
uppercaseFunction · 0.85
timer_elapsedFunction · 0.85
have_HW_AVX512BWFunction · 0.85
have_HW_AVX2Function · 0.85
have_HW_SSE2Function · 0.85
resetMethod · 0.45
emptyMethod · 0.45
rootMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected