Property Model Language Reference |
The Property Model Library is a runtime library (see Property Model Engine). The Property Model Language and Property Model Parser are facilities provided to make it easier to assemble an adobe::sheet_t from a simple declaration. This manual describes the Property Model Language.
The language is divided into three parts, Lexical Conventions, Expressions, and Sheet Declarations. The first two parts are shared by the Layout Library Language, and describe in the Expression Reference.
Sheet Declarations
Property Model Grammar
translation_unit = { sheet_specifier }. sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" [trail_comment]. qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl | constant_set_decl | logic_set_decl | invariant_set_decl | external_set_decl. interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. external_set_decl = "external" ":" { [lead_comment] identifier end_statement }. interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. input_cell_decl = identifier [initializer] end_statement. output_cell_decl = named_decl. constant_cell_decl = identifier initializer end_statement. logic_cell_decl = named_decl | relate_decl. invariant_cell_decl = named_decl. relate_decl = [conditional] "relate" "{" relate_expression relate_expression { relate_expression } "}" [trail_comment]. relate_expression = [lead_comment] identifier { "," identifier } define_expression end_statement. named_decl = identifier define_expression end_statement. initializer = ":" expression. conditional = "when" "(" expression ")". define_expression = "<==" expression. end_statement = ";" [trail_comment]. keywords += "sheet" | "interface" | "input" | "output" | "constant" | "logic" | "invariant" | "unlink" | "when" | "relate" | "external".
Cell Access Specifiers
Initialization
Advanced Features
External Types and Functions
Although there are a set of types provided by the language, the type system is extensible to support any C++ type through external functions and values introduced from outside of the system. For example, if an external function were provided to supply an image, other functions could be provided to operator on that image. External functions can be provided through the virtual machine API [ref]. An external function to get an image from a URL might look this:
struct image_type { }; // some image structure image_type get_image_for_url(const char* url); // Some external function to get an image adobe::value_t get_image(const adobe::array_t& parameters) { return adobe::value_t(get_image(parameters[0].get<std::string>().c_str())); }
A function to operate on the image might look like this:
void guassian_blur(image_type& image); // Some external operation adobe::value_t blur_image(const adobe::array_t& parameters) { image_type result = parameters[0].get<image_type>(); guassian_blur(result); return result; }
After registering these functions with the virtual machine - the following expressions are valid:
get_image("http:\\local\my_image.jpg") == get_image("http:\\local\my_other_image.jpg") blur_image(get_image("http:\\local\my_image.jpg"))