diff --git a/_posts/2024-02-26-cs-143.md b/_posts/2024-02-26-cs-143.md index 066cb79..007d512 100644 --- a/_posts/2024-02-26-cs-143.md +++ b/_posts/2024-02-26-cs-143.md @@ -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: @@ -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 @@ -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