[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator f4ba363 031/434: Improved README.md
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator f4ba363 031/434: Improved README.md |
Date: |
Mon, 29 Nov 2021 15:59:02 -0500 (EST) |
branch: externals/parser-generator
commit f4ba363b2537e977b2daf9ea154c0440b004d431
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Improved README.md
---
README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/README.md b/README.md
index 584a450..3a7ea4e 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,51 @@ We use push down transducer (PDT) based algorithms:
## Operator Precedence Grammars
## Floyd-Evans Production Language
+## Grammar
+
+Grammar consists of `N`, `T`, `P` and `S`, where `N` is non-terminals, `T` is
terminals, `P` is productions and `S` is start-production. N, T, P consists of
lists of one or more strings and symbols. When initializing grammar you also
set the number of look-ahead to use, like this:
+
+* N = (S A B C)
+* T = (a b c)
+* P = ((S (A B)) (A (B a) e) (B (C b) C) (C c e))
+* S = S
+
+```elisp
+(parser--set-grammar '((S A B C) (a b c) ((S (A B)) (A (B a) e) (B (C b) C) (C
c e)) S) 2)
+```
+
+### Non-terminals
+
+A non-terminal is either a symbol or a string so `"A"` and `A` are equally
valid.
+
+### Terminals
+
+A terminal is either a symbol or a string so `"{"` and `A` are equally valid.
+
+### Productions
+
+A production consists of a list of at least two elements. The first element is
the left-hand-side (LHS) and should contain at least one element. The
right-hand-side (RHS) consists of the rest of the elements, if there is more
than one list in RHS then each list will be treated as a alternative production
RHS.
+
+Example, production `S -> A | B` is defined as:
+
+``` elisp
+(S A B)
+```
+
+Another example, production `S -> IF "{" EXPRESSION "}" | EXIT` is declared as:
+
+```elisp
+(S (IF "{" EXPRESSION "}") EXIT)
+```
+
+### Look-ahead number
+
+Is a simple integer above zero.
+
+### Start
+
+The start symbol is either a string or a symbol and should exists in the list
of productions as the LHS.
+
## Test
Run in terminal `make clean && make tests && make compile`
- [elpa] externals/parser-generator 7b6c1dc 186/434: First function passing first complex grammar test, (continued)
- [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, 2021/11/29
- [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 <=
- [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
- [elpa] externals/parser-generator 783ea61 227/434: Added translation-symbol-table to incremental parser and translater, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 439d894 228/434: Passed all LR k=1 tests with more work on generalized solution, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 47fb35e 229/434: More work on a more generalized LR Parser, ELPA Syncer, 2021/11/29