Fix some typos

This commit is contained in:
2019-11-06 22:27:52 -08:00
parent 654239e29f
commit 2cce2859bb
3 changed files with 8 additions and 8 deletions

View File

@@ -48,7 +48,7 @@ are fairly simple - one or more digits is an integer, a few letters together
are a variable name. In order to be able to efficiently break text up into
such tokens, we restrict ourselves to __regular languages__. A language
is defined as a set of strings (potentially infinite), and a regular
language for which we can write a __regular expression__ to check if
language is one for which we can write a __regular expression__ to check if
a string is in the set. Regular expressions are a way of representing
patterns that a string has to match. We define regular expressions
as follows:
@@ -77,7 +77,7 @@ Let's see some examples. An integer, such as 326, can be represented with \\([0-
This means, one or more characters between 0 or 9. Some (most) regex implementations
have a special symbol for \\([0-9]\\), written as \\(\\setminus d\\). A variable,
starting with a lowercase letter and containing lowercase or uppercase letters after it,
can be written as \\(\[a-z\]([a-z]+)?\\). Again, most regex implementations provide
can be written as \\(\[a-z\]([a-zA-Z]+)?\\). Again, most regex implementations provide
a special operator for \\((r_1+)?\\), written as \\(r_1*\\).
So how does one go about checking if a regular expression matches a string? An efficient way is to
@@ -115,8 +115,8 @@ represent numbers directly into numbers, and do other small tasks.
So, what tokens do we have? From our arithmetic definition, we see that we have integers.
Let's use the regex `[0-9]+` for those. We also have the operators `+`, `-`, `*`, and `/`.
`-` is simple enough: the corresponding regex is `-`. We need to
preface our `/`, `+` and `*` with a backslash, though, since they happen to also be modifiers
The regex for `-` is simple enough: it's just `-`. However, we need to
preface our `/`, `+` and `*` with a backslash, since they happen to also be modifiers
in flex's regular expressions: `\/`, `\+`, `\*`.
Let's also represent some reserved keywords. We'll say that `defn`, `data`, `case`, and `of`