RIPAL: Responsive and Intuitive Parsing for the Analysis of Language

Pages

LR(0) parse table construction motivations

Background

We've seen various techniques for constructing an LR(0) DFA from a context-free grammar.

In this section, we will provide motivations for developing a process to convert an LR(0) DFA into an LR(0) parse table.

What we've covered so far

Given a context-free grammar, we have the ability to construct an LR(0) DFA from it.

What we're looking for

In order to parse an LR(0) language, we need to construct an LR(0) parser. This type of parser consists of the following two pieces of information:

  1. The general LR(0) parsing algorithm
  2. The LR(0) parse table corresponding to the specified context-free grammar

Closing the gap

Since we already know the LR(0) parsing algorithm which is not language-specific, we just need to be able to construct an LR(0) parse table.

If we can construct an LR(0) parse table from an LR(0) DFA, then we can complete our parser construction process.

Conclusion

We have seen the motivation for developing a process to construct an LR(0) parse table from an LR(0) DFA.

In the next section, we will begin to illustrate this process.


GitHub Repository: https://github.com/bprollinson/ripal

Copyright © 2017 Brendan Rollinson-Lorimer