bool IntermNodePatternMatcher::match(TIntermBinary *node, TIntermNode *parentNode)
{
    // L-value tracking information is needed to check for dynamic indexing in L-value.
    // Traversers that don't track l-values can still use this class and match binary nodes with
    // this variation of this method if they don't need to check for dynamic indexing in l-values.
    ASSERT((mMask & kDynamicIndexingOfVectorOrMatrixInLValue) == 0);
    return matchInternal(node, parentNode);
}
예제 #2
0
int NFAGreedyQuantifierUNode::matchInternal(const CMString & str, WCMatcher * matcher, const int curInd, const int soFar) const
{
	if (soFar >= max)
		return next->match(str, matcher, curInd);

	int i = inner->match(str, matcher, curInd);
	if (i != -1) {
		int j = matchInternal(str, matcher, i, soFar + 1);
		if (j != -1)
			return j;
	}
	return next->match(str, matcher, curInd);
}
bool IntermNodePatternMatcher::match(TIntermBinary *node,
                                     TIntermNode *parentNode,
                                     bool isLValueRequiredHere)
{
    if (matchInternal(node, parentNode))
    {
        return true;
    }
    if ((mMask & kDynamicIndexingOfVectorOrMatrixInLValue) != 0)
    {
        if (isLValueRequiredHere && IsDynamicIndexingOfVectorOrMatrix(node))
        {
            return true;
        }
    }
    return false;
}
예제 #4
0
int NFAGreedyQuantifierUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
{
	int t = NFAQuantifierUNode::match(str, matcher, curInd);
	if (t != -1) return matchInternal(str, matcher, t, min);
	return t;
}