class documentation

class Scanner:

View In Hierarchy

Simple scanner

All method patterns are regular expression strings (not compiled expressions!)

Method __init__
Method __repr__ Undocumented
Method check Apply pattern on the current position and return the match object. (Doesn't touch pos). Use this for lookahead.
Method eos True if the scanner reached the end of text.
Method get​_char Scan exactly one char.
Method scan No summary
Method test Apply a pattern on the current position and check if it patches. Doesn't touch pos.
Instance Variable ​_re​_cache Undocumented
Instance Variable data Undocumented
Instance Variable data​_length Undocumented
Instance Variable flags Undocumented
Instance Variable last Undocumented
Instance Variable match Undocumented
Instance Variable pos Undocumented
Instance Variable start​_pos Undocumented
def __init__(self, text, flags=0):
Parameters
textThe text which should be scanned
flagsdefault regular expression flags
def __repr__(self):

Undocumented

def check(self, pattern):
Apply pattern on the current position and return the match object. (Doesn't touch pos). Use this for lookahead.
def eos(self):
True if the scanner reached the end of text.
def get_char(self):
Scan exactly one char.
def scan(self, pattern):
Scan the text for the given pattern and update pos/match and related fields. The return value is a boolen that indicates if the pattern matched. The matched value is stored on the instance as match, the last value is stored as last. start_pos is the position of the pointer before the pattern was matched, pos is the end position.
def test(self, pattern):
Apply a pattern on the current position and check if it patches. Doesn't touch pos.
_re_cache: dict =

Undocumented

data =

Undocumented

data_length =

Undocumented

flags =

Undocumented

last =

Undocumented

match =

Undocumented

pos =

Undocumented

start_pos =

Undocumented