Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2a-42 committed Jun 16, 2024
1 parent 6488751 commit 59c2b53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ By default the generated parser uses [Logos](https://github.com/maciejhirsz/logo
* **Easy to Debug:** The generated parser is easy to understand and can be debugged with standard tools.

#### Why LL(1) and not a more general CFL or PEG parser?
* **Error Resillience:** It seems to be the case that LL parsers are better suited than LR parsers for generating meaningful syntax trees from incomplete source code.
* **Error Resilience:** It seems to be the case that LL parsers are better suited than LR parsers for generating meaningful syntax trees from incomplete source code.
* **Runtime Complexity:** More general parsers such as GLR/GLL or ALL(*) can have a runtime complexity of $O(n^3)$ or $O(n^4)$ respectively for certain grammars. With LL(1) parsers you are guaranteed to have linear runtime complexity as long as your semantic actions and predicates have a constant runtime complexity.
* **Ambiguity:** The decision problem of whether an arbitrary context free grammar is ambiguous is undecidable. Warnings of a general parser generator therefore may contain false positives. In the worst case ambiguities may be found at runtime.
The PEG formalism just defines ambiguity away, which may cause the parser to parse a different language than you think.
Expand Down Expand Up @@ -178,7 +178,7 @@ The following special regex patterns for rules are recognized.
A rule that has direct left recursion.
The rule must consist of a top level alternation.
There may be multiple recursive and non-recursive branches.
A node in the syntax tree is only created if a recursive branch is taken.
A node in the syntax tree is not created if a non-recursive branch is taken that consists of a single rule reference.

**Example:**
```antlr
Expand Down Expand Up @@ -234,7 +234,7 @@ The following special regex patterns for rules are recognized.
- **Right Recursive Forwarding:**

The rule must consist of a top level alternation with at least one right recursive branch and at least one branch that references a rule.
A node in the syntax tree is only created if a right recursive branch is taken.
A node in the syntax tree is not created if a non-recursive branch is taken that consists of a single rule reference.

**Example:**
```antlr
Expand Down

0 comments on commit 59c2b53

Please sign in to comment.