Class ::tycho::EditEsterel


Inherits: ::tycho::EditProgram - Source File - Contents: public methods
This class defines a text widget with an emacs-like editor with some context-specific features for editing Esterel files. The editor automatically indents a line in response to a Tab character, and provides a command for indenting a region (the selection). To enter a literal Tab, enter the sequence . This editor also colors comments, strings, and the words "FIXME" and "NOTE".

Public constructs

Public Methods

help
Open a window with help on the current widget.
indentLine
Base indentation on Esterel keywords rather than parentheses and brackets, as used in the base class. Lines are classified into four nonoverlapping categories: start, end, to-be-continued (tbc), and other. Let "line" denote the current line, "pline" denote the first (non-blank, non-comment) line previous to the one being indented, and "ppline" denote the first (non-blank, non-comment) line before that. The indentation algorithm is then:
   if (pline == start) indent+4
   if (line == end) indent-4
   if (pline == tbc && ppline != tbc && line != end) indent+8
   if (pline == tbc && ppline == tbc && line == end) indent-8
   if (pline != tbc && pline != end && ppline == tbc && pline != end)
                  indent-8
Lines of class "start" are those that start an indented block. Lines of class "end" end an indented block. "To-be-continued" (tbc) lines are neither start or end, and do not end in a semicolon. "Other" lines are none of the above. The syntax "indent+4" above means that we increase the indentation by 4 spaces.
keywords
Return a list of keywords separated by "|".

Index of classes



Author: Edward A. Lee
Version: @(#)EditEsterel.itcl 1.7 10/27/96
Copyright: (c) 1996 The Regents of the University of California.