I'm not so experienced Tcl programmer, so my proposition is very straight forward.
From your question I guess, that you read the file line by line (I guess using "gets") and then do something with the line (pattern matching). So, the most straight forwart implementation will be like this (by the way, one of the questions is what do you like to do with trailing whitespaces of "previous" line and leading whitespaces of the "next" line):
;# Note: The code bellow was not tested, and may not run cleanly,
;# but I hope it shows the idea.
;# Like "gets", but concatenates lines, which finish with "\" character with
;# the next one.
proc concatenatingGets {chan} {
set wholeLine ""
set finishedReadingCurentLine no
while {! $finishedReadingCurrentLine } {
set currentLine [gets $chan]
;# more complicated rule can be used here for concatenation
;# of lines
if {[string index $currentLine end] == "\\"} {
;# Decide here what to do with leading and trailing spaces.
;# We just leave them as is (only remove trailing backslash).
;# Note, that Tcl interpreter behaves differently.
append wholeLine " " [string range $currentLine 0 end-1]
} else {
set finishedReadingCurrentLine yes
} ;# if-else strig is to be concatenated
} ;# while ! finishedReadingcurrentLine
} ;# concatenatingGets
;# Now use our tweaked gets:
set f [open "myFileToParse.txt" r]
while {![eof $f]} {
set currentLine [concatenatingGets $f]
;# ... Do pattern matching ot current line, and whatever else needed.
}
close $f