[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 21164b6 064/434: Added documentation f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 21164b6 064/434: Added documentation for (lr-items) |
Date: |
Mon, 29 Nov 2021 15:59:09 -0500 (EST) |
branch: externals/parser-generator
commit 21164b6781b6b58973d26e988e48bbf19c0cb2e5
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added documentation for (lr-items)
---
README.md | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/README.md b/README.md
index 204af73..8d1196f 100644
--- a/README.md
+++ b/README.md
@@ -130,6 +130,7 @@ Calculate the e-free-first look-ahead number of terminals
of sentential-form `S`
Calculate the look-ahead number of terminals possibly following S.
``` emacs-lisp
+(require 'ert)
(parser--set-grammar '((S A B) (a c d f) ((S (A a)) (A B) (B (c f) d)) S))
(parser--set-look-ahead-number 2)
(should
@@ -138,6 +139,36 @@ Calculate the look-ahead number of terminals possibly
following S.
(parser--follow 'A)))
```
+### LR(k) items - V(S)
+
+Calculate the set of LR(k) items valid for any viable prefix S.
+
+``` emacs-lisp
+(require 'ert)
+(parser--set-grammar '((Sp S) (a b) ((Sp S) (S (S a S b)) (S e)) Sp))
+(parser--set-look-ahead-number 1)
+(should
+ (equal
+ '((S nil nil (a))
+ (S nil (S a S b) (a))
+ (S nil nil (e))
+ (S nil (S a S b) (e))
+ (Sp nil (S) (e)))
+ (parser--lr-items 'e)))
+```
+
+``` emacs-lisp
+(require 'ert)
+(parser--set-grammar '((Sp S) (a b) ((Sp S) (S (S a S b)) (S e)) Sp))
+(parser--set-look-ahead-number 1)
+(should
+ (equal
+ '((Sp (S) nil (e))
+ (S (S) (a S b) (e))
+ (S (S) (a S b) (a)))
+ (parser--lr-items 'S)))
+```
+
## Test
Run in terminal `make clean && make tests && make compile`
- [elpa] externals/parser-generator 5150b91 075/434: Started working on lr-items for grammar function, (continued)
- [elpa] externals/parser-generator 5150b91 075/434: Started working on lr-items for grammar function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 59aea4d 077/434: More tweaking new algorithm, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d0c9663 082/434: Passing test for distinct LR-items for grammar, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7a48197 084/434: Removed obsolete variable, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7fe7318 087/434: Passed test for distinct LR-items for grammar, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator ba95bff 094/434: Started on new algorithm, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 6f524ed 108/434: Various stuff, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 79c06fd 113/434: Added error signal if no parser action or LR-item set is found, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator daf93e0 097/434: Added failing unit test for action tables generation, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 32263b7 074/434: Added cache to function which calculates LR-items for prefix, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 21164b6 064/434: Added documentation for (lr-items),
ELPA Syncer <=
- [elpa] externals/parser-generator ccaf4b5 080/434: More stuff, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator bdbedf4 078/434: Suffixes in LR-items that only contain e-identifier are now set as nil, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 0e075d7 081/434: Fixed issue with algorithm 5.9, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator fe6037b 088/434: Generating valid GOTO-table, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d5284b5 091/434: Added algorithm 5.10, ELPA Syncer, 2021/11/29
- [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