public override String Type(SequenceCheckingEnvironment env) { string ruleName = TypesHelper.ExtractSrc(SourceVarType); return env.TypeOfTopLevelEntityInRule(ruleName, ElementName); }
public override void Check(SequenceCheckingEnvironment env) { base.Check(env); // check children if(!SourceVarType.StartsWith("match<")) throw new Exception("SequenceExpression MatchAccess can only access a variable of type match<rulename>"); string ruleName = TypesHelper.ExtractSrc(SourceVarType); // throws exceptions in case the rule does not exist, or it does not contain an element of the given name string elementType = env.TypeOfTopLevelEntityInRule(ruleName, ElementName); if(elementType == "") throw new Exception("Internal failure, static type of element in match type not known"); }