OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [gdbtcl/] [data.itb] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Data-type class implementations for GDBtk.
2
# Copyright 1997, 1998, 1999 Cygnus Solutions
3
#
4
# This program is free software; you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License (GPL) as published by
6
# the Free Software Foundation; either version 2 of the License, or (at
7
# your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
 
14
# ------------------------------------------------------------------
15
#                             Stack
16
# ------------------------------------------------------------------
17
body Stack::constructor {} {
18
  set _stack {}
19
}
20
 
21
body Stack::push {args} {
22
  set _stack [concat $_stack $args]
23
}
24
 
25
body Stack::destructor {} {
26
}
27
 
28
body Stack::pop {} {
29
  set thing [lindex $_stack end]
30
  set _stack [lreplace $_stack end end]
31
  return $thing
32
}
33
 
34
# ------------------------------------------------------------------
35
#                             Queue
36
# ------------------------------------------------------------------
37
body Queue::constructor {} {
38
}
39
 
40
body Queue::destructor {} {
41
}
42
 
43
body Queue::pop {} {
44
  set thing [lindex $_stack 0]
45
  set _stack [lreplace $_stack 0 0]
46
  return $thing
47
}
48
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.