A text-based syntax completion method using LR parsing and its evaluation

被引:1
|
作者
Sasano, Isao [1 ]
Choi, Kwanghoon [2 ]
机构
[1] Shibaura Inst Technol, Dept Comp Sci & Engn, 3-7-5 Toyosu,Koto Ku, Tokyo 1358548, Japan
[2] Chonnam Natl Univ, Dept Software Engn, 77 Yongbong Ro, Gwangju 61186, South Korea
关键词
Syntax completion; LR parsing; Sentential forms; Reduction; Integrated development environments;
D O I
10.1016/j.scico.2023.102957
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This paper presents a text-based syntax completion method that uses an LR parser. We propose formal definitions of candidate text to be completed based on the sentential forms. Moreover, we design basic algorithms for computing candidate texts through reductions in the LR parsing. This is unlike most existing methods, wherein the definition of candidates that are intended to be generated are given informally. In addition, this is unlike grammar transformation approaches that use LR parsers and is a currently burdensome task. The proposed method allows LR parsers to be adopted without modification and a syntax completion system to be built without incurring efforts. For practical purposes, we extended the basic algorithms using a new definition of refined candidates and a new strategy. The extended algorithms can compute more useful candidates for realistic programming language grammars than those of existing ones; Further, we implemented the algorithms on an Emacs server to demonstrate the feasibility of their application. We evaluated the extended algorithm with three real-world programming languages, Small Basic, C, and Haskell. The extended algorithm computes half of all candidates in less than or equal to 0.2 seconds and 89.2% in approximately one second in the evaluation while computing the remaining candidates took a long time. We discuss its evaluation in detail.& COPY; 2023 Elsevier B.V. All rights reserved.
引用
收藏
页数:28
相关论文
共 50 条
  • [1] A Text-Based Syntax Completion Method using LR Parsing
    Sasano, Isao
    Choi, Kwanghoon
    [J]. PEPM '21: PROCEEDINGS OF THE 2021 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2021, : 32 - 43
  • [2] Ranked Syntax Completion With LR Parsing
    Choi, Kwanghoon
    Hwang, Sooyeon
    Moon, Hyeon-Ah
    Sasano, Isao
    [J]. 39TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, SAC 2024, 2024, : 1242 - 1251
  • [3] An Approach to Generate Text-Based IDEs for Syntax Completion Based on Syntax Specification
    Sasano, Isao
    [J]. PROCEEDINGS OF THE 2020 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION (PEPM '20), 2020, : 38 - 44
  • [4] A text-based approach to feature modelling: Syntax and semantics of TVL
    Classen, Andreas
    Boucher, Quentin
    Heymans, Patrick
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2011, 76 (12) : 1130 - 1143
  • [5] Using Naive Bayes Method to Classify Text-based Email
    Kang, LanLan
    Chen, Ruey-Shun
    Chen, Yeh-Cheng
    Cao, WenLiang
    [J]. 2018 9TH INTERNATIONAL CONFERENCE ON PARALLEL ARCHITECTURES, ALGORITHMS AND PROGRAMMING (PAAP 2018), 2018, : 94 - 98
  • [6] Communicative NGOMSL: Development of an Evaluation Method for a Text-Based Communication System
    Lee, Sangwon
    Koubek, Richard J.
    [J]. INTERNATIONAL JOURNAL OF HUMAN-COMPUTER INTERACTION, 2011, 27 (11) : 1013 - 1036
  • [7] Using concept hierarchies in text-based image retrieval: A user evaluation
    Petrelli, Daniela
    Clough, Paul
    [J]. ACCESSING MULTILINGUAL INFORMATION REPOSITORIES, 2006, 4022 : 297 - 306
  • [8] A hybrid method for text-based sentiment analysis
    Thanh Le
    [J]. 2019 6TH INTERNATIONAL CONFERENCE ON COMPUTATIONAL SCIENCE AND COMPUTATIONAL INTELLIGENCE (CSCI 2019), 2019, : 1392 - 1397
  • [9] Comparative evaluation of two approaches for retweet clustering: A text-based method and graph-based method
    Uchida, Kazuki
    Toriumi, Fujio
    Sakaki, Takeshi
    [J]. WEB INTELLIGENCE, 2019, 17 (04) : 271 - 284
  • [10] A method for automatic program inversion based on LR(0) parsing
    Glück, R
    Kawabe, M
    [J]. FUNDAMENTA INFORMATICAE, 2005, 66 (04) : 367 - 395