emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/parser-generator 4cba5aa 203/434: Made new TODO items


From: ELPA Syncer
Subject: [elpa] externals/parser-generator 4cba5aa 203/434: Made new TODO items
Date: Mon, 29 Nov 2021 15:59:41 -0500 (EST)

branch: externals/parser-generator
commit 4cba5aa354dd4319b8f91f34f25c9a1c5e9a21af
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Made new TODO items
---
 parser-generator-lex-analyzer.el |  2 +-
 parser-generator-lr.el           | 39 ++++++++++++++++++++++++++++-----------
 2 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/parser-generator-lex-analyzer.el b/parser-generator-lex-analyzer.el
index be98fbe..5af5a62 100644
--- a/parser-generator-lex-analyzer.el
+++ b/parser-generator-lex-analyzer.el
@@ -87,7 +87,7 @@
                 (setq look-ahead-length (1+ look-ahead-length))
                 (setq index (1+ index)))))
         (error (error
-                "Lex-analyze failed to peek next look-ahead at %s, error: %s"
+                "Lex-analyze faxiled to peek next look-ahead at %s, error: %s"
                 index
                 (car (cdr error))))))
     (nreverse look-ahead)))
diff --git a/parser-generator-lr.el b/parser-generator-lr.el
index faec337..2e6c207 100644
--- a/parser-generator-lr.el
+++ b/parser-generator-lr.el
@@ -198,7 +198,8 @@
           (parser-generator--debug
            (message "symbol: %s" symbol))
 
-          (let ((prefix-lr-items (parser-generator-lr--items-for-goto lr-items 
symbol)))
+          (let ((prefix-lr-items
+                 (parser-generator-lr--items-for-goto lr-items symbol)))
 
             ;; If a' = GOTO(a, X) is nonempty
             (when prefix-lr-items
@@ -579,7 +580,8 @@
               parser-generator-lex-analyzer--index))
 
       ;; (1) The lookahead string u, consisting of the next k input symbols, 
is determined.
-      (let ((look-ahead (parser-generator-lex-analyzer--peek-next-look-ahead))
+      (let ((look-ahead
+             (parser-generator-lex-analyzer--peek-next-look-ahead))
             (look-ahead-full))
         ;; Save token stream indexes in separate variable if needed later
         (setq look-ahead-full (nreverse look-ahead))
@@ -592,7 +594,8 @@
             (push look-ahead-item look-ahead)))
 
         (let ((table-index (car pushdown-list)))
-          (let ((action-table (gethash table-index 
parser-generator-lr--action-tables)))
+          (let ((action-table
+                 (gethash table-index parser-generator-lr--action-tables)))
 
             (let ((action-match nil)
                   (action-table-length (length action-table))
@@ -634,9 +637,13 @@
                 ;; there is no next input symbol or g(a) is undefined, halt
                 ;; and declare error.
 
+                ;; TODO a and a-full needs to all tokens of look-ahead
+
                 (let ((a (car look-ahead))
                       (a-full (car look-ahead-full)))
-                  (let ((goto-table (gethash table-index 
parser-generator-lr--goto-tables)))
+                  (let ((goto-table
+                         (gethash table-index
+                                  parser-generator-lr--goto-tables)))
                     (let ((goto-table-length (length goto-table))
                           (goto-index 0)
                           (searching-match t)
@@ -679,11 +686,15 @@
                 ;; the pushdown list and return to step (1)
 
                 (let ((production-number (car (cdr action-match))))
-                  (let ((production 
(parser-generator--get-grammar-production-by-number production-number)))
+                  (let ((production
+                         (parser-generator--get-grammar-production-by-number
+                          production-number)))
                     (let ((production-lhs (car production))
                           (production-rhs (car (cdr production)))
                           (popped-items-contents))
-                      (unless (equal production-rhs (list 
parser-generator--e-identifier))
+                      (unless (equal
+                               production-rhs
+                               (list parser-generator--e-identifier)) ;; TODO 
Verify this
                         (let ((pop-items (* 2 (length production-rhs)))
                               (popped-items 0)
                               (popped-item))
@@ -720,8 +731,12 @@
                                 (push part-translation translation))))))
 
                       (let ((new-table-index (car pushdown-list)))
-                        (let ((goto-table (gethash new-table-index 
parser-generator-lr--goto-tables)))
-                          (let ((goto-table-length (length goto-table))
+                        (let ((goto-table
+                               (gethash
+                                new-table-index
+                                parser-generator-lr--goto-tables)))
+                          (let ((goto-table-length
+                                 (length goto-table))
                                 (goto-index 0)
                                 (searching-match t)
                                 (next-index))
@@ -750,10 +765,12 @@
 
                 (setq accept t))
 
-               (t (error (format "Invalid action-match: %s!" 
action-match)))))))))
+               (t (error
+                   (format "Invalid action-match: %s!" action-match)))))))))
     (unless accept
-      (error "Parsed entire string without getting accepting! Output: %s"
-             (reverse output)))
+      (error
+       "Parsed entire string without getting accepting! Output: %s"
+       (reverse output)))
     (when translation
       (setq translation (nreverse translation)))
     (when history



reply via email to

[Prev in Thread] Current Thread [Next in Thread]