Abstract
SLR(1) parser is a kind of important formal syntax parser. Error diagnosis and recovery mechanism is very important to SLR(1) parser. Without error diagnosis and recovery mechanism, SLR(1) parser will be paralyzed when syntax errors are confronted. With error diagnosis and recovery mechanism, syntax errors can be promptly reported and SLR(1) parser can recover from errors as soon as possible when syntax errors are confronted. In this article, two of kinds of methods of constructing error diagnosis and recovery mechanism were introduced and the syntax parsing process of SLR(1) parser with each kind of error diagnosis and recovery mechanism was analyzed by an example. The two of kinds of methods of constructing error diagnosis and recovery mechanism are not only applied to SLR(1) parser but also applied to other LR parser.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.