10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Following error encountered while executing characterizationEngine.tcl
:confused::confused:
$ ./characterizationEngine.tcl
Tcl Client is running Ixia Software version: 5.60
Can't find tclx.tcl in the following directories:
/usr/lib/tclX8.3
/usr/lib/tclX8.3
/usr/lib/tclX8.3... (0 Replies)
Discussion started by: hiten.r.chauhan
0 Replies
2. Shell Programming and Scripting
how can i make a list with the n last files and their details in tcl?..
thanks. (0 Replies)
Discussion started by: eee
0 Replies
3. Shell Programming and Scripting
I have a TCL script that logs into a switch using expect.I send a command "show port-security address" and it returns a table having a large number of rows.I need to capture this output(the table) and store it in a .txt file.
I have done this:
match_max 5000
set expect_out(buffer) {}
set... (0 Replies)
Discussion started by: plasmalightwave
0 Replies
4. Shell Programming and Scripting
Hello everyone:
I have a script that writes and read DATA in/from a socket, but i have a great problem while writing.
My socket is created in this way:
set connection
fconfigure $connection -encoding binary -translation binary -blocking 1
And the writer procedure is this one:
... (0 Replies)
Discussion started by: trutoman
0 Replies
5. Shell Programming and Scripting
I'm trying to write a script that will do the following:
Open a text file for reading/writing.
Read each line.
When I find a specfic value in a line, append something to the end of that line.
I loop through and read all the lines in myfile.txt looking for dev123_data_log and find a... (5 Replies)
Discussion started by: progkcp
5 Replies
6. Shell Programming and Scripting
Hello,
Can someone explaine me the meaning of this program:
#! /usr/bin/tclsh
set mctal
set a
set b
set c
set d
set e
while {! line cell]} {
}
while {! line]} {
}
while {! line cell]} {
}
while {! line]} {
} (0 Replies)
Discussion started by: jolecanard
0 Replies
7. Programming
Hi,
Im working with client side Tcl implementation on unix box of web services, to login to a tool with web service method written in C# on windows box and it is accessed by its link from the browser on unix box.
Sorry that i have hidden the original names for security reasons.
Using... (0 Replies)
Discussion started by: SankarV
0 Replies
8. Shell Programming and Scripting
Hello Tcl Experts,
set i 0
while { $i < 10 } {
puts "$i"
incr i
}
I am trying to print the value of "i" at the same place. i.e. it should first print "1", then in next iteration print "2" over the location of "1" and so on.... (i.e. in every iteration, delete the previous number and... (2 Replies)
Discussion started by: sumitgarg
2 Replies
9. Shell Programming and Scripting
can someone tell my why the puts is not reflecting the variable?
CUT -->
set fp
while {-1 != } {
button .a${line} -text "${line} " -width 20 -command {
puts $line
}
pack .a${line}
} (0 Replies)
Discussion started by: hpuxrox
0 Replies
10. UNIX for Advanced & Expert Users
running solaris 2.5.1 on a sparc5, with less than 12 users runnign compilers, gui's, really not a heavy load on it however, sometimes, not always, when users run diff, or sdiff or a .tcl script, the computer locks up. One time right before everything froze, I noticed in top, that the sdiff process... (2 Replies)
Discussion started by: kymberm
2 Replies
doctools::tcl::parse(n) Documentation tools doctools::tcl::parse(n)
__________________________________________________________________________________________________________________________________________________
NAME
doctools::tcl::parse - Processing text in 'subst -novariables' format
SYNOPSIS
package require Tcl 8.4
package require snit
package require fileutil
package require logger
package require struct::list
package require struct::stack
package require struct::set
package require treeql
::doctools::tcl::parse text tree text ?root?
::doctools::tcl::parse file tree path ?root?
_________________________________________________________________
DESCRIPTION
This package provides commands for parsing text with embedded Tcl commands as accepted by the Tcl builtin command subst -novariables. The
result of the parsing is an abstract syntax tree.
This is an internal package of doctools, for use by the higher level parsers processing the docidx, doctoc, and doctools markup languages.
API
::doctools::tcl::parse text tree text ?root?
The command takes the text and parses it under the assumption that it contains a string acceptable to the Tcl builtin command subst
-novariables. Errors are thrown otherwise during the parsing. The format used for these errors in described in section Error format.
The command returns the empty string as it result. The actual result of the parsing is entered into the tree structure tree, under
the node root. If root is not specified the root of tree is used. The tree has to exist and be the command of a tree object which
supports the same methods as trees created by the package struct::tree.
In case of errors tree will be left in an undefined state.
::doctools::tcl::parse file tree path ?root?
The same as text, except that the text to parse is read from the file specified by path.
ERROR FORMAT
When the parser encounters a problem in the input it will throw an error using the format described here.
[1] The message will contain the reason for the problem (unexpected character or end of input in input), the character in question, if
any, and the line and column the problem was found at, in a human readable form. This part is not documented further as its format
may change as we see fit. It is intended for human consumption, not machine.
[2] The error code however will contain a machine-readable representation of the problem, in the form of a 5-element list containing, in
the order listed below
[1] the constant string doctools::tcl::parse
[2] the cause of the problem, one of
char Unexpected character in input
eof Unexpected end of the input
[3] The location of the problem as offset from the beginning of the input, counted in characters. Note: Line markers count as one
character.
[4] The line the problem was found on (counted from 1 (one)),
[5] The column the problem was found at (counted from 0 (zero))
TREE STRUCTURE
After successfully parsing a string the generated tree will have the following structure:
[1] In the following items the word 'root' refers to the node which was specified as the root of the tree when invoking either text or
file. This may be the actual root of the tree.
[2] All the following items further ignore the possibility of pre-existing attributes in the pre-existing nodes. If attributes exists
with the same names as the attributes used by the parser the pre-existing values are written over. Attributes with names not clash-
ing with the parser's attributes are not touched.
[3] The root node has no attributes.
[4] All other nodes have the attributes
type The value is a string from the set { Command , Text , Word }
range The value is either empty or a 2-element list containing integer numbers. The numbers are the offsets of the first and last
character in the input text, of the token described by the node,.
line The value is an integer, it describes the line in the input the token described by the node ends on. Lines are counted from 1
(one).
col The value is an integer, it describes the column in the line in the input the token described by the node ends on. Columns
are counted from 0 (zero).
[5] The children of the root, if any, are of type Command and Text, in semi-alternation. This means: After a Text node a Command node
has to follow, and anything can follow a Command node, a Text or other Command node.
[6] The children of a Command node, if any, are of type Command, and Text, and Word, they describe the arguments of the command.
[7] The children of a Word node, if any, are of type Command, Text, in semi-alternation. This means: After a Text node a Command node
has to follow, and anything can follow a Command node, a Text or other Command node.
[8] A Word node without children represents the empty string.
[9] All Text nodes are leaves of the tree.
[10] All leaves of the tree are either Text or Command nodes. Word nodes cannot be leaves.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
KEYWORDS
Tcl syntax, command, doctools, parser, subst, word
CATEGORY
Documentation tools
COPYRIGHT
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
doctools2base 1 doctools::tcl::parse(n)