Working on #48 : Added BaseExprParser and BaseNodeParser.py

This commit is contained in:
2021-03-10 21:09:09 +01:00
parent 998ea160be
commit 9c4991923e
18 changed files with 317 additions and 198 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ from core.builtin_concepts import BuiltinConcepts
from core.rule import Rule
from core.sheerka.services.SheerkaExecute import ParserInput
from core.tokenizer import TokenKind
from parsers.BaseParser import BaseParser, ParsingError, UnexpectedTokenParsingError
from parsers.BaseParser import BaseParser, ParsingError, UnexpectedTokenParsingError, BaseParserInputParser
class RuleNotFoundError(ParsingError):
@@ -14,7 +14,7 @@ class RuleNotFoundError(ParsingError):
return f"RuleNotFoundError(id={self.id}, key={self.key}"
class RuleParser(BaseParser):
class RuleParser(BaseParserInputParser):
"""
Tries to recognize rules
"""
@@ -22,7 +22,7 @@ class RuleParser(BaseParser):
NAME = "Rule"
def __init__(self, **kwargs):
BaseParser.__init__(self, RuleParser.NAME, 80)
BaseParserInputParser.__init__(self, RuleParser.NAME, 80)
def parse(self, context, parser_input: ParserInput):
"""