O'Reilly logo

The “Oslo” Modeling Language by Don Box, Brad Lovering, David Langworthy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Languages

A language is a named collection of rules for imposing structure on text.

LanguageDeclaration:
  Attributesopt language Name LanguageBody
LanguageBody:
  { RuleDeclarationsopt }
RuleDeclarations:
  RuleDeclaration
  RuleDeclarations RuleDeclaration

The language that follows recognizes the single text value "Hello World":

module HelloWorld {
    language HelloWorld {
        syntax Main
          = "Hello World";
    }
}

Main Rule

A language may consist of any number of rules. The following language recognizes the single text value "Hello World":

module HelloWorld {
    language HelloWorld {
        syntax Main
          = Hello Whitespace World;
        token Hello
          = "Hello";
        token World
          = "World";
        token Whitespace
          = " ";
    }
}

The three rules Hello, World, and Whitespace recognize the three single ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required