MCPcopy Create free account
hub / github.com/Notgnoshi/generative / __init__

Method __init__

generative/lsystem/production.py:37–47  ·  view source on GitHub ↗

Create a rule parser. Parsing rule after rule will construct the RuleParser.rule and RuleParser.ignore members. :param long_tokens: Whether to support multiple character tokens. Requires the tokens be comma or whitespace (or both) separated. Defaults to False.

(self, long_tokens=False)

Source from the content-addressed store, hash-verified

35 """
36
37 def __init__(self, long_tokens=False):
38 """Create a rule parser.
39
40 Parsing rule after rule will construct the RuleParser.rule and RuleParser.ignore members.
41
42 :param long_tokens: Whether to support multiple character tokens. Requires the tokens be
43 comma or whitespace (or both) separated. Defaults to False.
44 """
45 self.rules: MultiDict[TokenName, RuleMapping] = MultiDict()
46 self.ignore: Set[TokenName] = set()
47 self.long_tokens = long_tokens
48
49 @staticmethod
50 def __get_grammars(long_tokens: bool):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected