skip to main content
10.1145/3567512.3567522acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article
Open access

Partial Parsing for Structured Editors

Published: 01 December 2022 Publication History

Abstract

Creating structured editors, which maintain a valid syntax tree at all times rather than allowing to edit program text, is typically a time consuming task. Recent work has investigated the use of existing general-purpose language grammars as a basis for automatically generating structured editors, thus considerably reducing the effort required. However, in these generated editors, input occurs through menu and mouse-based interaction, rather than via keyboard entry that is familiar to most users.
In this paper we introduce modifications to a parser of general-purpose programming language grammars to support keyboard-centric interactions with generated structured editors. Specifically, we describe a system we call partial parsing to autocomplete language structures, removing the need for a menu of language constructs in favor of keyboard-based disambiguation. We demonstrate our system's applicability and performance for use in interactive, generated structured editors. Our system thus constitutes a step towards making structured editors generated from language grammars usable with more efficient and familiar keyboard-centric interactions.

References

[1]
Austin Cory Bart, Javier Tibau, Eli Tilevich, Clifford A. Shaffer, and Dennis Kafura. 2016. Implementing an Open-Access, Data Science Programming Environment for Learners. In 2016 IEEE 40th Annual Computer Software and Applications Conference (COMPSAC). 1, 728–737. https://doi.org/10.1109/COMPSAC.2016.132
[2]
David Bau, Jeff Gray, Caitlin Kelleher, Josh Sheldon, and Franklyn Turbak. 2017. Learnable Programming: Blocks and Beyond. Commun. ACM, 60, 6 (2017), May, 72–80. issn:0001-0782 https://doi.org/10.1145/3015455
[3]
Tom Beckmann, Stefan Ramson, Patrick Rein, and Robert Hirschfeld. 2020. Visual Design for a Tree-Oriented Projectional Editor. In Conference Companion of the 4th International Conference on Art, Science, and Engineering of Programming (<Programming> ’20). Association for Computing Machinery, New York, NY, USA. 113–119. isbn:9781450375078 https://doi.org/10.1145/3397537.3397560
[4]
Thorsten Berger, Markus Völter, Hans Jensen, Taweesap Dangprasert, and Janet Siegmund. 2016. Efficiency of projectional editing: a controlled experiment. In FSE 2016. 763–774. https://doi.org/10.1145/2950290.2950315
[5]
Max Brunsfeld. 2020. Tree-sitter. https://tree-sitter.github.io/tree-sitter/ [Online, accessed 10 August 2022]
[6]
Lukas Diekmann and Laurence Tratt. 2020. Don’t Panic! Better, Fewer, Syntax Errors for LR Parsers. In 34th European Conference on Object-Oriented Programming, ECOOP 2020, November 15-17, 2020, Berlin, Germany (Virtual Conference), Robert Hirschfeld and Tobias Pape (Eds.) (LIPIcs, Vol. 166). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 6:1–6:32. https://doi.org/10.4230/LIPIcs.ECOOP.2020.6
[7]
Patrick Dubroy and Alessandro Warth. 2017. Incremental packrat parsing. In Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2017, Vancouver, BC, Canada, October 23-24, 2017, Benoît Combemale, Marjan Mernik, and Bernhard Rumpe (Eds.). ACM, 14–25. https://doi.org/10.1145/3136014.3136022
[8]
Google. 2020. Blockly. https://developers.google.com/blockly [Online, accessed 10 August 2022]
[9]
Pedro Rangel Henriques, Maria João Varanda Pereira, Marjan Mernik, Mitja Lenic, Jeff Gray, and Hui Wu. 2005. Automatic generation of language-based tools using the LISA system. IEE Proc. Softw., 152, 2 (2005), 54–69. https://doi.org/10.1049/ip-sen:20041317
[10]
Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay. 1997. Back to the Future: The Story of Squeak, a Practical Smalltalk Written in Itself. In Proceedings of the 12th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’97). Association for Computing Machinery, New York, NY, USA. 318–326. isbn:0897919084 https://doi.org/10.1145/263698.263754
[11]
Amy Ko, Htet Aung, and Brad Myers. 2005. Design requirements for more flexible structured editors from a study of programmers’ text editing. 1557–1560. https://doi.org/10.1145/1056808.1056965
[12]
Amy J. Ko and Brad A. Myers. 2006. Barista: An implementation framework for enabling new tools, interaction techniques and views in code editors. In Proceedings of the 2006 Conference on Human Factors in Computing Systems, CHI 2006, Montréal, Québec, Canada, April 22-27, 2006, Rebecca E. Grinter, Tom Rodden, Paul M. Aoki, Edward Cutrell, Robin Jeffries, and Gary M. Olson (Eds.). ACM, 387–396. https://doi.org/10.1145/1124772.1124831
[13]
Mauricio Verano Merino, Jur Bartels, Mark van den Brand, Tijs van der Storm, and Eugen Schindler. 2021. Projecting Textual Languages. Springer International Publishing, Cham. 197–225. isbn:978-3-030-73758-0 https://doi.org/10.1007/978-3-030-73758-0_7
[14]
Mauricio Verano Merino, Jurgen Vinju, and Mark van den Brand. 2021. DRAFT-What you always wanted to know but could not find about block-based environments. arxiv:2110.03073. arxiv:2110.03073 [Under review at ACM Computing Surveys]
[15]
Leon Moonen. 2001. Generating Robust Parsers Using Island Grammars. In Proceedings of the Eighth Working Conference on Reverse Engineering, WCRE’01, Stuttgart, Germany, October 2-5, 2001, Elizabeth Burd, Peter Aiken, and Rainer Koschke (Eds.). IEEE Computer Society, 13. https://doi.org/10.1109/WCRE.2001.957806
[16]
Patrick Rein, Stefan Ramson, Jens Lincke, Robert Hirschfeld, and Tobias Pape. 2019. Exploratory and Live, Programming and Coding - A Literature Study Comparing Perspectives on Liveness. The Art, Science, and Engineering of Programming, 3, 1 (2019), 1. https://doi.org/10.22152/programming-journal.org/2019/3/1
[17]
Jan Rekers and Wilco Koorn. 1991. Substring parsing for arbitrary context-free grammars. ACM SIGPLAN Notices, 26, 5 (1991), may, 59–66. https://doi.org/10.1145/122501.122505
[18]
Mitchel Resnick, John Maloney, Andrés Monroy-Hernández, Natalie Rusk, Evelyn Eastmond, Karen Brennan, Amon Millner, Eric Rosenbaum, Jay Silver, Brian Silverman, and et al. 2009. Scratch: Programming for All. Commun. ACM, 52, 11 (2009), Nov., 60–67. issn:0001-0782 https://doi.org/10.1145/1592761.1592779
[19]
Gregor Snelting. 1990. How to build LR parsers which accept incomplete input. ACM SIGPLAN Notices, 25, 4 (1990), apr, 51–58. https://doi.org/10.1145/987481.987485
[20]
Tamás Szabó, Markus Voelter, Bernd Kolb, Daniel Ratiu, and Bernhard Schaetz. 2014. Mbeddr: Extensible Languages for Embedded Software Development. Ada Lett., 34, 3 (2014), Oct., 13–16. issn:1094-3641 https://doi.org/10.1145/2692956.2663186
[21]
Mauricio Verano Merino, Tom Beckmann, Tijs van der Storm, Robert Hirschfeld, and Jurgen J. Vinju. 2021. Getting Grammars into Shape for Block-Based Editors. In Proceedings of the 14th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2021). Association for Computing Machinery, New York, NY, USA. 83–98. isbn:9781450391115 https://doi.org/10.1145/3486608.3486908
[22]
Mauricio Verano Merino and Tijs van der Storm. 2020. Block-Based Syntax from Context-Free Grammars. In Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2020). Association for Computing Machinery, New York, NY, USA. 283–295. isbn:9781450381765 https://doi.org/10.1145/3426425.3426948
[23]
Markus Voelter. 2011. Language and IDE Modularization, Extension and Composition with MPS. GTTSE 2011, 7680 (2011), 07, isbn:978-3-642-35991-0 https://doi.org/10.1007/978-3-642-35992-7_11
[24]
Markus Voelter, Tamás Szabó, Sascha Lisson, Bernd Kolb, Sebastian Erdweg, and Thorsten Berger. 2016. Efficient Development of Consistent Projectional Editors Using Grammar Cells. In Proc. SLE (SLE 2016). ACM, New York, NY, USA. 28–40. isbn:9781450344470 https://doi.org/10.1145/2997364.2997365
[25]
Markus Völter, Janet Siegmund, Thorsten Berger, and Bernd Kolb. 2014. Towards User-Friendly Projectional Editors. In SLE 2014. 41–61. https://doi.org/10.1007/978-3-319-11245-9_3
[26]
Tim A. Wagner and Susan L. Graham. 1998. Efficient and Flexible Incremental Parsing. ACM Trans. Program. Lang. Syst., 20, 5 (1998), 980–1013. https://doi.org/10.1145/293677.293678
[27]
Alessandro Warth, James Douglass, and Todd Millstein. 2008. Packrat Parsers Can Support Left Recursion. Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, https://doi.org/10.1145/1328408.1328424

Cited By

View all
  • (2024)Supporting Construction of Domain-Specific Representations in Textual Source CodeProceedings of the 3rd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments10.1145/3689488.3689990(17-28)Online publication date: 18-Oct-2024
  • (2023)Structured Editing for All: Deriving Usable Structured Editors from GrammarsProceedings of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544548.3580785(1-16)Online publication date: 19-Apr-2023
  • (2023)Comparison of Leading Language Parsers – ANTLR, JavaCC, SableCC, Tree-sitter, Yacc, Bison2023 13th International Conference on Software Technology and Engineering (ICSTE)10.1109/ICSTE61649.2023.00009(7-13)Online publication date: 27-Oct-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SLE 2022: Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering
November 2022
278 pages
ISBN:9781450399197
DOI:10.1145/3567512
This work is licensed under a Creative Commons Attribution 4.0 International License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 December 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. partial parsing
  2. structured editing
  3. tree-sitter

Qualifiers

  • Research-article

Funding Sources

Conference

SLE '22
Sponsor:

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)154
  • Downloads (Last 6 weeks)15
Reflects downloads up to 14 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Supporting Construction of Domain-Specific Representations in Textual Source CodeProceedings of the 3rd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments10.1145/3689488.3689990(17-28)Online publication date: 18-Oct-2024
  • (2023)Structured Editing for All: Deriving Usable Structured Editors from GrammarsProceedings of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544548.3580785(1-16)Online publication date: 19-Apr-2023
  • (2023)Comparison of Leading Language Parsers – ANTLR, JavaCC, SableCC, Tree-sitter, Yacc, Bison2023 13th International Conference on Software Technology and Engineering (ICSTE)10.1109/ICSTE61649.2023.00009(7-13)Online publication date: 27-Oct-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media