From 302b82e66aecddd0590643a0d72729b2b2c37f30 Mon Sep 17 00:00:00 2001 From: lll <88920608+cfbreathing@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:32:43 +0800 Subject: [PATCH] add note --- _posts/2024-02-26-cs-143.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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