30 lines
839 B
Python
30 lines
839 B
Python
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
# \file %filename%.py
|
|
# \brief TODO
|
|
# \author Florent Guiotte <florent.guiotte@gmail.com>
|
|
# \version 0.1
|
|
# \date 11 avril 2018
|
|
#
|
|
# TODO details
|
|
|
|
|
|
class Stack(object):
|
|
def __init__(self, begin=0, size=1, desc=None, symb=None) :
|
|
self.begin = begin
|
|
self.end = begin + size
|
|
self.desc = list()
|
|
self.symb = list()
|
|
|
|
if desc is not None:
|
|
for i in range(size):
|
|
self.desc.append(desc.copy() if isinstance(desc, list) else [desc])
|
|
|
|
if symb is not None:
|
|
for i in range(size):
|
|
self.symb.append(symb.copy() if isinstance(symb, list) else [symb])
|
|
|
|
def __str__(self):
|
|
return ("Stack: begin: {}, end: {}, desc: {}, symb: {}".format(
|
|
self.begin, self.end, self.desc, self.symb))
|