public Outcome Start(Group group, Vector vector = null)
 {
     Outcome outcome = new Outcome(group, Status.Start, vector, null, this.nesting);
     Add(outcome);
     nesting++;
     return outcome;
 }
 public Outcome Log(Group group, Status status, Vector vector, string message, params object[] args)
 {
     Outcome outcome = new Outcome(group, status, vector, string.Format(message, args), this.nesting);
     
     Add(outcome);
     return outcome;
 }
 public Outcome End(Group group)
 {
     nesting--;
     Outcome outcome = new Outcome(group, Status.End, null, null, this.nesting);
     Add(outcome);
     
     return outcome;
 }
        public void IterateGroup(Group group, DDGrp ddgroup, string msgType)
        {
            DataDictionary.CheckHasNoRepeatedTags(group);

            int lastField = 0;
            foreach(KeyValuePair<int, Fields.IField> kvp in group)
            {
                Fields.IField field = kvp.Value;
                if (lastField != 0 && field.Tag == lastField)
                    throw new RepeatedTag(lastField);
                CheckHasValue(field);

                if (null != this.Version && this.Version.Length > 0)
                {
                    CheckValidFormat(field);

                    if (ShouldCheckTag(field))
                    {
                        CheckValidTagNumber(field.Tag);
                        CheckValue(field);

                        CheckIsInGroup(field, ddgroup, msgType);
                        CheckGroupCount(field, group, msgType);
                    }
                }
                lastField = field.Tag;
            }

            // check contents of each nested group
            foreach (int groupTag in group.GetGroupTags())
            {
                for (int i = 1; i <= group.GroupCount(groupTag); i++)
                {
                    Group g = group.GetGroup(i, groupTag);
                    DDGrp ddg = ddgroup.GetGroup(groupTag);
                    IterateGroup(g, ddg, msgType);
                }
            }
        }
示例#5
0
 private static void ComposeGroup(Group node, StringBuilder expr) {
     expr.Append(s_LParens);
     ComposeExpression(node.GroupNode, expr);
     expr.Append(s_RParens);
 }
示例#6
0
 public void Stop(Group group)
 {
     Outcome outcome = reporter.End(group);
     if (LogOutcome != null) LogOutcome(outcome);
 }
示例#7
0
 public void Start(Group group, Vector vector)
 {
     Outcome outcome = reporter.Start(group, vector);
     if (LogOutcome != null) LogOutcome(outcome);
 }
示例#8
0
 public void Log(Group group, Status status, Vector vector, string msg, params object[] args)
 {
     Outcome outcome = reporter.Log(group, status, vector, msg, args);
     if (LogOutcome != null) LogOutcome(outcome);
 }
示例#9
0
        //>> PrimaryExpr ::= Literal | Number | VariableReference | '(' Expr ')' | FunctionCall
        private AstNode ParsePrimaryExpr(AstNode  qyInput) {
            Debug.Assert(IsPrimaryExpr(this.scanner));
            AstNode  opnd = null;
            switch (this.scanner.Kind) {
            case XPathScanner.LexKind.String:
                opnd = new Operand(this.scanner.StringValue);
                NextLex();
                break;
            case XPathScanner.LexKind.Number:
                opnd = new Operand(this.scanner.NumberValue);
                NextLex();
                break;
            case XPathScanner.LexKind.Dollar:
                NextLex();
                CheckToken(XPathScanner.LexKind.Name);
                opnd = new Variable(this.scanner.Name, this.scanner.Prefix);
                NextLex();
                break;
            case XPathScanner.LexKind.LParens:
                NextLex();
                opnd = ParseExpresion(qyInput);
                if (opnd.TypeOfAst != AstNode.QueryType.ConstantOperand) {
                    opnd = new Group(opnd);
                }
                PassToken(XPathScanner.LexKind.RParens);
                break;
            case XPathScanner.LexKind.Name :
                if (this.scanner.CanBeFunction && ! IsNodeType(this.scanner)) {
                    opnd = ParseMethod(null); 
                }
                break;
            }
			Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex.");
            return opnd;
        }
示例#10
0
 public Outcome Log(Group group, Status status)
 {
     return new Outcome(group, status, null, null, this.nesting);
 }
示例#11
0
 public Outcome Log(Group group, Status status, Vector vector)
 {
     return new Outcome(group, status, vector, null, this.nesting);
 }
示例#12
0
 public bool Contains(Group group, Status kind)
 {
     return this.Where(group, kind).Count() > 0;
 }
示例#13
0
 public IEnumerable<Outcome> Where(Group group, Status kind)
 {
     return Outcomes.Where(outcome => outcome.Type == group && outcome.Kind == kind);
 }