예제 #1
0
파일: nodo.py 프로젝트: susanliss/tytus
class Node:
    def __init__(self, value):
        self.__id = 0
        self.__value = value
        self.__childrens = SingleLinkedList()

    def get_id(self):
        return self.__id

    def set_id(self, id):
        self.__id = id

    def get_value(self):
        return self.__value

    def set_value(self, value):
        self.__value = value

    def get_childrens(self):
        return self.__childrens

    def set_childrens(self, childrens):
        self.__childrens = childrens

    def add_childrens(self, children):
        self.__childrens.insert_end(children)
예제 #2
0
class Node:
    def __init__(self, value):
        self.__id = 0
        self.__value = value
        self.__childrens = SingleLinkedList()
        self.__production = ''

    def get_id(self):
        return self.__id

    def set_id(self, id):
        self.__id = id

    def get_value(self):
        return self.__value

    def set_value(self, value):
        self.__value = value

    def get_childrens(self):
        return self.__childrens

    def set_childrens(self, childrens):
        self.__childrens = childrens

    def add_childrens(self, children):
        self.__childrens.insert_end(children)

    @property
    def production(self):
        return self.__production

    @production.setter
    def production(self, production):
        self.__production = production
예제 #3
0
import libs.ply.lex as lex
from libs.ply.lex import TOKEN
from models.error import Error
from controllers.linked_list import SingleLinkedList
from models.find_type_error import FindTypeError

# Hacen falta palabras reservadas hay que anadirlas
list_errors = SingleLinkedList()
id_error = 1

# Definitions of tokens reserved
k_reserved = {
    'ADD': 'ADD',
    'ALL': 'ALL',
    'ALTER': 'ALTER',
    'ABS': 'ABS',
    'AND': 'AND',
    'AS': 'AS',
    'ASC': 'ASC',
    'AVG': 'AVG',
    'BETWEEN': 'BETWEEN',
    'BIGINT': 'BIGINT',
    'BOOLEAN': 'BOOLEAN',
    'BY': 'BY',
    'CASE': 'CASE',
    'CBRT': 'CBRT',
    'CONVERT': 'CONVERT',
    'CEIL': 'CEIL',
    'CEILING': 'CEILING',
    'CHAR': 'CHAR',
    'CHARACTER': 'CHARACTER',
예제 #4
0
파일: nodo.py 프로젝트: susanliss/tytus
 def __init__(self, value):
     self.__id = 0
     self.__value = value
     self.__childrens = SingleLinkedList()