|
|
@@ -1,4 +1,6 @@ |
|
|
|
from __future__ import absolute_import |
|
|
|
|
|
|
|
|
|
|
|
from lark.exceptions import ConfigurationError, assert_config |
|
|
|
|
|
|
|
import sys, os, pickle, hashlib |
|
|
@@ -6,7 +8,7 @@ from io import open |
|
|
|
import tempfile |
|
|
|
from warnings import warn |
|
|
|
|
|
|
|
from .utils import STRING_TYPE, Serialize, SerializeMemoizer, FS, isascii, logger |
|
|
|
from .utils import STRING_TYPE, Serialize, SerializeMemoizer, FS, isascii, logger, ABC, abstractmethod |
|
|
|
from .load_grammar import load_grammar, FromPackageLoader, Grammar |
|
|
|
from .tree import Tree |
|
|
|
from .common import LexerConf, ParserConf |
|
|
@@ -191,6 +193,14 @@ _VALID_PRIORITY_OPTIONS = ('auto', 'normal', 'invert', None) |
|
|
|
_VALID_AMBIGUITY_OPTIONS = ('auto', 'resolve', 'explicit', 'forest') |
|
|
|
|
|
|
|
|
|
|
|
class PostLex(ABC): |
|
|
|
@abstractmethod |
|
|
|
def process(self, stream): |
|
|
|
return stream |
|
|
|
|
|
|
|
always_accept = () |
|
|
|
|
|
|
|
|
|
|
|
class Lark(Serialize): |
|
|
|
"""Main interface for the library. |
|
|
|
|
|
|
|