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)
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
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',
def __init__(self, value): self.__id = 0 self.__value = value self.__childrens = SingleLinkedList()