grammar_parser.grammar_nodes

class tyrian.typarser.grammar_parser.grammar_nodes.GrammarNode[source]

Base GrammarNode

class tyrian.typarser.grammar_parser.grammar_nodes.SubGrammarWrapper(settings: dict, key: str, grammar_parser_inst) → None[source]

Acts as proxy for subgrammar, ensuring that we need not copy the subgrammar, nor that we need parse the grammars in any particular order.

Parameters:grammar_parser_inst – an instance of the GrammarParser, used to access subgrammars
class tyrian.typarser.grammar_parser.grammar_nodes.MultiNode(settings: dict, sub)[source]

Checks for multiple instances of a set of subnode

Parameters:sub – node to checks for multiple instances of
class tyrian.typarser.grammar_parser.grammar_nodes.LiteralNode(settings: dict, content)[source]

Compares a token directly against a string

Parameters:content – content against which to test
class LiteralNode

LiteralNode(content, line_no)

content

Alias for field number 0

line_no

Alias for field number 1

class tyrian.typarser.grammar_parser.grammar_nodes.ContainerNode(settings: dict, subs: list) → None[source]

Serves as a container for one or more sub Nodes

Parameters:subs – subnodes to contain
class tyrian.typarser.grammar_parser.grammar_nodes.RENode(settings: dict, regex, name)[source]

Matches a token against a regular expression

Parameters:
  • regex – regular expression to match against
  • name – name of what the regular expression tests for
class RENode

RENode(content, name, line_no)

content

Alias for field number 0

line_no

Alias for field number 2

name

Alias for field number 1

class tyrian.typarser.grammar_parser.grammar_nodes.ORNode(settings: dict, left, right)[source]

checks between two possible sets of subnodes

Parameters:
  • left – node on left side of OR symbol
  • right – node on right side of OR symbol
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.