ALDT (Arnulf's LaTeX Documentation Tool)

Check-in [56555330e2]
Login

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

Overview
Comment:initil version
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:56555330e25b9872b42e2e9f0b41befb2cfd68b7
User & Date: arnulf 2012-08-26 11:46:32
Context
2012-08-26
12:57
initial version check-in: 1fac9a39dd user: arnulf tags: trunk
11:46
initil version check-in: 56555330e2 user: arnulf tags: trunk
11:35
initial version check-in: 94c59675c0 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added SourceObjType.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
#=====================================================
# SourceObjType.tcl 
# *
# * ALDT (Arnulf's Latex Documentation Tool)
# * A Tcl parser for LaTeX files for generating document output (for example html)
# *
# * Store info of a source file
# *
# * 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 SourceObjType {
  private common oid 0

  private variable id

  constructor {} {}
  public method mySelf {}
  public method toString {}
  public method toDebugString {}
  public method setFromAny {obj_ptr}
  public method freeInternalRep {obj_ptr}
  public method dupInternalRep {src_ptr dup_ptr}
  public method setSourceInfo {obj_ptr file_name_ptr line_number}
  }

  # ==================== constructor ==================================
::itcl::body SourceObjType::constructor {} {
    inr oid
    set id $oid
  }

  # ==================== mySelf ==================================
::itcl::body SourceObjType::mySelf {} {
    set str "SourceObjType!$id!"
    return $str
  }

  # ==================== toString =====================================
::itcl::body SourceObjType::toString {} {
    return "[mySelf]!"
  }

  # ==================== toDebugString =====================================
::itcl::body SourceObjType::toDebugString {} {
    set str "[mySelf]\n"
    return $str
  }

  # ==================== setFromAny ==================================
::itcl::body SourceObjType::setFromAny {obj_ptr} {
    puts "source setFromAny not yet implemented"
  }

  # ==================== freeInternalRep =====================================
::itcl::body SourceObjType::freeInternalRep {obj_ptr} {
    [$obj_ptr sourceValue_GetFileNameObj] decrRefCount "D_SOURCE_OBJ_TYPE_1"
  }

  # ==================== dupInternalRep =====================================
::itcl::body SourceObjType::dupInternalRep {src_ptr dup_ptr} {
    $dup_ptr setObjType [$src_ptr getObjType]
    $dup_ptr sourceValue_SetFileNameObj [$src_ptr sourceValue_GetFileNameObj]
    $dup_ptr sourceValue_SetLineNumber [$src_ptr sourceValue_GetLineNumber]
    [$dup_ptr sourceValue_GetFileNameObj] incrRefCount "I_SOURCE_OBJ_TYPE_1"
  }

  # ==================== setSourceInfo ==================================
::itcl::body SourceObjType::setSourceInfo {obj_ptr file_name_ptr line_number} {
    $obj_ptr panic [$obj_ptr isShared] "setSourceInfo called with shared object"
    $obj_ptr panic ([$obj_ptr getObjType] < 0) "setSourceInfo called with obj_type < 0"
    $file_name_ptr incrRefCount "I_SOURCE_OBJ_TYPE_2"
    $obj_ptr sourceValue_SetFileNameObj $file_name_ptr
    $obj_ptr sourceValue_SetLineNumber $line_number
    $obj_ptr setObjType OBJ_TYPE_SOURCE
  }

}