Matching objects without language extension

Bibliographic Details
Main Author: Visser, Joost
Publication Date: 2006
Format: Article
Language: eng
Source: Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
Download full: http://hdl.handle.net/1822/6354
Summary: Pattern matching is a powerful programming concept which has proven its merits in declarative programming. The absence of pattern-matching in object-oriented programming languages is felt especially when tackling source code processing problems. But existing proposals for pattern matching in such languages rely on language extension, which makes their adoption overly intrusive. We propose an approach to support pattern matching in mainstream object-oriented languages without language extension. In this approach, a pattern is a first-class entity, which can be created, be passed as argument, and receive method invocations, just like any other object. We demonstrate how our approach can be used in conjunction with existing parser generators to perform pattern matching on various kinds of abstract syntax representation. We elaborate our approach to include concrete syntax patterns, and mixing of patterns and visitors for the construction of sophisticated syntax tree traversals.
id RCAP_dd07c61f3969014787e651f32f177bdb
oai_identifier_str oai:repositorium.sdum.uminho.pt:1822/6354
network_acronym_str RCAP
network_name_str Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
repository_id_str https://opendoar.ac.uk/repository/7160
spelling Matching objects without language extensionLanguage and document processingProgramming and software engineeringObject-oriented programmingParsingPattern matchingStrategic programmingSyntaxTerm rewritingTree traversalScience & TechnologyPattern matching is a powerful programming concept which has proven its merits in declarative programming. The absence of pattern-matching in object-oriented programming languages is felt especially when tackling source code processing problems. But existing proposals for pattern matching in such languages rely on language extension, which makes their adoption overly intrusive. We propose an approach to support pattern matching in mainstream object-oriented languages without language extension. In this approach, a pattern is a first-class entity, which can be created, be passed as argument, and receive method invocations, just like any other object. We demonstrate how our approach can be used in conjunction with existing parser generators to perform pattern matching on various kinds of abstract syntax representation. We elaborate our approach to include concrete syntax patterns, and mixing of patterns and visitors for the construction of sophisticated syntax tree traversals.Thanks to Rob van der Leek of the Software Improvement Group for valuable feedback regarding this paper and the MatchO library. The author is recipient of a research grant from the Fundacao para a Ciencia e a Tecnologia, under grant number SFRH/BPD/11609/2002.ETH-ZürichUniversidade do MinhoVisser, Joost2006-112006-11-01T00:00:00Zinfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/articleapplication/pdfhttp://hdl.handle.net/1822/6354eng"Journal of object technology". ISSN 1660-1769. 5:8 (Nov./Dez. 2006) 81-100.1660-176910.5381/jot.2006.5.8.a2info:eu-repo/semantics/openAccessreponame:Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)instname:FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologiainstacron:RCAAP2024-05-11T05:47:19Zoai:repositorium.sdum.uminho.pt:1822/6354Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireinfo@rcaap.ptopendoar:https://opendoar.ac.uk/repository/71602025-05-28T15:30:12.841651Repositórios Científicos de Acesso Aberto de Portugal (RCAAP) - FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologiafalse
dc.title.none.fl_str_mv Matching objects without language extension
title Matching objects without language extension
spellingShingle Matching objects without language extension
Visser, Joost
Language and document processing
Programming and software engineering
Object-oriented programming
Parsing
Pattern matching
Strategic programming
Syntax
Term rewriting
Tree traversal
Science & Technology
title_short Matching objects without language extension
title_full Matching objects without language extension
title_fullStr Matching objects without language extension
title_full_unstemmed Matching objects without language extension
title_sort Matching objects without language extension
author Visser, Joost
author_facet Visser, Joost
author_role author
dc.contributor.none.fl_str_mv Universidade do Minho
dc.contributor.author.fl_str_mv Visser, Joost
dc.subject.por.fl_str_mv Language and document processing
Programming and software engineering
Object-oriented programming
Parsing
Pattern matching
Strategic programming
Syntax
Term rewriting
Tree traversal
Science & Technology
topic Language and document processing
Programming and software engineering
Object-oriented programming
Parsing
Pattern matching
Strategic programming
Syntax
Term rewriting
Tree traversal
Science & Technology
description Pattern matching is a powerful programming concept which has proven its merits in declarative programming. The absence of pattern-matching in object-oriented programming languages is felt especially when tackling source code processing problems. But existing proposals for pattern matching in such languages rely on language extension, which makes their adoption overly intrusive. We propose an approach to support pattern matching in mainstream object-oriented languages without language extension. In this approach, a pattern is a first-class entity, which can be created, be passed as argument, and receive method invocations, just like any other object. We demonstrate how our approach can be used in conjunction with existing parser generators to perform pattern matching on various kinds of abstract syntax representation. We elaborate our approach to include concrete syntax patterns, and mixing of patterns and visitors for the construction of sophisticated syntax tree traversals.
publishDate 2006
dc.date.none.fl_str_mv 2006-11
2006-11-01T00:00:00Z
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.uri.fl_str_mv http://hdl.handle.net/1822/6354
url http://hdl.handle.net/1822/6354
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv "Journal of object technology". ISSN 1660-1769. 5:8 (Nov./Dez. 2006) 81-100.
1660-1769
10.5381/jot.2006.5.8.a2
dc.rights.driver.fl_str_mv info:eu-repo/semantics/openAccess
eu_rights_str_mv openAccess
dc.format.none.fl_str_mv application/pdf
dc.publisher.none.fl_str_mv ETH-Zürich
publisher.none.fl_str_mv ETH-Zürich
dc.source.none.fl_str_mv reponame:Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
instname:FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
instacron:RCAAP
instname_str FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
instacron_str RCAAP
institution RCAAP
reponame_str Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
collection Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
repository.name.fl_str_mv Repositórios Científicos de Acesso Aberto de Portugal (RCAAP) - FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
repository.mail.fl_str_mv info@rcaap.pt
_version_ 1833595355868954624