Abstract
In chapter 5 we use finite automata for text parsing. As noted, there are rather simple structures (e.g., nested comments) that cannot be parsed with finite automata. There is a more powerful formalism called context-free grammars that is often used when finite automata are not enough. In section 15.1 we define context-free grammars and consider a general polynomial parsing algorithm. However, this algorithm is not fast enough to be practical, and in the next two sections we consider faster (linear time) algorithms that can be used for some classes of context-free grammars, called recursive-descent parsing (section 15.2) and LL-parsing (section 15.3).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
Shen, A. (2010). Context-free grammars. In: Algorithms and Programming. Springer Undergraduate Texts in Mathematics and Technology. Springer, New York, NY. https://doi.org/10.1007/978-1-4419-1748-5_15
Download citation
DOI: https://doi.org/10.1007/978-1-4419-1748-5_15
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4419-1747-8
Online ISBN: 978-1-4419-1748-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)