Abstract
Compiler construction is a common course in many computer science degrees. Although there are different lexer and parser generation tools, Lex/Yacc is still the preferred option in multiple universities. ANTLR is a powerful compiler construction tool that, among other features, provides parser generation. Although ANTLR has been used in the implementation of different languages and software tools, it is not as common as Lex/Yacc in compiler construction courses. Therefore, we conduct an experiment to evaluate the impact of using ANTLR instead of Lex/Yacc in courses where students build a compiler. To that aim, we divide the year-3 students of a Programming Language Design and Implementation course into two random groups. The course is delivered using Lex/Yacc for one group and ANTLR for the other one. Different values are measured to statistically compare both approaches, including the work completed by the students, the number of hours it took them to finish different tasks, their anonymous opinion about the parser generator used, and their performance. The use of ANTLR shows significant benefits in most of the evaluations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison Wesley, Boston (2006)
Parr, T.J., Quong, R.W.: ANTLR: a predicated-LL(k) parser generator. Softw.: Pract. Exp. 25(7), 789–810 (1995)
Comparison of parser generators. https://en.wikipedia.org/wiki/Comparison_of_parser_generators. Accessed 19 Oct 2021
Shanghai Consultancy, Global Ranking of Academic Subjects, Computer Science. https://www.shanghairanking.com/rankings/gras/2021/RS0210. Accessed 19 Oct 2021
Quacquarelli Symonds, QS World University Rankings - Computer Science. https://content.qs.com/wur/Computer_Science.htm. Accessed 19 Oct 2021
Times Higher Education, World University Rankings 2021 by subject: Computer Science. https://www.timeshighereducation.com/world-university-rankings/2021/subject-ranking/computer-science#!/page/0/length/25/sort_by/rank/sort_order/asc/cols/stats. Accessed 19 Oct 2021
Parr, T.: The Definitive ANTLR 4 Reference, 2nd edn. Pragmatic Bookshelf, Raleigh (2013)
Parr, T., Fisher, K.: LL(*): the foundation of the ANTLR parser generator. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, pp. 425–436. Association for Computing Machinery, New York (2011)
Parr, T., Harwell, S., Fisher, K.: Adaptive LL(*) parsing: the power of dynamic analysis. In: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2014, pp. 579–598. Association for Computing Machinery, New York (2014)
DeRemer, F., Pennello, T.: Efficient computation of LALR(1) look-ahead sets. ACM Trans. Program. Lang. Syst. 4(4), 615–649 (1982)
Levine, J.R., Mason, T., Brown, D.: Lex & Yacc, 2nd edn. O’Reilly & Associates Inc., USA (1992)
McCauley, R.: A bounty of accessible language translation tools. ACM SIGCSE Bull. 33(2), 14–15 (2001)
Ortin, F., Zapico, D., Cueva, J.M.: Design patterns for teaching type checking in a compiler construction course. IEEE Trans. Educ. 50, 273–283 (2007)
Ortin, F., Redondo, J.M., Quiroga, J.: Design and evaluation of an alternative programming paradigms course. Telemat. Inform. 34(6), 813–823 (2017)
Ortin, F., Redondo, J.M., Perez-Schofield, J.B.G.: Efficient virtual machine support of runtime structural reflection. Sci. Comput. Program. 74(10), 836–860 (2009)
Georges, A., Buytaert, D., Eeckhout, L.: Statistically rigorous java performance evaluation. In: Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-oriented Programming Systems and Applications, OOPSLA, pp. 57–76. ACM, New York (2007)
Grosch, J.: Generators for high-speed front-ends. In: Hammer, D. (ed.) CCHSC 1988. LNCS, vol. 371, pp. 81–92. Springer, Heidelberg (1989). https://doi.org/10.1007/3-540-51364-7_6
Chen, X.: Hyacc parser generator. http://hyacc.sourceforge.net. Accessed 19 Oct 2021
Chen, X., Pager, D.: Full LR(1) parser generator Hyacc and study on the performance of LR(1) algorithms. In: Proceedings of the 4th International C* Conference on Computer Science and Software Engineering, C3S2E 2011, pp. 83–92. Association for Computing Machinery, New York (2011)
da Cruz, D., Varanda, M.J., Verón, M., Fonseca, R., Henriques, P.R.: Comparing generators for language-based tools. Technical report, Departamento de Informatica, Universidade do Minho, CCTC, Braga, Portugal (2007)
Fowler, M.: Language workbenches: the killer-app for domain specific languages?. http://martinfowler.com/articles/languageWorkbench.html. Accessed 19 Oct 2021
Dmitriev, S.: Language Oriented Programming: The Next Programming Paradigm. https://resources.jetbrains.com/storage/products/mps/docs/Language_Oriented_Programming.pdf. Accessed 19 Oct 2021
Erdweg, S., et al.: Evaluating and comparing language workbenches: existing results and benchmarks for the future. Comput. Lang. Syst. Struct. 44, 24–47 (2015)
Klint, P., van der Storm, T., Vinju, J.: On the impact of DSL tools on the maintainability of language implementations. In: Proceedings of the 10th Workshop on Language Descriptions, Tools and Applications, LDTA 2010, pp. 1–9. Association for Computing Machinery, New York (2010)
Ortin, F., Zapico, D., Quiroga, J., Garcia, M.: TyS - a framework to facilitate the implementation of object-oriented type checkers. In: Proceedings of the 26th International Conference on Software Engineering and Knowledge Engineering, SEKE 2014, pp. 150–155 (2014)
Ortin, F., Zapico, D., Quiroga, J., Garcia, M.: Automatic generation of object-oriented type checkers. Lect. Notes Softw. Eng. 2(4), 288–293 (2014)
Wimmer, C., Würthinger, T.: Truffle: a self-optimizing runtime system. In: Leavens, G.T. (ed.) Conference on Systems, Programming, and Applications: Software for Humanity, SPLASH 2012, pp. 13–14. ACM, Tucson (21–25 October 2012)
Acknowledgments
This work has been partially funded by the Spanish Department of Science, Innovation, and Universities: project RTI2018-099235-B-I00. The authors have also received funds from the University of Oviedo through its support to official research groups (GR-2011-0040).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Ortin, F., Quiroga, J., Rodriguez-Prieto, O., Garcia, M. (2022). Evaluation of the Use of Different Parser Generators in a Compiler Construction Course. In: Rocha, A., Adeli, H., Dzemyda, G., Moreira, F. (eds) Information Systems and Technologies. WorldCIST 2022. Lecture Notes in Networks and Systems, vol 470. Springer, Cham. https://doi.org/10.1007/978-3-031-04829-6_30
Download citation
DOI: https://doi.org/10.1007/978-3-031-04829-6_30
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-04828-9
Online ISBN: 978-3-031-04829-6
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)