lex2.predefs

Predefined rule objects and -template classes.

Attributes

space

Rule defining a space character.

tab

Rule defining a tab character.

newline

Rule defining a newline character.

Classes

Comments

Rule group for defining sourcecode-style comments.

class lex2.predefs.Comments

Bases: RuleGroup

Rule group for defining sourcecode-style comments.

add_singleline_comment(start_regex)

Adds a definition for a singleline comment.

Parameters

start_regex (str) – Regex denoting the start of a singleline comment.

Return type

Comments

add_multiline_comment(start_regex, end_regex)

Adds a definition for a multiline comment.

Parameters
  • start_regex (str) – Regex denoting the start of a singleline comment.

  • end_regex (str) – Regex denoting the end of a singleline comment.

Return type

Comments

lex2.predefs.space

Rule defining a space character.

lex2.predefs.tab

Rule defining a tab character.

lex2.predefs.newline

Rule defining a newline character.