Abstract
Regular expression parsing is the problem of producing a
parse tree of a string for a given regular expression. We show that a
compact bit representation of a parse tree can be produced efficiently,
in time linear in the product of input string size and regular expression
size, by simplifying the DFA-based parsing algorithm due to Dub´e and
Feeley to emit the bits of the bit representation without explicitly materializing
the parse tree itself. We furthermore show that Frisch and
Cardelli’s greedy regular expression parsing algorithm can be straightforwardly
modified to produce bit codings directly. We implement both
solutions as well as a backtracking parser and perform benchmark experiments
to gauge their practical performance. We observe that our
DFA-based solution can be significantly more time and space efficient
than the Frisch-Cardelli algorithm due to its sharing of DFA-nodes, but
that the latter may still perform better on regular expressions that are
“more deterministic” from the right than the left. (Backtracking is, unsurprisingly,
quite hopeless.)
parse tree of a string for a given regular expression. We show that a
compact bit representation of a parse tree can be produced efficiently,
in time linear in the product of input string size and regular expression
size, by simplifying the DFA-based parsing algorithm due to Dub´e and
Feeley to emit the bits of the bit representation without explicitly materializing
the parse tree itself. We furthermore show that Frisch and
Cardelli’s greedy regular expression parsing algorithm can be straightforwardly
modified to produce bit codings directly. We implement both
solutions as well as a backtracking parser and perform benchmark experiments
to gauge their practical performance. We observe that our
DFA-based solution can be significantly more time and space efficient
than the Frisch-Cardelli algorithm due to its sharing of DFA-nodes, but
that the latter may still perform better on regular expressions that are
“more deterministic” from the right than the left. (Backtracking is, unsurprisingly,
quite hopeless.)
Originalsprog | Engelsk |
---|---|
Titel | Language and Automata Theory and Applications : 5th International Conference, LATA 2011, Tarragona, Spain, May 26-31, 2011. Proceedings |
Redaktører | Adrian-Horia Dediu, Shunsuke Inenaga, Carlos Martín-Vide |
Antal sider | 12 |
Forlag | Springer |
Publikationsdato | 2011 |
Sider | 402-413 |
ISBN (Trykt) | 978-3-642-21253-6 |
ISBN (Elektronisk) | 978-3-642-21254-3 |
DOI | |
Status | Udgivet - 2011 |
Begivenhed | 5th International Conference on Language and Automata Theory and Applications - Tarragona, Spanien Varighed: 26 maj 2011 → 31 maj 2011 Konferencens nummer: 5 |
Konference
Konference | 5th International Conference on Language and Automata Theory and Applications |
---|---|
Nummer | 5 |
Land/Område | Spanien |
By | Tarragona |
Periode | 26/05/2011 → 31/05/2011 |
Navn | Lecture notes in computer science |
---|---|
Vol/bind | 6638 |
ISSN | 0302-9743 |