a2ps-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab style-sheet


From: Joakim Lubeck
Subject: Re: Matlab style-sheet
Date: Tue, 24 Sep 2002 14:18:07 +0200

Akim Demaille wrote:
> 
> | Franck Lombardi wrote:
> | >
> | > Hi,
> | >
> | > In A2ps cvs version, there is a matlab4 style sheet.
> | > What the difference with your sheet ??
> | >
> | > Your sheet is necessary in spite of the matlab4 sheet ?
> | >
> | > thanks
> | >
> |
> | There are a couple of things I don't like about the matlab4 sheet.
> 
> Then it would be good if the documentation section could include this
> information :)

You're right. A little bit of documentation could be usefull.
I've added some. Is it ok now? (Would it be ok to let this
style be default for .m files?)

/Joakim Lübeck

matlab.ssh:
---
# Style sheet for Matlab
# Copyright (c) 2002, Joakim Lübeck
#
# This program 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.
#
# This program 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 this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

style "Matlab" is
written by "Joakim Lübeck <address@hidden>"
version is 0.93
requires a2ps 4.13

documentation is
   "This style highlights function definitions and a limited"
   "number of keywords, mostly control constructs, and is"
   "therefore usable for many Matlab versions. Special care" 
   "have been taken to distinguish string delimiters from the" 
   "transpose operator (which is the same symbol) and to"
   "recognize comments."
end documentation

first alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
second alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789"
case sensitive

keywords in Label_strong are
   dbclear, dbcont, dbdown, dbmex, dbquit, dbstack, dbstatus,
   dbstep, dbstop, dbtype, dbup
end keywords

keywords in Keyword_strong are
   break, builtin, "case", catch, else, elseif, "end", error,
   eval, evalc, evalin, feval, for, global, if, otherwise,
   persistent, return, switch, try, warning, while
end keywords

sequences are
   "%" Comment,
   ' Plain String ' Plain
      exceptions are
         ''
      end exceptions
end sequences

operators are
   # Transpose
   /[A-z0-9_]*[]A-Za-z0-9_.)}']'/,

   ... \ldots,

   # function without output arguments
   (/(function)/
      /([ \t]+)/
      /([a-zA-z][a-zA-Z0-9_]*)/
      \1 Keyword_strong, \2 Plain, \3 Label_strong),

   # function with output arguments
   (/(function)/
      /([ \t]+[^=]+=[ \t]*)/
      /([a-zA-z][a-zA-Z0-9_]*)/
      \1 Keyword_strong, \2 Plain, \3 Label_strong)
end operators

optional keywords in Plain are
   Inf \infty,
   inf \infty,
   pi  \pi
end keywords

optional operators are
   ~   \not,
   |   \vee,
   &   \wedge,
   ~=  \neq,
   <=  \leq,
   >=  \geq,
   ==  \equiv
end operators


end style




reply via email to

[Prev in Thread] Current Thread [Next in Thread]