The Microsoft code name "M" Modeling Language Specification - Attributes

November 2009

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

[This documentation targets the Microsoft SQL Server Modeling CTP (November 2009) and is subject to change in future releases. Blank topics are included as placeholders.]

Sections:
1: Introduction to "M"
2: Lexical Structure
3: Text Pattern Expressions
4: Productions
5: Rules
6: Languages
7: Types
8: Computed and Stored Values
9: Expressions
10: Module
11: Attributes
12: Catalog
13: Standard Library
14: Glossary

11 Attributes

Attributes provide metadata which can be used to interpret the language feature they modify.

syntax AttributeSections

    = AttributeSection

    | AttributeSections AttributeSection;

syntax AttributeSection

    = "@{"  Nodes  "}";

11.1 Case Insensitive

The CaseSensitive attribute controls whether tokens are matched with our without case sensitivity. The default value is true. The following language recognizes "Hello World", "HELLO World", and "hELLO WorLD".

module HelloWorld {

    @{CaseInsensitive[true]}

    language HelloWorld {

        syntax Main

          = Hello World;

        token Hello

          = "Hello";

        token World

          = "World";

        interleave Whitespace

          = " ";

    }

}

11.2 Classification

The classification annotation drives colorization in language services processors. The following classifications are supported:

@{Classificaton["ClassificationKind"]}

syntax ClassificationKinds

    = Comment

    | Delimiter

    | Identifier

    | Keyword

    | Literal

    | Operator

    | String

    | Text

    | Unknown

    | Whitespace;

An example follows:

@{Classification["Operator"]}  token Plus = "+";

@{Classificaiton["Keyword"]}   token ModuleToken = "module";

@{Classificaiton["Delimiter"]} token Comma = ",";

11.3 Format Scope

@{FormatScope["Open"]}

@{FormatScope["Close"]}

11.4 Nest

@{Nest}

Show: