[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator d7ad86c 200/434: Added TODO item for L
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator d7ad86c 200/434: Added TODO item for LRk Canonical Parser |
Date: |
Mon, 29 Nov 2021 15:59:40 -0500 (EST) |
branch: externals/parser-generator
commit d7ad86c5951ef3cdd68500ca60ebcbb446a9e579
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added TODO item for LRk Canonical Parser
---
parser-generator-lr.el | 5 +----
test/parser-generator-lr-test.el | 12 +++++++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/parser-generator-lr.el b/parser-generator-lr.el
index b5b9896..e6c95db 100644
--- a/parser-generator-lr.el
+++ b/parser-generator-lr.el
@@ -117,13 +117,10 @@
(progn
;; Reduction by first production
;; of empty look-ahead means grammar
has been accepted
- (message "accept of %s" u)
(push (list u 'accept) action-table)
(setq found-accept t)
(setq found-action t))
- (message "no accept of %s, p: %s" u
production-number)
-
;; save reduction action in action table
(push (list u 'reduce production-number)
action-table)
(setq found-action t))))))))))
@@ -138,7 +135,7 @@
(when action-table
(push (list goto-index (sort action-table
'parser-generator--sort-list)) action-tables))))
(unless found-accept
- (error "Failed to find a accept action in generated action-tables: %s
from goto-tabbles: %s" action-tables goto-tables))
+ (error "Failed to find an accept action in the generated
action-tables!"))
(setq action-tables (nreverse action-tables))
(setq parser-generator-lr--action-tables (make-hash-table :test 'equal))
(let ((table-length (length action-tables))
diff --git a/test/parser-generator-lr-test.el b/test/parser-generator-lr-test.el
index 56f717a..a994bcd 100644
--- a/test/parser-generator-lr-test.el
+++ b/test/parser-generator-lr-test.el
@@ -311,7 +311,9 @@
(parser-generator-set-grammar '((Sp S) ("a" "b") ((Sp S) (S (S "a" S "b"))
(S e)) Sp))
(parser-generator-set-look-ahead-number 1)
(parser-generator-process-grammar)
- (parser-generator-lr-generate-parser-tables)
+ (let ((lr-items (parser-generator-lr-generate-parser-tables)))
+ (message "lr-items: %s" (parser-generator--hash-values-to-list lr-items t))
+ )
(message "goto-tables: %s" (parser-generator--hash-values-to-list
parser-generator-lr--goto-tables t))
(message "action-tables: %s" (parser-generator--hash-values-to-list
parser-generator-lr--action-tables t))
(setq
@@ -370,9 +372,13 @@
(parser-generator-set-grammar '((Sp S) ("a" "b") ((Sp S) (S (S "a" S "b"))
(S e)) Sp))
(parser-generator-set-look-ahead-number 2)
(parser-generator-process-grammar)
- (let ((lr-items (parser-generator--hash-values-to-list
(parser-generator-lr-generate-parser-tables) t)))
- (message "lr-items: %s" lr-items)
+ (let ((lr-items (parser-generator-lr--generate-goto-tables)))
+ (message "lr-items: %s" (parser-generator--hash-values-to-list lr-items t))
+
+ ;; TODO Fix so that lr-item (Sp (S) nil (e)) instead is (Sp (S) nil (e e))
+
(message "goto-tables: %s" (parser-generator--hash-values-to-list
parser-generator-lr--goto-tables t))
+ (parser-generator-lr--generate-action-tables lr-items)
;; TODO Should generate accept somewhere in this action-table
(message "action-tables: %s" (parser-generator--hash-values-to-list
parser-generator-lr--action-tables t)))
(setq
- [elpa] externals/parser-generator e2f4347 183/434: More work on f-set generation with e-identifiers, (continued)
- [elpa] externals/parser-generator e2f4347 183/434: More work on f-set generation with e-identifiers, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 046e239 187/434: Passing first 3 complex tests for first, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 4811521 185/434: Various tweakings, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7b6c1dc 186/434: First function passing first complex grammar test, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7e96f9d 188/434: Passing all unit tests for first function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7a90a75 190/434: Updated max interation count, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 796b41b 192/434: Passed unit tests for follow function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 33634dd 193/434: Passing all tests after refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator ba8e501 194/434: Added failing first test with complex case, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 71d213b 201/434: More work on Canonical LR(k) Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d7ad86c 200/434: Added TODO item for LRk Canonical Parser,
ELPA Syncer <=
- [elpa] externals/parser-generator 7a175a8 205/434: Passed first unit test for grammar prefixes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 517ed12 212/434: Passing some more unit tests after refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator f4ba363 031/434: Improved README.md, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 744fdf6 174/434: Added TODO item, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d360e8a 176/434: Added failing unit test for FIRST function with starting e-identifier, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator c1cdf20 197/434: Fixed issue with lex analyzer reached end of input, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 446cbe9 217/434: Refactored unit tests and separated k=2 case, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1818b9d 199/434: Added error in action-tables generation if no accept action is found, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 54857e4 220/434: Added failing unit test for translation via LRk, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator a96ab3a 222/434: More debugging LR k > 1, ELPA Syncer, 2021/11/29