# coding=utf-8


# Notations from: http://www.cs.cornell.edu/courses/cs412/2008sp/lectures/lec12.pdf

TYPE_VARIABLE = 'var'  # var a;
TYPE_FUNCTION = 'func'  # (a + 1) == 2
TYPE_PROCEDURE = 'pro'
TYPE_EXPRESSIONS = 'expr'  # a = 1.0;
TYPE_STATEMENTS = 'stat'  # int pow(int n, int m)
TYPE_PARAMETER = 'par'
TYPE_ARRAY = 'arr'


class SymbolObject(object):
    """
    Key for symbol table hashmap
    static int k;
    name: k
    data_type: int
    attribute: static
    kind: var
    """
    def __init__(self, name, type_of_object, data_type, dp=None, attribute=None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.dp, self.data_type)

    def __repr__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.dp, self.data_type)


806bc41af9b6e681d8486368847403e5f7369e01
<mask token>


class SymbolObject(object):
    <mask token>

    def __init__(self, name, type_of_object, data_type, dp=None, attribute=
        None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)
    <mask token>

<mask token>


class SymbolObject(object):
    <mask token>

    def __init__(self, name, type_of_object, data_type, dp=None, attribute=
        None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

    def __repr__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

<mask token>


class SymbolObject(object):
    """
    Key for symbol table hashmap
    static int k;
    name: k
    data_type: int
    attribute: static
    kind: var
    """

    def __init__(self, name, type_of_object, data_type, dp=None, attribute=
        None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

    def __repr__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

TYPE_VARIABLE = 'var'
TYPE_FUNCTION = 'func'
TYPE_PROCEDURE = 'pro'
TYPE_EXPRESSIONS = 'expr'
TYPE_STATEMENTS = 'stat'
TYPE_PARAMETER = 'par'
TYPE_ARRAY = 'arr'


class SymbolObject(object):
    """
    Key for symbol table hashmap
    static int k;
    name: k
    data_type: int
    attribute: static
    kind: var
    """

    def __init__(self, name, type_of_object, data_type, dp=None, attribute=
        None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

    def __repr__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.
            dp, self.data_type)

# coding=utf-8


# Notations from: http://www.cs.cornell.edu/courses/cs412/2008sp/lectures/lec12.pdf

TYPE_VARIABLE = 'var'  # var a;
TYPE_FUNCTION = 'func'  # (a + 1) == 2
TYPE_PROCEDURE = 'pro'
TYPE_EXPRESSIONS = 'expr'  # a = 1.0;
TYPE_STATEMENTS = 'stat'  # int pow(int n, int m)
TYPE_PARAMETER = 'par'
TYPE_ARRAY = 'arr'


class SymbolObject(object):
    """
    Key for symbol table hashmap
    static int k;
    name: k
    data_type: int
    attribute: static
    kind: var
    """
    def __init__(self, name, type_of_object, data_type, dp=None, attribute=None, others=None):
        """

        :param name: str
        :param type_of_object: str
        :param data_type: str
        :param attribute: str
        :param others: list
        :return:
        """
        self.name = name
        self.type_of_object = type_of_object
        self.data_type = data_type
        if attribute is not None:
            for attr, value in attribute.iteritems():
                self.__setattr__(attr, value)
        self.dp = dp
        if others is None:
            self.others = others
        else:
            self.others = []

    def __unicode__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.dp, self.data_type)

    def __repr__(self):
        return '<%s, %s, %i, %s>' % (self.name, self.type_of_object, self.dp, self.data_type)

