From 016e8c76b8c03676299097ac4fdc50f8da49b47a Mon Sep 17 00:00:00 2001 From: ar6496 <78793916+ar6496@users.noreply.github.com> Date: Fri, 26 Feb 2021 20:03:53 +0530 Subject: [PATCH] Update WORKLOG.md --- WORKLOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WORKLOG.md b/WORKLOG.md index deaf23f..79a3ee8 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -7,7 +7,8 @@

## Indentation: - - A stack is maintained by the lexer to keep track of indentations. A count is accumulated for the number of whitespace characters before the first token. If the count changes from the previous line count, a stack operation is performed. If count increases, another value is added to the stack. If count decreases, the topmost value is popped from the stack. The file: src/main/jflex/chocopy/pa1/ChocoPy.jflex, lines from 100 to 182, contain the code for the same. Line 270 of the same file deals with additional dedents in case the input ends in an indented state. + - A stack is maintained by the lexer to keep track of indentations. A count is accumulated for the number of whitespace characters before the first token. If the count changes from the previous line count, a stack operation is performed. If count increases, another value is added to the stack. If count decreases, the topmost value is popped from the stack. + - The file: src/main/jflex/chocopy/pa1/ChocoPy.jflex, lines from 100 to 182, contain the code for the same. Line 270 of the same file deals with additional dedents in case the input ends in an indented state. ## Challenges: - Shift-reduce errors while parsing the grammar. One approach to fix is to change the grammar. We chose to fix this issue by adding a precedence as in the case of expr by adding right precedence for if and else.