src.elan.tclparser

This module contains tcl parsing functions. These are badly documented here to speed up developing time.

The class TclParser parses a tcl script/line into TclCommand objects. These are used/executed by TclScope.

Exceptions

TclError

Common base class for all non-exit exceptions.

Classes

Word

TclCommand

TclParser

Module Contents

class src.elan.tclparser.Word(word, line=0, filename='', start=0, env='')
Parameters:
  • start (int)

  • env (str)

word
line = 0
filename = ''
start = 0
env = ''
__str__()
__repr__()
__eq__(other)
endswith(*args)
class src.elan.tclparser.TclCommand(*words, line=0, filename='Console', char1=0, char2=0)
Parameters:
  • words (list[Word | str])

  • line (int)

  • filename (str)

  • char1 (int)

  • char2 (int)

words = ()
line = 0
filename = 'Console'
char1 = 0
char2 = 0
__str__()
__repr__()
__eq__(other)
exception src.elan.tclparser.TclError(msg, cmd, i_word=None)

Bases: Exception

Common base class for all non-exit exceptions.

Parameters:
msg
cmd
i_word = None
static cmd2str(cmd, i_word)
class src.elan.tclparser.TclParser
reset()
__call__(script, name='', filename='Console', startline=1)
Parameters:
  • script (str)

  • name (str)

  • filename (str)

  • startline (int)

handle_env(token)
raise_error(msg)
start_env(token)
command_ends()
get_words(script)
find_brackets(script)