File: txt_leave.tcl

package info (click to toggle)
espresso 6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 311,040 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,502; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (221 lines) | stat: -rw-r--r-- 4,300 bytes parent folder | download | duplicates (3)
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
variable indentNum

switch -exact -- $tag {
    
    input_description {	
    }
    
    intro {
	printf \n
    }
    
    toc {
    }
}

# simple elements

switch -exact -- $tag {

    info {
    }
    
    "default" {
    }
    
    status  {
    }
    
    label   {
    }
    
    message {
    }
    
    see     {
    }
    
    keyword {
    }
}


# composite elements

switch -exact -- $tag {
    list {
	if { [::tclu::lpresent $mode syntax] } {
	    syntaxFlush
	} else {
	    if { [printableVarDescription $tree $node] } {
		printf +--------------------------------------------------------------------
		printf \n
	    }
	}
    }
    
    format { # todo 
    }
    
    var - dimension - multidimension - col - row {
	if { ! $vargroup && ! $dimensiongroup && ! $colgroup && ! $rowgroup && ! [::tclu::lpresent $mode syntax] } {
	    if { [printableVarDescription $tree $node] } {
		printf +--------------------------------------------------------------------\n
		set var_print 0
	    }
	}
    }
    
    vargroup - dimensiongroup - dimensiongroup - rowgroup - colgroup { # todo
	if { ! [::tclu::lpresent $mode syntax] } {
	    set $tag 0
	    if { [printableVarDescription $tree $node] } {
		printf +--------------------------------------------------------------------\n		
	    }
	}
    }
    
    table {
    }
    rows { 
	if { [::tclu::lpresent $mode syntax] && [::tclu::lpresent $mode rows] } {
	    manageRow 
	    manageRow 1	
	    manageRow 2
	    printRows	

	    unset rows
	    ::tclu::lpop mode
	}
    }
    cols { 
	if { [::tclu::lpresent $mode syntax] && [::tclu::lpresent $mode cols] } {
	    manageCol 
	    manageCol 1	
	    manageCol 2
	    printCols	

	    unset cols
	    ::tclu::lpop mode
	}
    }

    optional { 
	if { [::tclu::lpresent $mode rows] } {
	    append rows(line) "__optional::end__ "
	} elseif { [::tclu::lpresent $mode cols] } {
	    append cols(vline) "__optional::end__ "
	} elseif { [::tclu::lpresent $mode syntax] } {
	    syntaxAppend "\}"
	}
    }
    conditional { 
	if { [::tclu::lpresent $mode rows] } {
	    append rows(line) "__conditional::end__ "
	} elseif { [::tclu::lpresent $mode cols] } {
	    append cols(vline) "__conditional::end__ "
	} elseif { [::tclu::lpresent $mode syntax] } {
	    syntaxAppend "\]"
	}
    }
    group {
	incr txtDepth -1
	printf \\\\\\---\n
    }
    namelist {
	incr txtDepth -1
	printf "===END OF NAMELIST======================================================\n\n"
    }
    supercard {
	set name [supercardStarttag]
	set end  [arr endtag]

	if { $end   ne "" } { set name $name/$end }
	
	incr txtDepth -1
	set str "### END OF SUPERCARD :  $name "
	set l [string length $str]
	for {set i $l} {$i < 72} {incr i} {
	    append str #
	}
	
	printf $str\n\n
    }
    card {
    }
    linecard { 
	if { [::tclu::lpresent $mode syntax] } {
	    syntaxFlush
	}
    }
    flag { 
	if { [::tclu::lpresent $mode "description"] } {
	    printf +--------------------------------------------------------------------
	    puts $fid(txt) "\n" 
	}
    }
    enum { # todo
    }
    syntax {
	if { [::tclu::lpresent $mode syntax] } {	    	    
	    incr txtDepth -2
	    printf "\n/////////////////////////////////////////\n"
	    #printf "|______\n"
	    #printf "|                                       |"
	    #printf "+---------------------------------------+"
	    #printf "+---------------------------------------+\n"
	}
    }
    line { 
	if { [::tclu::lpresent $mode syntax] } {
	    syntaxFlush
	}
    }
    if {
	if { ! [::tclu::lpresent $mode description] } {	    
	    incr txtDepth -1
	    printf ENDIF
	}
    }
    choose { 
	if { ! [::tclu::lpresent $mode description] } {
	    printf ENDIF
	    printf ________________________________________________________________________\n
	}
    }
    when - elsewhen - otherwise {
	if { ! [::tclu::lpresent $mode description] } {
	    printf " "
	    incr txtDepth -1
	}
    }
    options {
	if { ! [::tclu::lpresent $mode syntax] } {
	    set options 0
	    set options_first 0
	}
    }
}


# some text structure stuff

switch -exact -- $tag {
    
    section {
	puts $fid(txt) ""
	incr txtDepth -1
    }
    subsection {
	puts $fid(txt) ""
	incr txtDepth -1
    }
    subsubsection {
	puts $fid(txt) ""
	incr txtDepth -1
    }
    paragraph {
    }
    text {
    }
}