[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 5784f3f 126/434: Updated README with l
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 5784f3f 126/434: Updated README with link to separate document for grammar |
Date: |
Mon, 29 Nov 2021 15:59:24 -0500 (EST) |
branch: externals/parser-generator
commit 5784f3f8940b6ccecf48865bd87a18f3a5a0b6de
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Updated README with link to separate document for grammar
---
README.md | 57 +---------------------
.../Deterministic Right Parser for LRk Grammars.md | 57 ++++++++++++++++++++++
2 files changed, 58 insertions(+), 56 deletions(-)
diff --git a/README.md b/README.md
index 6a7c9af..c77777c 100644
--- a/README.md
+++ b/README.md
@@ -24,62 +24,7 @@ We use push down transducer (PDT) based algorithms:
#### LL(k)
#### Deterministic Shift-Reduce Parsing
#### LR(k)
-#### Deterministic Right Parser for LR(k) Grammars
-
-A valid LR-item for a viable prefix has this structure:
-
-``` emacs-lisp
-(A B C L)
-```
-
-Example with grammar with production: S -> SaSb and S is non-terminal and a, b
are terminals. Look-ahead number: 1
-
-``` emacs-lisp
-(S nil (S a S b) (a))
-```
-
-* A is the production LHS
-* B, C is parts of the production RHS, if the dot is the left B is nil and C
is the entire RHS. If the dot is at the right then B is the production RHS and
C is nil, otherwise B and C contains parts of the RHS
-* L is the terminal look-ahead
-
-### LR items for prefix (S)
-
-Calculate the set of LR items valid for any viable prefix S.
-
-### Functions
-
-``` 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)
-(parser--process-grammar)
-
-(should
- (equal
- '((S nil (S a S b) (a))
- (S nil (S a S b) (e))
- (S nil nil (a))
- (S nil nil (e))
- (Sp nil (S) (e)))
- (parser--lr-items-for-prefix '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)
-(parser--process-grammar)
-
-(should
- (equal
- '((S (S) (a S b) (a))
- (S (S) (a S b) (e))
- (Sp (S) nil (e)))
- (parser--lr-items-for-prefix 'S)))
-```
-
+#### [Deterministic Right Parser for LR(k) Grammars](docs/Deterministic Right
Parser for LRk Grammars.md)
#### Formal Shift-Reduce Parsing Algorithms
#### Simple Precedence Grammars
#### Extended Precedence Grammars
diff --git a/docs/Deterministic Right Parser for LRk Grammars.md
b/docs/Deterministic Right Parser for LRk Grammars.md
new file mode 100644
index 0000000..d449001
--- /dev/null
+++ b/docs/Deterministic Right Parser for LRk Grammars.md
@@ -0,0 +1,57 @@
+# Deterministic Right Parser for LR(k) Grammars
+
+A valid LR-item for a viable prefix has this structure:
+
+``` emacs-lisp
+(A B C L)
+```
+
+Example with grammar with production: S -> SaSb and S is non-terminal and a, b
are terminals. Look-ahead number: 1
+
+``` emacs-lisp
+(S nil (S a S b) (a))
+```
+
+* A is the production LHS
+* B, C is parts of the production RHS, if the dot is the left B is nil and C
is the entire RHS. If the dot is at the right then B is the production RHS and
C is nil, otherwise B and C contains parts of the RHS
+* L is the terminal look-ahead
+
+### LR items for prefix (S)
+
+Calculate the set of LR items valid for any viable prefix S.
+
+### Functions
+
+``` 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)
+(parser--process-grammar)
+
+(should
+ (equal
+ '((S nil (S a S b) (a))
+ (S nil (S a S b) (e))
+ (S nil nil (a))
+ (S nil nil (e))
+ (Sp nil (S) (e)))
+ (parser--lr-items-for-prefix '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)
+(parser--process-grammar)
+
+(should
+ (equal
+ '((S (S) (a S b) (a))
+ (S (S) (a S b) (e))
+ (Sp (S) nil (e)))
+ (parser--lr-items-for-prefix 'S)))
+```
+
+[Back to start](../../../)
- [elpa] externals/parser-generator 69bfe16 006/434: Removed white-space, (continued)
- [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, 2021/11/29
- [elpa] externals/parser-generator 5784f3f 126/434: Updated README with link to separate document for grammar,
ELPA Syncer <=
- [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
- [elpa] externals/parser-generator 96f128f 155/434: More various stuff, ELPA Syncer, 2021/11/29