With ambiguity in parsing concrete syntax, JSGLR gives up and crashes.
Given the following example:

module mix[E]
exports
  context-free syntax
    "T" "|[" Term     "]|" -> E {cons("ToMetaExpr")}
variables
  "x" [0-9]*  -> Term      {prefer}

And the following constructor for terms:

Term.Apply = <<Term> <Term>> {left, prefer}
Term.Arrow = [[Term] -> [Term]] {right}

Writing the following anywhere in an str file with the mixed stratego + above mentioned language crashes JSGLR:

example: (x0, x1) -> T|[x0 -> x1]|

Oddly enough, it parses as meta variable x being applied to 0. If we wrote T|[x0]| the error becomes that x is not defined although it does not crash JSGLR completely.

The solution is to use lexical syntax and lexical restrictions in the first file defining the module mix. It’s probably the right way of doing it anyways, but we shouldn’t crash this badly anyways.

Submitted by Augusto on 14 May 2014 at 10:48
Crash.log14 May 2014 at 10:51

Log in to post comments