Modestas Valauskas

Results 117 comments of Modestas Valauskas

# Technique: Moving LR(k) to runtime [This](https://mdaines.github.io/grammophone/?s=UyAtPiBhIEEgRCBhIAp8IGIgQSBEIGIgCnwgYSBCIEQgYiAKfCBiIEIgRCBhLiAKQSAtPiBhLgpCIC0+IGEuCkQgLT4gYy4=) LR(2) grammar contains a reduce/reduce conflict in its LR(1) automaton and is used as an example for doing LR(k) at runtime in the...

# Transformation: ? [This](http://www.cs.man.ac.uk/~pjj/complang/g2lr.html) mentions a [yacc-grammar-snippet](https://mdaines.github.io/grammophone/?s=eWFjYyAtPiBydWxlCiAgICAgfCB5YWNjIHJ1bGUKICAgICAuCnJ1bGUgLT4gcnVsZWJvZHkKICAgICB8IHJ1bGVib2R5ICI7IgogICAgIC4KcnVsZWJvZHkgLT4gUlVMRU5BTUUgJzonIGFsdAoJIHwgcnVsZWJvZHkgInwiIGFsdAoJIC4KYWx0IC0+CiAgICB8IGFsdCBUT0tFTgogICAgfCBhbHQgUlVMRU5BTUUKICAgIC4=) grammar for a language that is LR(2), but the grammar is not. This is also being discussed in Xin Chen's dissertation ([here](https://hyacc.sourceforge.net/files/chenx_dissertation.pdf) on...

# Class: LR(closed)/LR(infinite) Chris Clark suggested a grammar class that he calls LR(closed) [here](https://compilers.iecc.com/comparch/article/08-12-102). An example grammar can be found [on grammophone](https://mdaines.github.io/grammophone/?s=UyAtPiBhIEEgYSAKfCBiIEEgYiAKfCBhIEIgYgp8IGIgQiBhLgpBIC0+IEEgYS4KQiAtPiBCIGEuCkEgLT4gYS4KQiAtPiBhLg==). Quote: ``` Here is a grammar that isn't...

# Minimal Grammar Example: LR(2) [Here's](https://mdaines.github.io/grammophone/?s=UyAtPiBCIGEgYi4KUyAtPiBDIGEgYy4KQiAtPiB6LgpDIC0+IHou) possibly the simplest possible LR(2) grammar ([source](https://compilers.iecc.com/comparch/article/08-12-087)).

# Minimal Grammar Example: LR(1) ~[Here's](https://mdaines.github.io/grammophone/?s=UyAtPiBhIEEgYSAKfCBiIEEgYiAKfCBhIEIgYgp8IGIgQiBhLgpBIC0+IGEgYS4KQiAtPiBhIGEu)~ possibly the simplest possible LR(1) grammar that is not LALR(1) which doesn't introduce inefficient state splits in the canonical LR(1) construction. ~([source](https://compilers.iecc.com/comparch/article/08-12-102))~ [Smaller](https://mdaines.github.io/grammophone/?s=UyAtPiBhIEEKICAgfCBiIEEgYiAKICAgfCBhIEIgYgogICB8IGIgQi4KQSAtPiBhLgpCIC0+IGEu)

@mdaines I hope I didn't bother you too much with these examples. _I'm wondering, is it possible for you to unsubscribe from notifications for this issue, or, since you've been...

# Grammar Example LR(k) for any k Here's a simple formula for constructing a sample LR(k) grammar for k > 0 ([source](https://compilers.iecc.com/comparch/article/08-12-099)): ``` // Here c^k means the concatenation of...

# Metric: Ill-foundedness Here is an example of an "ill-founded" grammar as defined by the booze-tools project. It seems to be similar to the "unrealizable nonterminals" metric that grammophone exposes....

# Testcase: GLR hidden left recursion termination issues A naive implementation of GLR would have trouble with certain grammars containing epsilon productions. This is one: [on grammophone](https://mdaines.github.io/grammophone/?s=SSAtPiBTLgpTIC0+IEUgUyBhLgpTIC0+IGIuCkUgLT4gLg==) This is known...

# Tutorial: LR(1) The [LALRPOP](https://github.com/lalrpop/lalrpop) project provides an excellent explanation of how to implement LR(1) through the lane tracing method: First example: [on grammophone](https://mdaines.github.io/grammophone/?s=UyAtPiBHMC4KRzAgLT4gWCAiYyIKICAgfCBZICJkIi4KWCAtPiAiZSIgWAogICB8ICJlIi4KWSAtPiAiZSIgWQogICB8ICJlIi4=) & [the explanation](https://github.com/lalrpop/lalrpop/tree/master/lalrpop/src/lr1/lane_table#first-example-grammar-g0) Second example: [on...