Parsing Teaching Tools Report
Parsing Teaching Tools Report
ANONYMOUS AUTHOR(S)
We have explored four such teaching tools, viz. ParseIT, LL(1), LR(0), and JFLAP, and present their comparison in
this paper. JFLAP, LL(1), and LR(0) target practical aspects of parsing through visualizations, whereas ParseIT uses a
question-answer-based approach to help students understand theoretical concepts of parsing. The intention behind
each approach is to make the compiler design course interactive and easy to understand for the students. We now
describe each of these tools in detail.
1.2 JFLAP
JFLAP [11] project started at Rensselaer Polytechnic Institute as a collection of tools. Later it was moved to Duke
University. Users can download it from [10]. JFLAP is a visualization tool and it is not only suitable for teaching parsing
but, also provides the features that can be used in other CS courses. It supports different kinds of parsers, from which we
experimented with SLR(1), LL(1), CYK, and brute-force parsers. We have listed below the features of JFLAP according
to our experience while using the tool:
(1) Installation: JFLAP is a jar executable application, users do not have to install the application. But for executing
JFLAP, users must have Java JDK and JRE installed in the system.
Manuscript submitted to ACM 1
2 Anon.
(2) How to use: For running JFLAP, users have to run the “java -jar JFLAP.jar” command in the console from the
same folder where JFLAP.jar is present. It will open a window with many options, like “Finite Automaton”, “Moore
Machine”, “Mealy Machine”, etc. For parsing select the “Grammar” option which will open a separate window,
where users can enter the grammar. After entering the grammar users can select the corresponding parser in the
“Input” option.
(3) Available options: After selecting a parser, if users select brute-force or CYK parser it only gives the option to
input a string and visualize the parsing process. If users select LL(1) or SLR(1) parser, it gives the option to manually
fill first set, follow set, parse table, etc, and an option to automatically fill this data. If input grammar is not parsable
by the parser then, users can still have the option of parsing the string for SLR(1) and brute-force parser but users
do not get this option for LL(1) and CYK parser.
(4) Supported Parsers: JFLAP supports a lot of parsers including LL(1), SLR(1), brute-force parser, multiple brute-force
parser, user control parser, CYK parser, and multiple CYK parser. We used this tool for LL(1), SLR(1), brute-force
parser, and CYK parser.
(5) Grammar Format: There is a specific format in which it takes the input grammar which is very similar to
Backus–Naur form, the format used in classrooms. There are few restrictions on the set of terminals and non-
terminals, it treats every small alphabet as a terminal and every capital alphabet as a non-terminal. Users cannot
define terminals and non-terminals of more than one alphabet and also each symbol on RHS of a production rule
should not be space-separated. ‘𝜖’ symbol is represented using the ‘𝜆’ symbol.
Manuscript submitted to ACM
Tools to Teach Parsing 3
(6) Error Reporting and Messages: If grammar is not parsable by a parser, JFLAP reports it in different ways for
different parsers. In the case of LL(1), it gives a popup reporting that grammar is not LL(1) and lets users proceed to
parse table construction. In the case of SLR(1), it does not report but highlights the conflicted cells and users can
choose the entry for these cells. While parsing it informs about the steps taken and also highlights the corresponding
cells of the parse table. In the CYK parser, if the grammar does not accept any string it simply reports it and does
not move to the parsing option. Brute-force parser never reports anything about the grammar and always provides
users with the option to parse the string.
(7) Visualizations: It shows the visualizations of the parse trees. It also shows viable prefixes automaton for SLR(1)
parsers. But as the number of states increases, the automaton is not easy to visualize due to clutter. Along with the
parse tree, it also shows derivation and the inverted tree.
(8) Auto-String Generation: It doesn’t auto-generate any string for showing parsing but users have to input a string
for which they can see the complete parsing steps, parse tree, and derivation tree.
(6) Error Reporting and Messages: ParseIT generates hint questions based on user input and does not do any
reporting or provide any messages. It generates a string and shows its parsing steps as hints for parse table problems.
ParseIT can detect the non-determinism and left-recursion in the grammar. In case of incompatible grammar, ParseIT
simply prints the message in the console and exits for Parsing Moves options.
(7) Visualizations: ParseIT does not show any visualizations for any option but shows the step-by-step parsing of the
string.
(8) Auto-String Generation: It can auto-generate the input string and show the parsing steps. Users can also input a
string for which they have to complete the parsing steps.
ParseIT++ is a web based tool build on top of ParseIT. It is available at [5]. It tries to cover the drawbacks of ParseIT,
as unlike ParseIT it provides GUI and visualizations. It also uses same question-answer based approach and can help
users to understand the parsing better. ParseIT++ tries to gamify the understanding of parsing process so that it could
become more interesting and easy for users.
Table 2 provides a summary of the features of the teaching tools we explored. Data presented for Parse Table
and Parsing features is collected in the cases of incompatible input grammar. Data presented for Visualization and
Auto-String Generation feature is collected for general cases. Table 3 lists the parsers supported by each tool.
REFERENCES
[1] Nimisha Agarwal. 2016. ParseIT. https://cse.iitk.ac.in/users/nimisha/parseit/index.html
[2] Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman. 2006. Compilers: Principles, Techniques, and Tools (2nd Edition). Addison-Wesley
Longman Publishing Co., Inc., USA.
[3] David Beazley. 2022. PLY (Python Lex Yacc). (2022). https://www.dabeaz.com/ply/ last accessed Jan 2022.
[4] Bison. 2022. GNU Bison. https://www.gnu.org/software/bison/ last accessed Jan 2022.
[5] Tushar Gautam. 2022. ParseIT. http://parseit.te2ch.com
[6] Scott E Hudson, Frank Flannery, C Scott Anaian, Dan Wang, and Andrew Appel. 2006. CUP parser generator for Java, 1997. http://www2.cs.tum.
edu/projects/cup/. (2006).
[7] Stephen C. Johnson. 1979. Yacc: Yet Another Compiler-Compiler. Technical Report.
[8] Amey Karkare and Nimisha Agrawal. 2016. ParseIT: A Tool for Teaching Parsing Techniques. In Proceedings of the 47th ACM Technical Symposium
on Computing Science Education (SIGCSE ’16). 590. https://doi.org/10.1145/2839509.2850513
[9] T. J. Parr and R. W. Quong. 1995. ANTLR: A Predicated LL(k) Parser Generator. Softw. Pract. Exper. 25, 7 (jul 1995), 789–810. https://doi.org/10.1002/
spe.4380250705
[10] S. H. Rodger. 2022. JFLAP. https://www.jflap.org/ last accessed Jan 2022.
[11] Susan H. Rodger, Eric Wiebe, Kyung Min Lee, Chris Morgan, Kareem Omar, and Jonathan Su. 2009. Increasing Engagement in Automata Theory
with JFLAP. In Proceedings of the 40th ACM Technical Symposium on Computer Science Education (Chattanooga, TN, USA) (SIGCSE ’09). Association
for Computing Machinery, New York, NY, USA, 403–407. https://doi.org/10.1145/1508865.1509011
[12] Zak Kincaid and Shaowei Zhu. 2022. LL(1) Tool. https://www.cs.princeton.edu/courses/archive/spring20/cos320/LL1/ last accessed Jan 2022.
[13] Zak Kincaid and Shaowei Zhu. 2022. LR(0) Tool. https://www.cs.princeton.edu/courses/archive/spring20/cos320/LR0/ last accessed Jan 2022.