Generating flex lexical scanners for perl parse:: Yapp

Perl is known for its versatile regular expressions. Nevertheless, using Perl regular expressions for creating fast lexical analyzer is not easy. As an alternative, the authors defend the automated generation of the lexical analyzer in a well known fast application (flex) based on a simple Perl defi...

Full description

Bibliographic Details
Main Author: Simões, Alberto (author)
Other Authors: Carvalho, Nuno (author), Almeida, J. J. (author)
Format: conferencePaper
Language:eng
Published: 2012
Subjects:
Online Access:http://hdl.handle.net/1822/23572
Country:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/23572
Description
Summary:Perl is known for its versatile regular expressions. Nevertheless, using Perl regular expressions for creating fast lexical analyzer is not easy. As an alternative, the authors defend the automated generation of the lexical analyzer in a well known fast application (flex) based on a simple Perl definition in the syntactic analyzer. In this paper we extend the syntax used by Parse::Yapp, one of the most used parser generators for Perl, making the automatic generation of flex lexical scanners possible. We explain how this is performed and conclude with some benchmarks that show the relevance of the approach.