Abstract
Grammars are the proverbial Swiss-army chain saw for parsing.
This is a preview of subscription content, access via your institution.
Buying options
Notes
- 1.
Like a Swiss-army knife, but with much more power.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
At this point it is crucial that identifier does not parse its surrounding whitespace. Hence the principle that tokens do not care about whitespace, and the rules that call those tokens parse the whitespace.
- 8.
In this case, this would be harmless, because no other rule could match the rest of the variable, leading to a parse error nonetheless. But in more complicated cases, this kind of unintended backtracking can lead to errors that are very puzzling for the maintainer of the grammar.
- 9.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Moritz Lenz
About this chapter
Cite this chapter
Lenz, M. (2017). Parsing with Grammars. In: Parsing with Perl 6 Regexes and Grammars. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3228-6_9
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3228-6_9
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3227-9
Online ISBN: 978-1-4842-3228-6
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books