The formalization and implementation of Adaptable Parsing Expression Grammars.
Autor(a) principal: | |
---|---|
Data de Publicação: | 2014 |
Outros Autores: | , , |
Tipo de documento: | Artigo |
Idioma: | eng |
Título da fonte: | Repositório Institucional da UFOP |
Texto Completo: | http://www.repositorio.ufop.br/handle/123456789/4414 https://doi.org/10.1016/j.scico.2014.02.020 |
Resumo: | The term “extensible language” is especially used when a language allows the extension of its own concrete syntax and the definition of the semantics of new constructs. Most popular tools designed for automatic generation of syntactic analysers do not offer any adequate resources for the specification of extensible languages. When used in the implementation of features like syntax macro definitions, these tools usually impose severe restrictions. For example, it may be required that macro definitions and their use reside indifferent files; or it may be impossible to perform the syntax analysis in one single pass. We claim that one of the main reasons for these limitations is the lack of appropriate formal models for the definition of the syntax of extensible languages. This paper presents the design and formal definition of Adaptable Parsing Expression Grammars, an extension to the Parsing Expression Grammar (PEG) model that allows the manipulation of its own production rules during the analysis of an input string. The proposed model compares favourably with similar approaches for the definition of the syntax of extensible languages. An implementation of the model is also presented, simulating the behavior of packrat parsers. Among the challenges for this implementation is the use of attributes and on the fly modifications on the production rules at parse time, features not present in standard PEG. This approach has been used on the definition of a real extensible language, and initial performance tests suggest that the model may work well in practice. |
id |
UFOP_2691cb758fa92b1567b1ec8708411d7d |
---|---|
oai_identifier_str |
oai:localhost:123456789/4414 |
network_acronym_str |
UFOP |
network_name_str |
Repositório Institucional da UFOP |
repository_id_str |
3233 |
spelling |
Reis, Leonardo Vieira dos SantosBigonha, Roberto da SilvaIorio, Vladimir Oliveira DiAmorim, Luis Eduardo de Souza2015-01-28T19:51:32Z2015-01-28T19:51:32Z2014REIS, L. V. dos S. et al. The formalization and implementation of Adaptable Parsing Expression Grammars. Science of Computer Programming, v. 96, p. 191-210, 2014. Disponível em: <http://www.sciencedirect.com/science/article/pii/S0167642314000872>. Acesso em: 09 jan. 2015.0167-6423http://www.repositorio.ufop.br/handle/123456789/4414https://doi.org/10.1016/j.scico.2014.02.020The term “extensible language” is especially used when a language allows the extension of its own concrete syntax and the definition of the semantics of new constructs. Most popular tools designed for automatic generation of syntactic analysers do not offer any adequate resources for the specification of extensible languages. When used in the implementation of features like syntax macro definitions, these tools usually impose severe restrictions. For example, it may be required that macro definitions and their use reside indifferent files; or it may be impossible to perform the syntax analysis in one single pass. We claim that one of the main reasons for these limitations is the lack of appropriate formal models for the definition of the syntax of extensible languages. This paper presents the design and formal definition of Adaptable Parsing Expression Grammars, an extension to the Parsing Expression Grammar (PEG) model that allows the manipulation of its own production rules during the analysis of an input string. The proposed model compares favourably with similar approaches for the definition of the syntax of extensible languages. An implementation of the model is also presented, simulating the behavior of packrat parsers. Among the challenges for this implementation is the use of attributes and on the fly modifications on the production rules at parse time, features not present in standard PEG. This approach has been used on the definition of a real extensible language, and initial performance tests suggest that the model may work well in practice.Extensible languagesAdaptable grammarsThe formalization and implementation of Adaptable Parsing Expression Grammars.info:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/articleO periódico Science of Computer Programming concede permissão para depósito do artigo no Repositório Institucional da UFOP. Número da licença: 3544811304552.info:eu-repo/semantics/openAccessengreponame:Repositório Institucional da UFOPinstname:Universidade Federal de Ouro Preto (UFOP)instacron:UFOPLICENSElicense.txtlicense.txttext/plain; charset=utf-82636http://www.repositorio.ufop.br/bitstream/123456789/4414/2/license.txtc2ffdd99e58acf69202dff00d361f23aMD52ORIGINALARTIGO_FormalizationImplementationAdaptable.pdfARTIGO_FormalizationImplementationAdaptable.pdfapplication/pdf398454http://www.repositorio.ufop.br/bitstream/123456789/4414/1/ARTIGO_FormalizationImplementationAdaptable.pdf211f3d4eb5df1e6ae6971d43af36a7c5MD51123456789/44142019-06-17 14:11:57.387oai:localhost:123456789/4414PGh0bWw+Cjxib2R5Pgo8ZGl2IGFsaWduPSJqdXN0aWZ5Ij48c3Ryb25nPkxpY2VuJmNjZWRpbDthIGRvIFJlcG9zaXQmb2FjdXRlO3JpbyBJbnN0aXR1Y2lvbmFsIGRhIFVuaXZlcnNpZGFkZSBGZWRlcmFsI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GZhciZhYWN1dGU7IHF1YWxxdWVyIGFsdGVyYSZjY2VkaWw7JmF0aWxkZTtvIGFsJmVhY3V0ZTttIGRhcyBwZXJtaXRpZGFzIHBvciBlc3RhIGxpY2VuJmNjZWRpbDthLjwvcD4KPC9kaXY+CjwvYm9keT4KPC9odG1sPgo=Repositório InstitucionalPUBhttp://www.repositorio.ufop.br/oai/requestrepositorio@ufop.edu.bropendoar:32332019-06-17T18:11:57Repositório Institucional da UFOP - Universidade Federal de Ouro Preto (UFOP)false |
dc.title.pt_BR.fl_str_mv |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
title |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
spellingShingle |
The formalization and implementation of Adaptable Parsing Expression Grammars. Reis, Leonardo Vieira dos Santos Extensible languages Adaptable grammars |
title_short |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
title_full |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
title_fullStr |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
title_full_unstemmed |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
title_sort |
The formalization and implementation of Adaptable Parsing Expression Grammars. |
author |
Reis, Leonardo Vieira dos Santos |
author_facet |
Reis, Leonardo Vieira dos Santos Bigonha, Roberto da Silva Iorio, Vladimir Oliveira Di Amorim, Luis Eduardo de Souza |
author_role |
author |
author2 |
Bigonha, Roberto da Silva Iorio, Vladimir Oliveira Di Amorim, Luis Eduardo de Souza |
author2_role |
author author author |
dc.contributor.author.fl_str_mv |
Reis, Leonardo Vieira dos Santos Bigonha, Roberto da Silva Iorio, Vladimir Oliveira Di Amorim, Luis Eduardo de Souza |
dc.subject.por.fl_str_mv |
Extensible languages Adaptable grammars |
topic |
Extensible languages Adaptable grammars |
description |
The term “extensible language” is especially used when a language allows the extension of its own concrete syntax and the definition of the semantics of new constructs. Most popular tools designed for automatic generation of syntactic analysers do not offer any adequate resources for the specification of extensible languages. When used in the implementation of features like syntax macro definitions, these tools usually impose severe restrictions. For example, it may be required that macro definitions and their use reside indifferent files; or it may be impossible to perform the syntax analysis in one single pass. We claim that one of the main reasons for these limitations is the lack of appropriate formal models for the definition of the syntax of extensible languages. This paper presents the design and formal definition of Adaptable Parsing Expression Grammars, an extension to the Parsing Expression Grammar (PEG) model that allows the manipulation of its own production rules during the analysis of an input string. The proposed model compares favourably with similar approaches for the definition of the syntax of extensible languages. An implementation of the model is also presented, simulating the behavior of packrat parsers. Among the challenges for this implementation is the use of attributes and on the fly modifications on the production rules at parse time, features not present in standard PEG. This approach has been used on the definition of a real extensible language, and initial performance tests suggest that the model may work well in practice. |
publishDate |
2014 |
dc.date.issued.fl_str_mv |
2014 |
dc.date.accessioned.fl_str_mv |
2015-01-28T19:51:32Z |
dc.date.available.fl_str_mv |
2015-01-28T19:51:32Z |
dc.type.status.fl_str_mv |
info:eu-repo/semantics/publishedVersion |
dc.type.driver.fl_str_mv |
info:eu-repo/semantics/article |
format |
article |
status_str |
publishedVersion |
dc.identifier.citation.fl_str_mv |
REIS, L. V. dos S. et al. The formalization and implementation of Adaptable Parsing Expression Grammars. Science of Computer Programming, v. 96, p. 191-210, 2014. Disponível em: <http://www.sciencedirect.com/science/article/pii/S0167642314000872>. Acesso em: 09 jan. 2015. |
dc.identifier.uri.fl_str_mv |
http://www.repositorio.ufop.br/handle/123456789/4414 |
dc.identifier.issn.none.fl_str_mv |
0167-6423 |
dc.identifier.doi.none.fl_str_mv |
https://doi.org/10.1016/j.scico.2014.02.020 |
identifier_str_mv |
REIS, L. V. dos S. et al. The formalization and implementation of Adaptable Parsing Expression Grammars. Science of Computer Programming, v. 96, p. 191-210, 2014. Disponível em: <http://www.sciencedirect.com/science/article/pii/S0167642314000872>. Acesso em: 09 jan. 2015. 0167-6423 |
url |
http://www.repositorio.ufop.br/handle/123456789/4414 https://doi.org/10.1016/j.scico.2014.02.020 |
dc.language.iso.fl_str_mv |
eng |
language |
eng |
dc.rights.driver.fl_str_mv |
info:eu-repo/semantics/openAccess |
eu_rights_str_mv |
openAccess |
dc.source.none.fl_str_mv |
reponame:Repositório Institucional da UFOP instname:Universidade Federal de Ouro Preto (UFOP) instacron:UFOP |
instname_str |
Universidade Federal de Ouro Preto (UFOP) |
instacron_str |
UFOP |
institution |
UFOP |
reponame_str |
Repositório Institucional da UFOP |
collection |
Repositório Institucional da UFOP |
bitstream.url.fl_str_mv |
http://www.repositorio.ufop.br/bitstream/123456789/4414/2/license.txt http://www.repositorio.ufop.br/bitstream/123456789/4414/1/ARTIGO_FormalizationImplementationAdaptable.pdf |
bitstream.checksum.fl_str_mv |
c2ffdd99e58acf69202dff00d361f23a 211f3d4eb5df1e6ae6971d43af36a7c5 |
bitstream.checksumAlgorithm.fl_str_mv |
MD5 MD5 |
repository.name.fl_str_mv |
Repositório Institucional da UFOP - Universidade Federal de Ouro Preto (UFOP) |
repository.mail.fl_str_mv |
repositorio@ufop.edu.br |
_version_ |
1797950123700912128 |