Predictive parsing-based ABNF syntax analyzer (6) -- Situation where multiple symbols are connected by the abnfparser grammar Parser (such as rule and CRLF)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.