def __init__(self, patterns, ignore, input):
        self.tokens = [] # [(begin char pos, end char pos, token name, matched text), ...]
        self.restrictions = []
        self.input = input
        self.pos = 0
        self.ignore = ignore
        self.first_line_number = 1

        if patterns is not None:
            # Compile the regex strings into regex objects
            self.patterns = []
            for terminal, regex in patterns:
                self.patterns.append( (terminal, re.compile(regex)) )
Initialize the scanner.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/xish/xpathparser.py/Scanner.__init__