Tcl File Analyzer for PYTHON

I have a .tcl file.

Is there any parser out there that directly pulls data from a .tcl file? I don't want to use REGEX for this task. Will pyparsing work for this problem?

I am using Python 2.7

+1


source to share


1 answer


.tcl files are not data files, they are programming scripts written in the Tcl programming language.

Tcl is extremely flexible in form and style, which makes writing a general-purpose parser a significant project, whether in pyparsing or any other package. I encourage people when they embark on a new peering project to start scooping up BNF for a language, no matter the level of detail they want. This page from the Tcl wiki implies that developing BNF for Tcl is not easy, if not impossible.



It is highly unlikely that someone will answer your question with an answer containing your Tcl-parser implemented in Python. Perhaps there is a subset of Tcl that you are particularly focused on - if you submitted some sample Tcl code and what you want from it, you are more likely to get helpful answers.

+1


source







All Articles