Abstract
We show how to achieve typed and unambiguous declarative
pattern matching on strings using regular expressions
extended with a simple recording operator.
We give a characterization of ambiguity of regular expressions
that leads to a sound and complete static analysis. The
analysis is capable of pinpointing all ambiguities in terms of
the structure of the regular expression and report shortest
ambiguous strings. We also show how pattern matching can
be integrated into statically typed programming languages
for deconstructing strings and reproducing typed and structured
values.
We validate our approach by giving a full implementation
of the approach presented in this paper. The resulting tool,
reg-exp-rec, adds typed and unambiguous pattern matching
to Java in a stand-alone and non-intrusive manner. We
evaluate the approach using several realistic examples.
pattern matching on strings using regular expressions
extended with a simple recording operator.
We give a characterization of ambiguity of regular expressions
that leads to a sound and complete static analysis. The
analysis is capable of pinpointing all ambiguities in terms of
the structure of the regular expression and report shortest
ambiguous strings. We also show how pattern matching can
be integrated into statically typed programming languages
for deconstructing strings and reproducing typed and structured
values.
We validate our approach by giving a full implementation
of the approach presented in this paper. The resulting tool,
reg-exp-rec, adds typed and unambiguous pattern matching
to Java in a stand-alone and non-intrusive manner. We
evaluate the approach using several realistic examples.
Originalsprog | Engelsk |
---|---|
Titel | Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming |
Antal sider | 12 |
Forlag | Association for Computing Machinery |
Publikationsdato | 2010 |
Sider | 243-254 |
ISBN (Trykt) | 978-1-4503-0132-9 |
Status | Udgivet - 2010 |
Begivenhed | International Conference on Principles and Practice of Declarative Programming (PPDP 2010) - Hagenberg, Østrig Varighed: 26 jul. 2010 → 28 jul. 2010 Konferencens nummer: 12th http://www.risc.jku.at/conferences/ppdp2010/ |
Konference
Konference | International Conference on Principles and Practice of Declarative Programming (PPDP 2010) |
---|---|
Nummer | 12th |
Land/Område | Østrig |
By | Hagenberg |
Periode | 26/07/2010 → 28/07/2010 |
Internetadresse |
Emneord
- Typed pattern matching
- Regular expressions
- Ambiguity analysis
- Static analysis
- Statically typed languages