ALDT (Arnulf's LaTeX Documentation Tool)

Check-in [c1c5d81242]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:initial version
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c1c5d812426fe4872b1835a2b0acb7269c076cd5
User & Date: arnulf 2012-08-26 10:19:22
Context
2012-08-26
10:26
initial version check-in: 33a1c9b943 user: arnulf tags: trunk
10:19
initial version check-in: c1c5d81242 user: arnulf tags: trunk
09:54
fixes and new code check-in: ca968628f6 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added ObjTypeBase.tcl.









































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#=====================================================
# ObjTypeBase.tcl 
# *
# * ALDT (Arnulf's Latex Documentation Tool)
# * A Tcl parser for LaTeX files for generating document output (for example html)
# *
# * Handle basic obj_type stuff
# *
# * Released under same BSD license as Tcl.
# * (Tcl BSD license found at <http://www.tcl.tk/software/tcltk/license.html>)
# *
# * Copyright 2012 Arnulf P. Wiedemann
#=====================================================

namespace eval ::Parser {

::itcl::class ObjTypeBase {
  constructor {} {}
  public method callFreeIntRepProc {obj_type obj_ptr}
  public method haveUpdateString {obj_type}
  public method callUpdateString {obj_type obj_ptr}
  public method haveDupInternalRep {obj_type}
  public method callDupInternalRep {obj_type src_obj_ptr dup_obj_ptr}
}

  # ==================== constructor =====================================
::itcl::body ObjTypeBase::constructor {} {
  }

  # ==================== callFreeIntRepProc =====================================
::itcl::body ObjTypeBase::callFreeIntRepProc {obj_type obj_ptr} {
    switch $obj_type {
    OBJ_TYPE_STRING: 
      return true
    }
    return true
  }

  # ==================== haveUpdateString =====================================
::itcl::body ObjTypeBase::haveUpdateString {obj_type} {
    switch $obj_type {
    OBJ_TYPE_STRING {
      return true
      }
    OBJ_TYPE_INT {
      return true
      }
    OBJ_TYPE_LIST {
      return true
      }
    OBJ_TYPE_DICT {
      return true
      }
    }
    return false
  }

  # ==================== callUpdateString ===================================== 
::itcl::body ObjTypeBase::callUpdateString {obj_type obj_ptr} {
    switch $obj_type {
    OBJ_TYPE_STRING {
      return true
      }
    OBJ_TYPE_INT {
      $int_obj_type updateString $obj_ptr
      return true
      }
    OBJ_TYPE_LIST {
      $list_obj_type updateString $obj_ptr
      return true
      }
    OBJ_TYPE_DICT {
      $dict_obj_type updateString $obj_ptr
      return true
      }
    }
puts "callUpdateString missing case for obj_type![getObjTypeString $obj_type]!");
    return true
  }

  # ==================== haveDupInternalRep ===================================== */
::itcl::body ObjTypeBase::haveDupInternalRep {obj_type} {
    switch $obj_type {
    OBJ_TYPE_STRING {
      return false
      }
    OBJ_TYPE_LIST {
      return true
      }
    OBJ_TYPE_DICT {
        return true
      }
    }
    return false
  }

  # ==================== callDupInternalRep =====================================
::itcl::body ObjTypeBase::callDupInternalRep {obj_type src_obj_ptr dup_obj_ptr} {
    switch $obj_type {
    OBJ_TYPE_STRING {
      return true
      }
    OBJ_TYPE_LIST {
      $list_obj_type dupInternalRep $src_obj_ptr $dup_obj_ptr
      return true
      }
    OBJ_TYPE_DICT {
        $dict_obj_type dupInternalRep $src_obj_ptr $dup_obj_ptr
        return true
      }
    }
puts "callUpdateString missing case for obj_type![getObjTypeString $obj_type]!"
    return true
  }

}