;; Copyright (C) 2000,2001,2002,2003 Peter Milliken ;; ;; Author: Peter Milliken , ;; ;; Version: 1.1 ;; Keywords: language sensitive abbreviation template placeholder token ;; ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;****************************************************************************** ;; These definitions are my personal customisations for the language. This is ;; where you should place YOUR customisations. ;; ;; Sometimes there is a definition(s) in here that override definitions in the ;; main language template file that are here to make that definition more ;; "usable" - this is because I (primarily) try and generate/maintain the main ;; .lse files from EBNF definitions of the language. Sometimes I just can't ;; express the appropriate customisation in the EBNF and so I am forced to ;; override the placeholder definition in this file. ;; ;; This entries in this file should be used as an example of how to create your ;; own customisations. I would caution that you don't delete any definitions ;; though until you are sure that your edit sessions will not be adversely ;; affected. The best way to check out the effects of a delete is to "compile" ;; (else-compile-buffer) the "delete" command for that definition (this will ;; remove it from your edit session and you can nolonger access the definition ;; until next you load language template files) and then see whether anything ;; has been "lost" in your code generation ability i.e. say you think you don't ;; need the definition for placeholder XXX, just place the following lines at ;; the end of one of your source files (when ELSE is enabled for that buffer) ;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at ;; the beginning of the line: ;; ;; DELETE PLACEHOLDER XXX - ;; /LANGUAGE = "Python" - ;; ;; This will delete definition XXX from memory. ;; ;;****************************************************************************** DEFINE LANGUAGE Python - /VALID_IDENTIFIER_CHARACTERS="#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789" /INDENT_SIZE=2 END DEFINE DELETE PLACEHOLDER ", IDENTIFIER" - /LANGUAGE="Python" - DEFINE PLACEHOLDER ", IDENTIFIER" - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" - /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL ", {identifier}" END DEFINE DELETE PLACEHOLDER CALL_STMT - /LANGUAGE="Python" - DEFINE PLACEHOLDER CALL_STMT - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL - "{primary} ([parameter_association]...);" END DEFINE DELETE PLACEHOLDER FUNCDEF - /LANGUAGE="Python" - DEFINE PLACEHOLDER FUNCDEF - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL - "def {identifier} ([defparameter]...):" " [document_string]" " {statement}..." "" END DEFINE DELETE PLACEHOLDER CLASSDEF - /LANGUAGE="Python" - DEFINE PLACEHOLDER CLASSDEF - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL - "class {classname} [inheritance]:" " [init_def]" " " " [class_funcdef]..." " " END DEFINE DELETE PLACEHOLDER INIT_DEF - /LANGUAGE="Python" - DEFINE PLACEHOLDER INIT_DEF - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="Provides an __init__ def." - /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL "def __init__ (self, [defparameter]...):" " [document_string]" " {statement}..." "" END DEFINE DELETE PLACEHOLDER CLASS_FUNCDEF - /LANGUAGE="Python" - DEFINE PLACEHOLDER CLASS_FUNCDEF - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="Function definition when within a class" - /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL "def {identifier} (self, [defparameter]...):" " [document_string]" " {statement}..." " " END DEFINE DELETE PLACEHOLDER MY_CLASSDEF - /LANGUAGE="Python" - DEFINE PLACEHOLDER MY_CLASSDEF - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL - "class {classname} ({superclass}...):" "" " def __init__(self):" " {superclass}._init_(self)" " [class_funcdef]..." " " END DEFINE DELETE PLACEHOLDER SUPERCLASS - /LANGUAGE="Python" - DEFINE PLACEHOLDER SUPERCLASS - /LANGUAGE="Python" - /AUTO_SUBSTITUTE - /DESCRIPTION="" - /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=TERMINAL - "Type in the name of the superclass." END DEFINE DELETE PLACEHOLDER COMPILATION_UNIT - /LANGUAGE="Python" - DEFINE PLACEHOLDER COMPILATION_UNIT - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL - """"[text]..."""" "[import_stmt]..." "{statement}..." "[test_statement]" END DEFINE DELETE TOKEN CD - /LANGUAGE="Python" - DEFINE TOKEN CD - /LANGUAGE="Python" - /DESCRIPTION="" - "def {member_name} (self, value = None):" " [document_string]" " if value == {member_name}:" " return self.{member_name}" " else:" " self.{member_name} = value" " self.Dump()" END DEFINE DELETE PLACEHOLDER MEMBER_NAME - /LANGUAGE="Python" - DEFINE PLACEHOLDER MEMBER_NAME - /LANGUAGE="Python" - /AUTO_SUBSTITUTE - /SUBSTITUTE_COUNT=4 /DESCRIPTION="" /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=TERMINAL "Enter the member name of the class" END DEFINE DELETE PLACEHOLDER TEST_STATEMENT - /LANGUAGE="Python" - DEFINE PLACEHOLDER TEST_STATEMENT - /LANGUAGE="Python" - /NOAUTO_SUBSTITUTE - /DESCRIPTION="" - /DUPLICATION=CONTEXT_DEPENDENT - /SEPARATOR="" - /TYPE=NONTERMINAL "if __name__ == '__main__':" " {statement}..." END DEFINE