class documentation

class RegexLexerMeta(LexerMeta):

Known subclasses: pygments.lexer.ProfilingRegexLexerMeta

View In Hierarchy

Metaclass for RegexLexer, creates the self._tokens attribute from self.tokens on the first instantiation.
Method __call__ Instantiate cls after preprocessing its token definitions.
Method ​_process​_new​_state Preprocess the state transition action of a token definition.
Method ​_process​_regex Preprocess the regular expression component of a token definition.
Method ​_process​_state Preprocess a single state definition.
Method ​_process​_token Preprocess the token component of a token definition.
Method get​_tokendefs Merge tokens from superclasses in MRO order, returning a single tokendef dictionary.
Method process​_tokendef Preprocess a dictionary of token definitions.

Inherited from LexerMeta:

Method __new__ Undocumented
def __call__(cls, *args, **kwds):
Instantiate cls after preprocessing its token definitions.
def _process_new_state(cls, new_state, unprocessed, processed):
Preprocess the state transition action of a token definition.
def _process_regex(cls, regex, rflags, state):
Preprocess the regular expression component of a token definition.
def _process_state(cls, unprocessed, processed, state):
Preprocess a single state definition.
def _process_token(cls, token):
Preprocess the token component of a token definition.
def get_tokendefs(cls):

Merge tokens from superclasses in MRO order, returning a single tokendef dictionary.

Any state that is not defined by a subclass will be inherited automatically. States that are defined by subclasses will, by default, override that state in the superclass. If a subclass wishes to inherit definitions from a superclass, it can use the special value "inherit", which will cause the superclass' state definition to be included at that point in the state.

def process_tokendef(cls, name, tokendefs=None):
Preprocess a dictionary of token definitions.