Exemple #1
0
        private Select VisitSelect(Select select)
        {
            JoinStatementList newJoinStatementList = new JoinStatementList();

            int numJoinStatements = 0;

            for (int i = 0, n = select.joinStatementList.Length; i < n; i++)
            {
                if (select.joinStatementList[i] != null)
                    numJoinStatements++;

                if (numJoinStatements <= 64)
                    newJoinStatementList.Add((JoinStatement)this.VisitJoinStatement(select.joinStatementList[i]));
                else
                    this.HandleError(select.joinStatementList[i], Error.TooManyJoinStatements);
            }

            select.joinStatementList = newJoinStatementList;

            return select;
        }
Exemple #2
0
        private Select VisitSelect(Select select)
        {
            JoinStatementList newJoinStatementList = new JoinStatementList();

            for (int i = 0, n = select.joinStatementList.Length; i < n; i++)
                newJoinStatementList.Add((JoinStatement)this.VisitJoinStatement(select.joinStatementList[i]));

            select.joinStatementList = newJoinStatementList;

            return select;
        }
Exemple #3
0
        private Select VisitSelect(Select select)
        {
            JoinStatementList newJoinStatementList = new JoinStatementList();

            for (int i = 0, n = select.joinStatementList.Length; i < n; i++)
            {
                JoinStatement js = this.VisitJoinStatement(select.joinStatementList[i]);
                js.visible = select.visible;
                newJoinStatementList.Add(js);
            }

            select.joinStatementList = newJoinStatementList;

            return select;
        }
Exemple #4
0
 public Select(bool endState, bool deterministic, bool visible, JoinStatementList joinStatementList, SourceContext sourceContext)
     : this(endState, deterministic, visible, joinStatementList)
 {
     this.SourceContext = sourceContext;
 }
Exemple #5
0
 public Select(bool endState, bool deterministic, bool visible, JoinStatementList joinStatementList)
     : this()
 {
     this.validEndState = endState;
     this.deterministicSelection = deterministic;
     this.visible = visible;
     this.joinStatementList = joinStatementList;
 }
Exemple #6
0
 public Select(bool endState, bool deterministic, JoinStatementList joinStatementList)
     : this(endState, deterministic, false, joinStatementList)
 {
 }
Exemple #7
0
 public JoinStatementList Clone()
 {
     int n = this.length;
     JoinStatementList result = new JoinStatementList(n);
     result.length = n;
     JoinStatement[] newElements = result.elements;
     for (int i = 0; i < n; i++)
         newElements[i] = this.elements[i];
     return result;
 }
Exemple #8
0
        private Select VisitSelect(Select select)
        {
            if (select == null) return null;

            PushSelectStatement(select);

            JoinStatementList newJoinStatementList = new JoinStatementList();

            int timeoutIndex = -1;

            for (int i = 0, n = select.joinStatementList.Length; i < n; i++)
            {
                if (select.joinStatementList[i].joinPatternList[0] is TimeoutPattern)
                {
                    if (timeoutIndex >= 0)
                    {
                        // If we've already seen a "timeout" join statement, then skip
                        // subsequent ones and report an error.
                        HandleError(select.joinStatementList[i], Error.TooManyTimeouts);
                        continue;
                    }
                    timeoutIndex = i;
                }

                JoinStatement newJoinStatement = (JoinStatement)this.VisitJoinStatement(select.joinStatementList[i]);

                if (newJoinStatement != null)
                    newJoinStatementList.Add(newJoinStatement);
            }

            select.joinStatementList = newJoinStatementList;

            // If a timeout is present and it isn't already last, move it to the
            // end of the list. This will be helpful during code generation.
            if (timeoutIndex >= 0 && timeoutIndex != (select.joinStatementList.Length - 1))
            {
                JoinStatement temp;
                temp = select.joinStatementList[select.joinStatementList.Length - 1];
                select.joinStatementList[select.joinStatementList.Length - 1] = select.joinStatementList[timeoutIndex];
                select.joinStatementList[timeoutIndex] = temp;
            }

            if (select.joinStatementList.Length == 1)
                select.deterministicSelection = true;

            PopSelectStatement();

            if (select.joinStatementList.Length == 0)
                return null;

            return select;
        }