Matching objects without language extension

Detalhes bibliográficos
Autor(a) principal: Visser, Joost
Data de Publicação: 2006
Tipo de documento: Artigo
Idioma: eng
Título da fonte: Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
Texto Completo: http://hdl.handle.net/1822/6354
Resumo: 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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository_id_str 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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãoinstacron:RCAAP2023-07-21T12:22:12Zoai:repositorium.sdum.uminho.pt:1822/6354Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireopendoar:71602024-03-19T19:15:39.879118Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãofalse
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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron:RCAAP
instname_str Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron_str RCAAP
institution RCAAP
reponame_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
collection Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository.name.fl_str_mv Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
repository.mail.fl_str_mv
_version_ 1799132602586628096