Modestas Valauskas

Results 117 comments of Modestas Valauskas

# Testcase: LR(1) disambiguation related incompleteness The [IELR paper](https://www.sciencedirect.com/science/article/pii/S0167642309001191) claims: > In this paper, we demonstrate that a well known algorithm described by David Pager and implemented in Menhir, the...

# Transformation: Deduplication A very simple LR(2) grammar [on grammophone](https://mdaines.github.io/grammophone/?s=QSAtPiBCIGMgZCB8IEUgYyBmLgpCIC0+IHggeS4KRSAtPiB4IHku) with [some prose (source)](http://www.cs.man.ac.uk/~pjj/cs2121/ho/node19.html#sec:BorE) that shows how to [rewrite that grammar to LR(0)](https://mdaines.github.io/grammophone/?s=QSAtPiBCb3JFIGMgZCB8IEJvckUgYyBmLgpCb3JFIC0+IHggeS4=) by removing duplicates. This grammar shows that...

# Grammar Examples [This repo](https://github.com/nvasudevan/lr-grammars) contains A TON of random LR(k) grammars and a bunch of LR(1) grammars in bison syntax.

# Class: LR-regular (LRR) This is an example grammar that is meant to be LRR (LR-regular): [on grammophone](https://mdaines.github.io/grammophone/?s=cHJvZ3JhbSAtPiBzdGF0ZW1lbnQgCnwgcHJvZ3JhbSAiOyIgc3RhdGVtZW50LgoKc3RhdGVtZW50IC0+IGFzc2lnbl9zdGF0IAp8IGp1bXAgCnzCoGlkZW50ICI6IiBzdGF0ZW1lbnQuCgphc3NpZ25fc3RhdCAtPiBpZGVudCAiPSIgYXJpdGhfZXhwIAp8IGlkZW50ICI9PSIgc2V0X2V4cC4KCmp1bXAgLT4gaWYgcmVsYXRpb24gdGhlbiBnb3RvIGlkZW50LgoKcmVsYXRpb24gLT4gYXJpdGhfZXhwICI9IiBhcml0aF90ZXJtIAp8IHNldF9leHAgIj09IiBzZXRfZXhwLgoKYXJpdGhfZXhwIC0+IGFyaXRoX2V4cCAiKyIgYXJpdGhfdGVybQp8wqBhcml0aF9leHAgIi0iIGFyaXRoX3Rlcm0KfCBhcml0aF90ZXJtLgoKYXJpdGhfdGVybSAtPiBhcml0aF90ZXJtICIqIiBhcml0aF9wcmltYXJ5CnwgYXJpdGhfcHJpbWFyeS4KCmFyaXRoX3ByaW1hcnkgLT4gIigiIGFyaXRoX2V4cCAiKSIKfCBpZGVudAp8IGNvbnN0LgoKc2V0X2V4cCAtPiBzZXRfZXhwICIrIiBzZXRfdGVybQp8IHNldF90ZXJtLgoKc2V0X3Rlcm0gLT4gc2V0X3Rlcm0gIioiIHNldF9mYWN0b3IKfCBzZXRfZmFjdG9yLgoKc2V0X2ZhY3RvciAtPiBzZXRfZmFjdG9yICItIiBzZXRfcHJpbWFyeQp8IHNldF9wcmltYXJ5LgoKc2V0X3ByaW1hcnkgLT4gIigiIHNldF9leHAgIikiCnwgaWRlbnQKfCBjb25zdC4KCmlkZW50IC0+IGlkZW50IGxldHRlciB8IGxldHRlci4KCmNvbnN0IC0+IGNvbnN0IGRpZ2l0IHwgZGlnaXQuCgpsZXR0ZXIgLT4gYSB8wqBiLgoKZGlnaXQgLT4gIjAiIHwgIjEiLg==). It is a proper superclass of LR(k). That grammar comes from the...

I love that xlabel attribute trick in your example, thank you for sharing, I haven't seen that one before.

> [...] adding a diagram that shows the relation used to find unreachable nonterminals. I have some ideas to improve that sort of thing, I'm currently handling this by looking...

Here's a manually annotated LR(0) automaton with the includes relations from the issue description: [Grammophone grammar](https://mdaines.github.io/grammophone/?s=UyAtPiBBLgpBIC0+IGIgQi4KQSAtPiBhLgpCIC0+IGMgQy4KQiAtPiBjIEMgZi4KQyAtPiBkIEEu) In green, the includes relation, in blue, the nontrivial includes SCC, in red, a...

A different idea: adding edges between edges to the SVG could be a post-processing step after graphviz has rendered the SVG. The last time I checked, the SVGs rendered by...

And, to get a better picture of what read edges might look like in grammophone, here's the read annotated LR(0) automaton (See https://github.com/mdaines/grammophone/issues/26#issuecomment-1657521978 for the grammar). In green, the read...

I'm investigating a POC for https://github.com/mdaines/grammophone/issues/33#issuecomment-1659055438 - edges can be given custom ids ``` digraph { a -> b [id="foo"]; } ``` this results in an SVG that has the...