How to use the fastavro.io.symbols.Action function in fastavro

To help you get started, we’ve selected a few fastavro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fastavro / fastavro / fastavro / io / symbols.py View on Github external
class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass


class FieldStart(Action):
    def __init__(self, field_name):
        self.field_name = field_name


class FieldEnd(Action):
    pass
github fastavro / fastavro / fastavro / io / symbols.py View on Github external
class Action(Symbol):
    pass


class EnumLabels(Action):
    def __init__(self, labels):
        self.labels = labels


class UnionEnd(Action):
    pass


class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass


class FieldStart(Action):
    def __init__(self, field_name):
        self.field_name = field_name


class FieldEnd(Action):
    pass
github fastavro / fastavro / fastavro / io / symbols.py View on Github external
def __init__(self, symbols, labels):
        Symbol.__init__(self, symbols)
        self.labels = labels

    def get_symbol(self, index):
        return self.production[index]

    def get_label(self, index):
        return self.labels[index]


class Action(Symbol):
    pass


class EnumLabels(Action):
    def __init__(self, labels):
        self.labels = labels


class UnionEnd(Action):
    pass


class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass
github fastavro / fastavro / fastavro / io / symbols.py View on Github external
return self.production[index]

    def get_label(self, index):
        return self.labels[index]


class Action(Symbol):
    pass


class EnumLabels(Action):
    def __init__(self, labels):
        self.labels = labels


class UnionEnd(Action):
    pass


class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass


class FieldStart(Action):
    def __init__(self, field_name):
        self.field_name = field_name
github fastavro / fastavro / fastavro / io / symbols.py View on Github external
self.labels = labels


class UnionEnd(Action):
    pass


class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass


class FieldStart(Action):
    def __init__(self, field_name):
        self.field_name = field_name


class FieldEnd(Action):
    pass
github fastavro / fastavro / fastavro / io / parser.py View on Github external
def flush(self):
        while len(self.stack) > 0:
            top = self.stack.pop()

            if isinstance(top, Action) or isinstance(top, Root):
                self.action_function(top)
            else:
                raise Exception("Internal Parser Exception: {}".format(top))
github fastavro / fastavro / fastavro / io / symbols.py View on Github external
class EnumLabels(Action):
    def __init__(self, labels):
        self.labels = labels


class UnionEnd(Action):
    pass


class RecordStart(Action):
    pass


class RecordEnd(Action):
    pass


class FieldStart(Action):
    def __init__(self, field_name):
        self.field_name = field_name


class FieldEnd(Action):
    pass
github fastavro / fastavro / fastavro / io / parser.py View on Github external
def advance(self, symbol):
        while True:
            top = self.stack.pop()

            if top == symbol:
                return top
            elif isinstance(top, Action):
                self.action_function(top)
            elif isinstance(top, Terminal):
                raise Exception("Internal Parser Exception: {}".format(top))
            elif isinstance(top, Repeater) and top.end == symbol:
                return symbol
            else:
                self.stack.extend(top.production)