class CFGEditor(object): (source)
Constructor: CFGEditor(parent, cfg, set_cfg_callback)
A dialog window for creating and editing context free grammars. CFGEditor imposes the following restrictions:
- All nonterminals must be strings consisting of word characters.
- All terminals must be strings consisting of word characters and space characters.
Method | __init__ |
Undocumented |
Constant | ARROW |
Undocumented |
Method | _analyze |
Replace -> with arrows, and colorize the entire buffer. |
Method | _analyze |
Colorize a given line. |
Method | _analyze |
Given a line number and a regexp match for a token on that line, colorize the token. Note that the regexp match gives us the token's text, start index (on the line), and end index (on the line). |
Method | _apply |
Undocumented |
Method | _cancel |
Undocumented |
Method | _check |
Check if we've moved to a new line. If we have, then remove all colorization from the line we moved to, and re-colorize the line that we moved from. |
Method | _clear |
Remove all tags (except arrow and sel) from the given line of the text widget used for editing the productions. |
Method | _destroy |
Undocumented |
Method | _help |
Undocumented |
Method | _init |
Undocumented |
Method | _init |
Undocumented |
Method | _init |
Undocumented |
Method | _init |
Undocumented |
Method | _init |
Undocumented |
Method | _mark |
Mark the location of an error in a line. |
Method | _ok |
Undocumented |
Method | _parse |
Parse the current contents of the textwidget buffer, to create a list of productions. |
Method | _replace |
Replace any '->' text strings with arrows (char 256, in symbol font). This searches the whole buffer, but is fast enough to be done anytime they press '>'. |
Method | _reset |
Undocumented |
Constant | _ARROW |
Undocumented |
Constant | _BOLD |
Undocumented |
Constant | _LHS |
Undocumented |
Constant | _PRODUCTION |
Undocumented |
Constant | _TOKEN |
Undocumented |
Instance Variable | _buttonframe |
Undocumented |
Instance Variable | _cfg |
Undocumented |
Instance Variable | _highlight |
Undocumented |
Instance Variable | _linenum |
Undocumented |
Instance Variable | _parent |
Undocumented |
Instance Variable | _prodframe |
Undocumented |
Instance Variable | _set |
Undocumented |
Instance Variable | _start |
Undocumented |
Instance Variable | _startframe |
Undocumented |
Instance Variable | _textscroll |
Undocumented |
Instance Variable | _textwidget |
Undocumented |
Instance Variable | _top |
Undocumented |
Given a line number and a regexp match for a token on that line, colorize the token. Note that the regexp match gives us the token's text, start index (on the line), and end index (on the line).
Check if we've moved to a new line. If we have, then remove all colorization from the line we moved to, and re-colorize the line that we moved from.
Remove all tags (except arrow and sel) from the given line of the text widget used for editing the productions.
Replace any '->' text strings with arrows (char 256, in symbol font). This searches the whole buffer, but is fast enough to be done anytime they press '>'.
Undocumented
Value |
|