MGrammar Quick Challenge

Given the input text “bar”, modify this language:

module test
{
    language test
    {
        syntax Main = Foo;
        
        syntax Foo 
            =  b:Bar z:Baz?
            => Foo { Bar => b, Baz => z };
        
        token Bar = "bar" => true;
        token Baz = "baz" => true;
    }
}

To produce the graph:

Main[
  Foo{
    Bar => true,
    Baz => false
  }
]

Author: justinmchase

I'm a Software Developer from Minnesota.

%d bloggers like this: