Skip to main content
Engineering LibreTexts

13.6: Regular Expressions and Parsing

  • Page ID
    39553
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    FAQ \(\PageIndex{1}\)

    How can I work with regular expressions?

    Answer

    Load Vassili Bykov’s RegEx package from: www.squeaksource.com/Regex.html

    FAQ \(\PageIndex{2}\)

    Where is the documentation for the RegEx package?

    Answer

    Look at the DOCUMENTATION protocol of RxParser class in the VB-Regex category.

    FAQ \(\PageIndex{3}\)

    Are there tools for writing parsers?

    Answer

    Use SmaCC —the Smalltalk Compiler Compiler. You should install at least SmaCC-lr.13. Load it from www.squeaksource.com/SmaccDevelopment.html. There is a nice tutorial online: www.refactory.com/Software/SmaCC/Tutorial.html.

    FAQ \(\PageIndex{4}\)

    Which packages should I load from SqueakSource SmaccDevelopment to write parsers?

    Answer

    Load the latest version of SmaCCDev — the runtime is already there. (SmaCC-Development is for Squeak 3.8)


    This page titled 13.6: Regular Expressions and Parsing is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.