-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
In previous chapters, I have already spent some time discussing how regular expressions, as a language, can represent problems that would otherwise be very difficult to express in other languages.
The root of that distinction is in the very nature of the language, where you are not specifying instructions to be executed in sequence, as is the case with imperative languages. But additionally, unlike functional languages, you’re not specifying things in terms of functions being applied either.
Instead, you are specifying rules that describe the different states that the program may find itself in, and how to adapt to those states in order to complete the requested execution.
In the case of regular expressions, the language starts with the assumption that there is a string that is being operated on and a stack of cursors with associated captures, which store parts of the matched text. The final result is, unconditionally, a description of whether...
Change the font size
Change margin width
Change background colour