{"id":{"repo_id":"chalmers","oai_identifier":"oai:odr.chalmers.se:20.500.12380/307579"},"canonical_url":"https://search.ndltd.org/etd/chalmers/oai:odr.chalmers.se:20.500.12380/307579","repository":{"repo_id":"chalmers","name":"Chalmers University of Technology","base_url":"https://odr.chalmers.se/oai/request"},"display":{"title":"Layout Syntax Support in the BNF Converter","abstract":"Many programming languages, such as Haskell and Python, use layout as part of their syntax. We can expect future programming languages to also be layoutsensitive. Therefore, the toolchains for implementing programming languages must support layout-sensitive languages. This thesis presents a declarative approach to describing layout-sensitive languages and parsing programs written in them. We reserve the terminals newline, indent, and dedent for describing layout syntax in BNF grammar and provide an algorithm for representing the layout of a program with these terminals, before parsing it. By verbalising layout syntax this way, mainstream parser generators, and their parsing algorithms, can be used. This approach is successfully implemented in BNF Converter (BNFC), a tool that generates a compiler front-end from a context-free grammar in Labelled BNF (LBNF) form. With a special kind of LBNF rule, called pragma, it is possible to declare global layout syntax rules, such as the offside rule, which affects the insertion of layout terminals by the aforementioned algorithm. The reserved terminals and the pragmas can together describe popular layout syntax. Furthermore, both purely layout-sensitive languages and those mixing layoutsensitive and insensitive syntax are describable in LBNF.","abstract_html":"Many programming languages, such as Haskell and Python, use layout as part of their syntax. We can expect future programming languages to also be layoutsensitive. Therefore, the toolchains for implementing programming languages must support layout-sensitive languages. This thesis presents a declarative approach to describing layout-sensitive languages and parsing programs written in them. We reserve the terminals newline, indent, and dedent for describing layout syntax in BNF grammar and provide an algorithm for representing the layout of a program with these terminals, before parsing it. By verbalising layout syntax this way, mainstream parser generators, and their parsing algorithms, can be used. This approach is successfully implemented in BNF Converter (BNFC), a tool that generates a compiler front-end from a context-free grammar in Labelled BNF (LBNF) form. With a special kind of LBNF rule, called pragma, it is possible to declare global layout syntax rules, such as the offside rule, which affects the insertion of layout terminals by the aforementioned algorithm. The reserved terminals and the pragmas can together describe popular layout syntax. Furthermore, both purely layout-sensitive languages and those mixing layoutsensitive and insensitive syntax are describable in LBNF.","abstract_has_math":false,"creators":["Burreau, Beata"],"institution":null,"degree_name":null,"degree_level":"H","degree_discipline":null,"degree_department":"Chalmers tekniska högskola / Institutionen för data och informationsteknik","school":null,"contributors":[],"advisors":["Abel, Andreas"],"committee_chairs":[],"committee_members":["Ranta, Aarne"],"year":2023,"date_issued":"2023","date_published":"2023","updated_at":"2026-11-19T03:02:51Z","subjects":["layout","syntax","indentation-sensitive language","context-free grammar","Labelled BNF (LBNF)","BNF Converter (BNFC)","Pfenning safety"],"languages":[],"rights":[],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/20.500.12380/307579","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/20.500.12380/307579","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Achalmers%3Aoai%3Aodr.chalmers.se%3A20.500.12380%2F307579","prefix":"oai_dc"},"source_record":{"url":"https://odr.chalmers.se/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Aodr.chalmers.se%3A20.500.12380%2F307579","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.committeemember","label":"Committee Member","values":["Ranta, Aarne"]},{"key":"dc:contributor.department","label":"Department","values":["Chalmers tekniska högskola / Institutionen för data och informationsteknik","Chalmers University of Technology / Department of Computer Science and Engineering"]},{"key":"dc:contributor.supervisor","label":"Supervisor","values":["Abel, Andreas"]},{"key":"dc:creator","label":"Author","values":["Burreau, Beata"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2024-02-16T10:54:41Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2024-02-16T10:54:41Z"]},{"key":"dc:date.issued","label":"Date","values":["2023"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2023"]},{"key":"dc:publisher.program","label":"Dc Publisher Program","values":["Computer science – algorithms, languages and logic (MPALG), MSc"]},{"key":"dc:type.degree","label":"Dc Type Degree","values":["Examensarbete för masterexamen","Master's Thesis"]},{"key":"thesis:degree_level","label":"Degree Level","values":["H"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["layout","syntax","indentation-sensitive language","context-free grammar","Labelled BNF (LBNF)","BNF Converter (BNFC)","Pfenning safety"]},{"key":"dc:subject.uppsok","label":"Dc Subject Uppsok","values":["Technology"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/20.500.12380/307579"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Many programming languages, such as Haskell and Python, use layout as part of their syntax. We can expect future programming languages to also be layoutsensitive. Therefore, the toolchains for implementing programming languages must support layout-sensitive languages. This thesis presents a declarative approach to describing layout-sensitive languages and parsing programs written in them. We reserve the terminals newline, indent, and dedent for describing layout syntax in BNF grammar and provide an algorithm for representing the layout of a program with these terminals, before parsing it. By verbalising layout syntax this way, mainstream parser generators, and their parsing algorithms, can be used. This approach is successfully implemented in BNF Converter (BNFC), a tool that generates a compiler front-end from a context-free grammar in Labelled BNF (LBNF) form. With a special kind of LBNF rule, called pragma, it is possible to declare global layout syntax rules, such as the offside rule, which affects the insertion of layout terminals by the aforementioned algorithm. The reserved terminals and the pragmas can together describe popular layout syntax. Furthermore, both purely layout-sensitive languages and those mixing layoutsensitive and insensitive syntax are describable in LBNF."]},{"key":"dc:title","label":"Title","values":["Layout Syntax Support in the BNF Converter"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:contributor.committeemember":["Ranta, Aarne"],"dc:contributor.department":["Chalmers tekniska högskola / Institutionen för data och informationsteknik","Chalmers University of Technology / Department of Computer Science and Engineering"],"dc:contributor.supervisor":["Abel, Andreas"],"dc:creator":["Burreau, Beata"],"dc:date.accessioned":["2024-02-16T10:54:41Z"],"dc:date.available":["2024-02-16T10:54:41Z"],"dc:date.issued":["2023"],"dc:date.submitted":["2023"],"dc:description.abstract":["Many programming languages, such as Haskell and Python, use layout as part of their syntax. We can expect future programming languages to also be layoutsensitive. Therefore, the toolchains for implementing programming languages must support layout-sensitive languages. This thesis presents a declarative approach to describing layout-sensitive languages and parsing programs written in them. We reserve the terminals newline, indent, and dedent for describing layout syntax in BNF grammar and provide an algorithm for representing the layout of a program with these terminals, before parsing it. By verbalising layout syntax this way, mainstream parser generators, and their parsing algorithms, can be used. This approach is successfully implemented in BNF Converter (BNFC), a tool that generates a compiler front-end from a context-free grammar in Labelled BNF (LBNF) form. With a special kind of LBNF rule, called pragma, it is possible to declare global layout syntax rules, such as the offside rule, which affects the insertion of layout terminals by the aforementioned algorithm. The reserved terminals and the pragmas can together describe popular layout syntax. Furthermore, both purely layout-sensitive languages and those mixing layoutsensitive and insensitive syntax are describable in LBNF."],"dc:identifier.uri":["https://hdl.handle.net/20.500.12380/307579"],"dc:publisher.program":["Computer science – algorithms, languages and logic (MPALG), MSc"],"dc:subject":["layout","syntax","indentation-sensitive language","context-free grammar","Labelled BNF (LBNF)","BNF Converter (BNFC)","Pfenning safety"],"dc:subject.uppsok":["Technology"],"dc:title":["Layout Syntax Support in the BNF Converter"],"dc:type.degree":["Examensarbete för masterexamen","Master's Thesis"],"others:access_status":["open.access"],"thesis:degree_level":["H"]},"updated_at":"2026-11-19T03:02:51Z"}