Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Implementation Notes: Property Sheets

fearthecowboy edited this page Jun 20, 2011 · 1 revision

A property sheet is a collection of rules.

Note: the Property sheet was originally patterened off of CSS, but been expanded since I wrote it.

Syntax Notes: Property sheets support both C#-style comments:

        // double slash line comments
        /*  slash-star box comments */ 

Values can be expressed with or without quotes. If the value contains something other than letters, numbers, dashes, dots or underscores, the value must be quoted.

Property Sheets support two styles of quotes, C-style (where embedded quotes need to be escaped with backslashes) and C# @-symbol quotes (support mutlilines, only needs to have double quotes escaped with a double quote):

All are valid values:

    simple-value
    1.0
    "quoted string with spaces"
    @"a multiline
peice 
of text";

Rule

Each rule has a Selector and a collection of properties.

Selectors

A given Rule's Selector can have of four parts (at least one!):

Name[Parameter].Class#Id

If not specified, Name is defaulted to an asterisk ( * )

Each of the four parts are essentially a cosmetic value that you can use to filter rules on, and how you use them in the property sheet is entirely up to you.

###Properties Each property consists of a name and a value.

Property names can contain letters, numbers, dashes, underscores.

Property names can be duplicated in the same rule-it is up to the developer to decide how to treat them.

The properties of a given rule are contained in a pair of matching braces, followed by a semicolon:

myrule {
      property-name: property-value;
      property-name-1: another-property-value;
      /* etc */
};

There are four types of property values:

####Simple Values Simple Values are simply that-a single string value.

myrule {
      property-name: property-value;
      // or 
      property-name: "Quoted property Value";
};

####Compound Values Compound Values have an LValue and an RValue

myrule {
      property-name: LValue=RValue;
      property-name: Color=Blue;
      // or 
      property-name: tree="hard wood";
};

####Expressions Expressions are really similar to simple values; they are simply provided for a kind of syntactic sugar for the property sheet.

myrule {
      property-name: (any value I'd like);
      property-name: (100+200);
};

####Collections Collections are sets of data in a single property.

Collections can be simple:

myrule {
    source-groups: {
        "source files",
        "header files",
        "resource files",
        "text files"
    };
};

Or Compound:

myrule {
    source: c-files =  {
        "*.cpp",
        "*.c"
    };
};
Clone this wiki locally