Top-Down Parsing with Parsing Contexts


Autoria(s): Kurs, Jan; Lungu, Mircea; Nierstrasz, Oscar
Data(s)

2014

Resumo

The domain of context-free languages has been extensively explored and there exist numerous techniques for parsing (all or a subset of) context-free languages. Unfortunately, some programming languages are not context-free. Using standard context-free parsing techniques to parse a context-sensitive programming language poses a considerable challenge. Im- plementors of programming language parsers have adopted various techniques, such as hand-written parsers, special lex- ers, or post-processing of an ambiguous parser output to deal with that challenge. In this paper we suggest a simple extension of a top-down parser with contextual information. Contrary to the tradi- tional approach that uses only the input stream as an input to a parsing function, we use a parsing context that provides ac- cess to a stream and possibly to other context-sensitive infor- mation. At a same time we keep the context-free formalism so a grammar definition stays simple without mind-blowing context-sensitive rules. We show that our approach can be used for various purposes such as indent-sensitive parsing, a high-precision island parsing or XML (with arbitrary el- ement names) parsing. We demonstrate our solution with PetitParser, a parsing-expression grammar based, top-down, parser combinator framework written in Smalltalk.

Formato

application/pdf

Identificador

http://boris.unibe.ch/67045/1/Kurs14a-ParsingContext.pdf

Kurs, Jan; Lungu, Mircea; Nierstrasz, Oscar (2014). Top-Down Parsing with Parsing Contexts. In: Proceedings of International Workshop on Smalltalk Technologies (IWST 2014).

doi:10.7892/boris.67045

Idioma(s)

eng

Relação

http://boris.unibe.ch/67045/

http://scg.unibe.ch/archive/papers/Kurs14a-ParsingContext.pdf

Direitos

info:eu-repo/semantics/restrictedAccess

Fonte

Kurs, Jan; Lungu, Mircea; Nierstrasz, Oscar (2014). Top-Down Parsing with Parsing Contexts. In: Proceedings of International Workshop on Smalltalk Technologies (IWST 2014).

Palavras-Chave #000 Computer science, knowledge & systems #510 Mathematics
Tipo

info:eu-repo/semantics/conferenceObject

info:eu-repo/semantics/publishedVersion

PeerReviewed