Publication Date
Fall 2022
Degree Type
Master's Project
Degree Name
Master of Science (MS)
Department
Computer Science
First Advisor
Thomas Austin
Second Advisor
Robert Chun
Third Advisor
Chris Pollett
Keywords
parser combinator, compilers
Abstract
Parser combinators have been a popular parsing approach in recent years. Compared with traditional parsers, a parser combinator has both readability and maintenance advantages.
This project aims to construct a lightweight parser construct library for Javascript called Jparsec. Based on the modular nature of a parser combinator, the implementation uses higher-order functions. JavaScript provides a friendly and simple way to use higher-order functions, so the main construction method of this project will use JavaScript's lambda functions. In practical applications, a parser combinator is mainly used as a tool, such as parsing JSON files.
In order to verify the utility of parser combinators, this project uses a parser combinator to parse a partial Lua grammar. Lua is a widely used programming language, serving as a good test case for my parser combinator.
Recommended Citation
Zhong, Sida, "Jparsec - a parser combinator for Javascript" (2022). Master's Projects. 1197.
DOI: https://doi.org/10.31979/etd.ky8u-z7qr
https://scholarworks.sjsu.edu/etd_projects/1197