예제 #1
0
 public override String Type(SequenceCheckingEnvironment env)
 {
     string ruleName = TypesHelper.ExtractSrc(SourceVarType);
     return env.TypeOfTopLevelEntityInRule(ruleName, ElementName);
 }
예제 #2
0
        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");
        }