17.7: Chapter Summary

Deep into Pharo · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    From LibreTexts, under CC BY-SA 3.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    17.7: Chapter Summary

    This concludes our tutorial of PetitParser. We have reviewed the following points:

    • A parser is a composition of multiple smaller parsers combined with combinators.
    • To parse a string, use the method parse:.
    • To know if a string matches a grammar, use the method matches:.
    • The method flatten returns a String from the result of the parsing.
    • The method ==> performs the transformation given in the block given in parameter.
    • Compose parsers (and create a grammar) by subclassing PPCompositeParser.
    • Test your parser by subclassing PPCompositeParserTest.

    For a more extensive view of PetitParser, its concepts and implementation, the Moose book1 and Lukas Renggli’s PhD2 have both a dedicated chapter.


    1. http://www.themoosebook.org/book/internals/petit-parser
    2. http://scg.unibe.ch/archive/phd/renggli-phd.pdf

    This page titled 17.7: Chapter Summary was last modified on Mon, 26 Jul 2021 15:16:56 GMT and is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform.