Typed and unambiguous pattern matching on strings using regular expressions
Research output: Conference Article in Proceeding or Book/Report chapter › Article in proceedings › Research › peer-review
Standard
Typed and unambiguous pattern matching on strings using regular expressions. / Brabrand, Claus; Thomsen, Jakob G.
Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming. Association for Computing Machinery, 2010. p. 243-254.Research output: Conference Article in Proceeding or Book/Report chapter › Article in proceedings › Research › peer-review
Harvard
APA
Vancouver
Author
Bibtex
}
RIS
TY - GEN
T1 - Typed and unambiguous pattern matching on strings using regular expressions
AU - Brabrand, Claus
AU - Thomsen, Jakob G.
N1 - Conference code: 12th
PY - 2010
Y1 - 2010
N2 - We show how to achieve typed and unambiguous declarativepattern matching on strings using regular expressionsextended with a simple recording operator.We give a characterization of ambiguity of regular expressionsthat leads to a sound and complete static analysis. Theanalysis is capable of pinpointing all ambiguities in terms ofthe structure of the regular expression and report shortestambiguous strings. We also show how pattern matching canbe integrated into statically typed programming languagesfor deconstructing strings and reproducing typed and structuredvalues.We validate our approach by giving a full implementationof the approach presented in this paper. The resulting tool,reg-exp-rec, adds typed and unambiguous pattern matchingto Java in a stand-alone and non-intrusive manner. Weevaluate the approach using several realistic examples.
AB - We show how to achieve typed and unambiguous declarativepattern matching on strings using regular expressionsextended with a simple recording operator.We give a characterization of ambiguity of regular expressionsthat leads to a sound and complete static analysis. Theanalysis is capable of pinpointing all ambiguities in terms ofthe structure of the regular expression and report shortestambiguous strings. We also show how pattern matching canbe integrated into statically typed programming languagesfor deconstructing strings and reproducing typed and structuredvalues.We validate our approach by giving a full implementationof the approach presented in this paper. The resulting tool,reg-exp-rec, adds typed and unambiguous pattern matchingto Java in a stand-alone and non-intrusive manner. Weevaluate the approach using several realistic examples.
M3 - Article in proceedings
SN - 978-1-4503-0132-9
SP - 243
EP - 254
BT - Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
PB - Association for Computing Machinery
T2 - International Conference on Principles and Practice of Declarative Programming (PPDP 2010)
Y2 - 26 July 2010 through 28 July 2010
ER -
ID: 30839172