

def Reduce(self):
    'Reduce the token stack into an AST.'
    if (self.state != 'INITIAL'):
        self.Error('Premature end of expression')
    length = len(self.stack)
    while (length > 1):
        self._CombineParenthesis()
        self._CombineBinaryExpressions('and')
        self._CombineBinaryExpressions('or')
        if (len(self.stack) == length):
            break
        length = len(self.stack)
    if (length != 1):
        length.Error('Illegal query expression')
    return self.stack[0]

dataset/ETHPy150Open google/grr/grr/lib/lexer.py SearchParser.Reduce/VarMisuse@105/154 `self`->`length`