All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Python3.src.antlr4.tree.Chunk.py Maven / Gradle / Ivy

There is a newer version: 4.13.2
Show newest version
class Chunk(object):
    pass

class TagChunk(Chunk):

    def __init__(self, tag:str, label:str=None):
        self.tag = tag
        self.label = label

    def __str__(self):
        if self.label is None:
            return self.tag
        else:
            return self.label + ":" + self.tag

class TextChunk(Chunk):

    def __init__(self, text:str):
        self.text = text

    def __str__(self):
        return "'" + self.text + "'"





© 2015 - 2025 Weber Informatics LLC | Privacy Policy