Skip to content

Commit

Permalink
add note
Browse files Browse the repository at this point in the history
  • Loading branch information
cfbreathing committed Feb 26, 2024
1 parent 7346d72 commit 302b82e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posts/2024-02-26-cs-143.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ Parser relies on token distinctions
- Choice of tokens depends on
- language
- design of parser
>[!example]
>Recall
>```
>\tif (i == j)\n\t\tz = 0;\n\telse\n\t\tz = 1;
>```
>Useful tokens for this expression:
> `Integer, Keyword, Relation, Identifier, Whitespace, (, ), , ;`
{: .prompt-tip }
2. Describe which strings belong to each token
Recall:
Expand Down Expand Up @@ -195,7 +195,6 @@ FORTRAN rule: Whitespace is insignificant
Historical footnote: FORTRAN Whitespace rule motivated by inaccuracy of punch card operators
>[!example]
>
>```fortran
>DO 5 I = 1,25
Expand All @@ -206,6 +205,7 @@ Historical footnote: FORTRAN Whitespace rule motivated by inaccuracy of punch ca
>DO 5 I = 1.25
>```
>This is a assignment. The first toekn is `DO5I`
{: .prompt-tip }
Two important points:
1. The goal is to partition the string. This is implemented by reading left-to-right, recognizing one token at a time
Expand Down

0 comments on commit 302b82e

Please sign in to comment.