Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The package contains objects representing syntactical blocks of a TM1 rule. All contained classes are derived from a common ancestor TM1RuleToken. The root class contains essential method convert providing the splicing conversion. Derived classes redefine this method to achieve desired splicing conversion. Contained objects are described in following paragraphs.

TM1RuleToken (class in TM1RuleToken.py)

The class represents any string (token) contained within the associated rule with starting and ending position enumerated as number of characters from the rule beginning. This reflects notation in which parser enumerates parsed tokens when calling custom actions in Parser/TM1RuleParser.

...

Method

Usage

update

Method updates intrinsic attributes of the object by text, eventually start and end attributes if provided.

len

Method returns length of text attribute as number of contained characters.

get_text

Method returns original value of text attribute.

convert

Method returns original value of text attribute.

TM1CalcRule (class in TM1CalcRule.py, derived from TM1RuleToken)

This class represents entire TM1 calculation rule or a feeder command. It breaks down the calculation rule or a feeder into two essential parts - area statement (part before equal sign) and statement (part following equal sign, sign inclusive).

...

Method

Usage

convert

Method returns concatenated string composed from result of convert method of associated area_statement and statement.

TM1RuleAreaStatement (class in TM1RuleAreaStatement.py, derived from TM1RuleToken)

The class represents area statement of TM1 calculation rule or a feeder command. The area statement is decomposed to dimensions and hierarchy:element pairs belonging to each of the dimensions. This implies that the rule has to contain full specification of each element in the area statement. Not following this pattern in TM1 development will result in an error during splicing of the rule.

...