{"title":"Development of Lightweight Parsers with Different Go Language Granularity","authors":"D. S. Drozdov, S. S. Mikhalkovich","doi":"10.3103/S0005105525700426","DOIUrl":null,"url":null,"abstract":"<p>This article considers an approach to creating a family of lightweight grammars for the Go language, with a special symbol Any denoting the skipped part of the program [1]. A formal definition of a more granular grammar is given, along with examples illustrating the increase in grammar rule granularity. The efficiency of the constructed lightweight parsers is analyzed in terms of memory usage and runtime on seven industrial repositories. It is shown that increasing the granularity of the grammar does not lead to a significant increase in parser resource consumption and varies only slightly depending on repository type and coding style in Go. Furthermore, the advantages of using lightweight grammars with Any over full grammars are summarized. An example of using a lightweight grammar to determine code complexity is presented. The results can also be applied to estimate the parser’s contribution to overall resource consumption, e.g., in tasks such as code binding and project markup.</p>","PeriodicalId":42995,"journal":{"name":"AUTOMATIC DOCUMENTATION AND MATHEMATICAL LINGUISTICS","volume":"58 6 supplement","pages":"S333 - S342"},"PeriodicalIF":0.5000,"publicationDate":"2025-04-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"AUTOMATIC DOCUMENTATION AND MATHEMATICAL LINGUISTICS","FirstCategoryId":"1085","ListUrlMain":"https://link.springer.com/article/10.3103/S0005105525700426","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
Abstract
This article considers an approach to creating a family of lightweight grammars for the Go language, with a special symbol Any denoting the skipped part of the program [1]. A formal definition of a more granular grammar is given, along with examples illustrating the increase in grammar rule granularity. The efficiency of the constructed lightweight parsers is analyzed in terms of memory usage and runtime on seven industrial repositories. It is shown that increasing the granularity of the grammar does not lead to a significant increase in parser resource consumption and varies only slightly depending on repository type and coding style in Go. Furthermore, the advantages of using lightweight grammars with Any over full grammars are summarized. An example of using a lightweight grammar to determine code complexity is presented. The results can also be applied to estimate the parser’s contribution to overall resource consumption, e.g., in tasks such as code binding and project markup.
期刊介绍:
Automatic Documentation and Mathematical Linguistics is an international peer reviewed journal that covers all aspects of automation of information processes and systems, as well as algorithms and methods for automatic language analysis. Emphasis is on the practical applications of new technologies and techniques for information analysis and processing.