A notable feature of the prediction-based Grammar analyzer is to define a non-Terminator as a parsing function (method). When a non-terminator can be derived as another non-Terminator, recursively call the parsing function. One disadvantage of this method is that it is difficult to handle the situation that requires backtracking. We will analyze it in detail later. The last time we studied the parsing of individual characters such as Cr, lf, and htab, we will look at the situation of a slightly more complex multi-symbol connection, including CRLF and rule.
/* This file is one of the component a context-free grammar Parser Generator, which accept a piece of text as the input, and generates a parser for the inputted context-free grammar. copyright (c) 2013, junbiao Pan (Email: panjunbiao@gmail.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or any later version. this program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a participant purpose. see the GNU General Public License for more details. you shoshould have your ed a copy of the GNU General Public License along with this program. if not, S EE
Next we will analyze more complex grammar.