-- @name DMS Rule Specification Language -- @version 1.0 -- @authors Suman Roychoudhury -- @description This metamodel defines the abstract syntax of RSL package RSL { -- Every class must extend LocatedElement, directly or indirectly. -- This is a technical constraint added by the current -- version of TCS. abstract class LocatedElement { attribute location : String; attribute commentsBefore[*] ordered : String; attribute commentsAfter[*] ordered : String; } abstract class RSLelements extends LocatedElement { reference rsl : RSL oppositeOf rslelems; } class RSL extends LocatedElement { reference domain container : Domain; reference rslelems[*] container : RSLelements oppositeOf rsl; reference ruleset container : RuleSet; } class Domain extends LocatedElement { attribute dname : String; } class Pattern extends RSLelements { reference phead container : PatternHead; attribute ptoken : String; reference ptext container : PatternText; } abstract class PatternText extends LocatedElement { attribute ptext : String; } class SimplePatternText extends PatternText { } class ConditionalPatternText extends PatternText { reference pref container : PatternRef; } class ExternalPattern extends Pattern { attribute dname : String; attribute eptext : String; } class PatternHead extends LocatedElement { attribute name: String; reference params[*] container : PatternParameter; } class PatternParameter extends LocatedElement { attribute name : String; attribute referTo : String; } class Condition extends RSLelements { reference chead container : ConditionHead; attribute ctext : String; } class ConditionHead extends LocatedElement { attribute name: String; reference params[*] container : ConditionParameter; } class ConditionParameter extends LocatedElement { attribute name : String; attribute referTo : String; } class Rule extends RSLelements { attribute rname : String; reference params[*] container : RuleParameter; attribute type : String; reference r_lhs_pattern container : RuleLHS; reference r_rhs_pattern container : RuleRHS; } class RuleParameter extends LocatedElement { attribute name : String; attribute referTo : String; } class RuleLHS extends LocatedElement { reference ruletext container : RuleText; } class RuleRHS extends LocatedElement { reference ruletext container : RuleText; reference condition[*] container: RuleCondition; } abstract class RuleText extends LocatedElement { attribute text : String; } class SimpleRuleText extends RuleText { } class IDRuleText extends RuleText { } class ComplexRuleText extends RuleText { reference pref container : PatternRef; } abstract class RuleCondition extends LocatedElement { attribute lhs:String; reference pref container : PatternRef; } class RuleEqCondition extends RuleCondition { } class RuleNotEqCondition extends RuleCondition { } abstract class Parameter extends LocatedElement { attribute name : String; } class PatternRef extends Parameter { reference params[*] container : Parameter; } class RealParameter extends Parameter { } class RuleSet extends LocatedElement { attribute rsname : String; attribute rname[*] : String; } } package PrimitiveTypes { datatype Boolean; datatype Integer; datatype String; }