]> granicus.if.org Git - re2c/commit
Don't use special regexp type for counted repetitions.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 15 Aug 2015 16:42:41 +0000 (17:42 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 15 Aug 2015 16:42:41 +0000 (17:42 +0100)
commit06e850501455ed0dd816a86ca7ce0a14163ba870
treef554a64f40c92e4d19a7933566062f7df8d5e5fc
parenta148131156c06f847c6a9b511ffa2b850203edcf
Don't use special regexp type for counted repetitions.

Counted repetitions are regexps of the form:
    r{n}
    r{n,m}
    r{n,}

They can be expressed in terms of concatenation, alternation and
iteration:
    r{0}      <empty regexp>
    r{n}      r{n-1} r
    r{n,m}    r{n} (r{0} | ... | r{m-n})
    r{n,}     r{n} r*

Reducing special regexp type to represent counted repetitions allows
us substitute complex code that compiles them to bytecode instructions
with simpler code that constructs counted repetitions using concatenation,
alternation and iteration.
re2c/Makefile.am
re2c/src/ir/bytecode/calc_size.cc
re2c/src/ir/bytecode/compile.cc
re2c/src/ir/bytecode/split.cc
re2c/src/ir/regexp/display.cc
re2c/src/ir/regexp/regexp.cc
re2c/src/ir/regexp/regexp.h
re2c/src/ir/regexp/regexp_closev.h [deleted file]
re2c/src/parse/parser.ypp