extension

Syntax

  • extension id --> operations

Parameters

  1. id—(identifier)
    Unique identifier for the extension rule.
  2. operations
    A sequence of shape operations to execute.

Description

The extension keyword marks a rule as an extension point of the current ruleset (i.e. the cga file).

Similarly to attributes, extension rules can be redefined in an import statement. See the import page for detailed information (syntax 6) and examples.

If an extension point should not generate anything by default, just use one NIL operation:

extension Rule --> NIL

Extension rules cannot be defined in styles other than the Default style.

Extension rules with same id but different number of parameters (overloading) are not allowed.

Related

Examples

Redefine an extension rule

// rule.cga

extension Roof(angle) --> roofHip(angle)

Init --> Roof(22)

// main.cga

import rule : "rule.cga"( Roof(angle) --> roofGable(angle) )

Lot --> rule.Init