rascal - Using a map type in Abstract Syntax -


i looking abstract part of parse tree map. want concrete this:

syntax rectype = record: "{" {(ident "=" num) ";"}* "}" 

where let's ident , num , str , int, respectively.

to abstracted like:

public data rectype = record(map[str, int] rec); 

is is possible? getting constructor errors this.

thanks!

you have 2 questions:

  1. why doesn't definition work?
    the names production in grammar have start lower case character, avoid ambiguities in writing reject rules. (similarly, names symbols have start upper case character).
  2. how translate parse tree ast?
    have implode function can use translate parse tree ast. ast has closely model grammar. if i'm correct, won't translate key-value pairs map. have manually write transformation desired ast. (it's not hard, check out this recipe example)

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -