[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 9db14cd 118/434: Added TODO items
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 9db14cd 118/434: Added TODO items |
Date: |
Mon, 29 Nov 2021 15:59:21 -0500 (EST) |
branch: externals/parser-generator
commit 9db14cdd95dba245af7dbd1bfc3dba7142fddbaa
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added TODO items
---
parser-lr.el | 46 +++++++++++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/parser-lr.el b/parser-lr.el
index 0c24c43..4d2fd69 100644
--- a/parser-lr.el
+++ b/parser-lr.el
@@ -477,6 +477,8 @@
;; TODO Add support for lex-analyzer
;; TODO Add support for SDT
;; TODO Add support for semantic-actions
+;; TODO Create hash-tables of parse-state -> action-table, parse-state ->
goto-table
+;; TODO Create hash-table of production-number -> production
(defun parser-lr--parse (input-tape &optional input-tape-index pushdown-list)
"Perform a LR-parse of INPUT-TAPE optionally at INPUT-TAPE-INDEX with
PUSHDOWN-LIST."
(unless input-tape-index
@@ -552,31 +554,37 @@
(cond
((eq action-match '(shift))
+ ;; TODO (a) If f(u) = shift, then the next input symbol, say
a
+ ;; is removed from the input and shifted onto the pushdown
list.
+ ;; The goto function g of the table on top of the pushdown
list
+ ;; is applied to a to determine the new table to be placed on
+ ;; top of the pushdown list. We then return to step(1). If
+ ;; there is no next input symbol or g(a) is undefined, halt
+ ;; and declare error.
+
+ ;; TODO Get next look-ahead here
+
(let ((a (car look-ahead)))
- ;; TODO (a) If f(u) = shift, then the next input symbol,
say a
- ;; is removed from the input and shifted onto the
pushdown list.
- ;; The goto function g of the table on top of the
pushdown list
- ;; is applied to a to determine the new table to be
placed on
- ;; top of the pushdown list. We then return to step(1). If
- ;; there is no next input symbol or g(a) is undefined,
halt
- ;; and declare error.
(push a pushdown-list)
-
- ))
+ ))
((eq (car action-match) 'reduce)
- ;; TODO (b) If f(u) = reduce i and production i is A -> a,
- ;; then 2|a| symbols are removed from the top of the
pushdown
- ;; list, and production number i is placed in the output
- ;; buffer. A new table T' is then exposed as the top table
- ;; of the pushdown list, and the goto function of T' is
applied
- ;; to A to determine the next table to be placed on top
of the
- ;; pushdown list. We place A and this new table on top of
the
- ;; the pushdown list and return to step (1)
-
- )
+ ;; TODO (b) If f(u) = reduce i and production i is A -> a,
+ ;; then 2|a| symbols are removed from the top of the pushdown
+ ;; list, and production number i is placed in the output
+ ;; buffer. A new table T' is then exposed as the top table
+ ;; of the pushdown list, and the goto function of T' is
applied
+ ;; to A to determine the next table to be placed on top of
the
+ ;; pushdown list. We place A and this new table on top of the
+ ;; the pushdown list and return to step (1)
+
+ (let ((production-index (car (cdr action-match))))
+
+ ;; TODO Load production by index here
+
+ ))
((eq action-match '(accept))
;; (d) If f(u) = accept, we halt and declare the string
- [elpa] externals/parser-generator 0304b78 092/434: Added a unit-test to invalidate LR-items, (continued)
- [elpa] externals/parser-generator 0304b78 092/434: Added a unit-test to invalidate LR-items, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 69bfe16 006/434: Removed white-space, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1613e2e 096/434: Byte-compilation and unit tests working after refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 31c7ba7 098/434: Work on function that generates all possible look-aheads, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 53980d4 102/434: More documentation, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 882d725 105/434: Added TODO item, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 65d9ce2 106/434: Fixed a bug with E-FREE-FIRST function and function that validates a set of LR-items, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 343fd72 104/434: Some parts of the action-table is generated, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator b2a0d71 112/434: Passed test for action-table generation, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1c1177f 116/434: More work on LR-parser algorithm, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 9db14cd 118/434: Added TODO items,
ELPA Syncer <=
- [elpa] externals/parser-generator 5784f3f 126/434: Updated README with link to separate document for grammar, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator edfb7b4 131/434: Moved lex-analyzer to separate file, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 8cda060 149/434: Made some functions public, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator c1d3707 150/434: Passing test for including SDT in Produductions, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d36051c 103/434: Parser now creates hash table over productions to their production number, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator e3d3007 109/434: Tweaking of action-table generation for canonical LR-parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d7daabf 111/434: Fixed bug with e-free-first function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2be434c 114/434: Removed obsolete debug messages, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 89d128c 123/434: Added TODO item, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 044f33a 151/434: Added more support for SDT, ELPA Syncer, 2021/11/29