کد مقاله کد نشریه سال انتشار مقاله انگلیسی نسخه تمام متن
433781 1441675 2014 16 صفحه PDF دانلود رایگان
عنوان انگلیسی مقاله ISI
From regexes to parsing expression grammars
موضوعات مرتبط
مهندسی و علوم پایه مهندسی کامپیوتر نظریه محاسباتی و ریاضیات
پیش نمایش صفحه اول مقاله
From regexes to parsing expression grammars
چکیده انگلیسی

Most scripting languages nowadays use regex pattern-matching libraries. These regex libraries borrow the syntax of regular expressions, but have an informal semantics that is different from the semantics of regular expressions, removing the commutativity of alternation and adding ad-hoc extensions that cannot be expressed by formalisms for efficient recognition of regular languages, such as deterministic finite automata.Parsing expression grammars are a formalism that can describe all deterministic context-free languages and have a simple computational model. In this paper, we present a formalization of regexes via transformation to parsing expression grammars. The proposed transformation easily accommodates several common regex extensions, giving a formal meaning to them. It also provides a clear computational model that helps to estimate the efficiency of regex-based matchers, and a basis for specifying provably correct optimizations for them.


► We present a simple, structure-preserving translation from regexes to PEGs.
► We formally prove the correctness of our transformation.
► We show how to use a performance model of PEGs to optimize some classes of regexes.
► We show how our transformation can accommodate some ad-hoc extensions to regexes.

ناشر
Database: Elsevier - ScienceDirect (ساینس دایرکت)
Journal: Science of Computer Programming - Volume 93, Part A, 1 November 2014, Pages 3–18
نویسندگان
, , ,