134 - Loglan-A Logical Language

Write a parser to solve this problem.

There are may choices of parser family: LL, LALR, SLR, etc. I rewrote the grammar slightly and implemented a simple (but inefficient) back-tracking parser. Keep in mind that although the problem states: “You can assume that all words will be correctly formed.” This statement is not 100% right. Input data have illegal strings which should be treated as Loglan names.

Creative Commons License
This blog by Che-Liang Chiou is licensed under a Creative Commons Attribution 4.0 International License.