MGrammar Quick Challenge

by Justin Chase 25. June 2009 08:41

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
  }
]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

MGrammar | Oslo

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

Justin Chase

sweetest hat ever

I am a software developer from St. Paul MN and I work for Microsoft on the Expression team. This blog is about various technical topics I find myself encountering here and there. In addition to loving WPF and Xaml and Expression studio in general I have a special interest in DSLs, programming languages and games.

RecentComments

Comment RSS

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar