summaryrefslogtreecommitdiff
path: root/tnslc/compile/var.tnsl
blob: 9526fc654dd53dfe1e55d07d13644bb03519db08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

struct Var {
  ~uint8 name,
  ~Struct _type,
  utils.Vector ptrc,
  int loc
}

/; method Var
  /; init (~uint8 name)
    self.name = name
    self.ptrc.init(4)
  ;/

  /; ptr [int32]
    ~int32 i
    i = self.ptrc.get(self.ptrc.count - 1)
    return i`
  ;/

  /; ptr_push (int32 p)
    self.ptrc.push(~p)
  ;/

  /; ptr_pop
    self.ptrc.pop()
  ;/

  /; end
    _delete(self.name)
    self.ptrc.end()
  ;/
;/