Home | History | Annotate | Download | only in re2

Lines Matching defs:prog

5 // Compile regular expression to Prog.
7 // Prog and Inst are defined in prog.h.
11 #include "re2/prog.h"
38 static void Patch(Prog::Inst *inst0, PatchList l, uint32 v);
41 static PatchList Deref(Prog::Inst *inst0, PatchList l);
44 static PatchList Append(Prog::Inst *inst0, PatchList l1, PatchList l2);
57 PatchList PatchList::Deref(Prog::Inst* inst0, PatchList l) {
58 Prog::Inst* ip = &inst0[l.p>>1];
67 void PatchList::Patch(Prog::Inst *inst0, PatchList l, uint32 val) {
69 Prog::Inst* ip = &inst0[l.p>>1];
81 PatchList PatchList::Append(Prog::Inst* inst0, PatchList l1, PatchList l2) {
95 Prog::Inst* ip = &inst0[l.p>>1];
127 // Compiles Regexp to a new Prog.
128 // Caller is responsible for deleting Prog when finished with it.
131 static Prog *Compile(Regexp* re, bool reversed, int64 max_mem);
133 // Compiles alternation of all the re to a new Prog.
135 static Prog* CompileSet(const RE2::Options& options, RE2::Anchor anchor,
212 Prog* Finish();
218 Prog* prog_; // Program being built.
225 Prog::Inst* inst_; // Pointer to first instruction.
240 prog_ = new Prog();
270 Prog::Inst* ip = new Prog::Inst[inst_cap_];
283 Prog::Inst* ip = new Prog::Inst[inst_len_];
311 Prog::Inst* begin = &inst_[a.begin];
439 for (j = i+1; j < 256 && Prog::IsWordChar(i) == Prog::IsWordChar(j); j++)
960 } else if (max_mem <= sizeof(Prog)) {
964 int64 m = (max_mem - sizeof(Prog)) / sizeof(Prog::Inst);
968 // and other places in the code use 2 or 3 * prog->size().
977 if (m > Prog::Inst::kMaxInst)
978 m = Prog::Inst::kMaxInst;
991 Prog* Compiler::Compile(Regexp* re, bool reversed, int64 max_mem) {
1003 // Record whether prog is anchored, removing the anchors.
1043 Prog* Compiler::Finish() {
1052 // Trim instruction to minimum array and transfer to Prog.
1067 int64 m = max_mem_ - sizeof(Prog) - inst_len_*sizeof(Prog::Inst);
1073 Prog* p = prog_;
1078 // Converts Regexp to Prog.
1079 Prog* Regexp::CompileToProg(int64 max_mem) {
1083 Prog* Regexp::CompileToReverseProg(int64 max_mem) {
1091 // Compiles RE set to Prog.
1092 Prog* Compiler::CompileSet(const RE2::Options& options, RE2::Anchor anchor,
1116 Prog* prog = c.Finish();
1117 if (prog == NULL)
1124 prog->SearchDFA(sp, sp, Prog::kAnchored, Prog::kManyMatch,
1127 delete prog;
1131 return prog;
1134 Prog* Prog