a2ps-patches
[Top][All Lists]
Advanced

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

Add style sheet for Stratego


From: Alix Lourme / Axel
Subject: Add style sheet for Stratego
Date: 27 Dec 2002 23:52:56 +0100

Hi, 
I had the style sheet for Stratego, 
"bonne année à tous" !


Index: ChangeLog
from  Axel  <address@hidden>

        * sheets/stratego.ssh : Add new style for Stratego.
        From Nicolas Tisserand <address@hidden>
        * sheets/sheets.map : Add binary rule str for Stratego

Index: sheets/Makefile.am
===================================================================
RCS file: /cvsroot/a2ps/a2ps/sheets/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- sheets/Makefile.am 3 Oct 2002 16:34:54 -0000 1.8
+++ sheets/Makefile.am 27 Dec 2002 22:50:09 -0000
@@ -26,9 +26,9 @@
 matlab4.ssh mib.ssh mly.ssh modula2.ssh modula3.ssh nasm.ssh o2c.ssh   \
 oberon.ssh octave.ssh oracle.ssh pic16f84.ssh plsql.ssh pov.ssh
ppd.ssh \
 ps.ssh prolog.ssh promela.ssh python.ssh rexx.ssh sather.ssh
sdl88.ssh       \
-sed.ssh        small.ssh sml.ssh specc.ssh sql.ssh sql92.ssh tclx.ssh
tcsh.ssh        \
-tex.ssh        texinfo.ssh tiger.ssh unity.ssh vba.ssh verilog.ssh vhdl.ssh    
\
-vrml.ssh vtcl.ssh yacc.ssh xs.ssh zsh.ssh
+sed.ssh        small.ssh sml.ssh specc.ssh sql.ssh sql92.ssh stratego.ssh      
\
+tclx.ssh tcsh.ssh tex.ssh texinfo.ssh tiger.ssh unity.ssh vba.ssh      \
+verilog.ssh vhdl.ssh vrml.ssh vtcl.ssh yacc.ssh xs.ssh zsh.ssh
 
 if EXTENSIONS
 sheets_DATA = sheets.map $(major_sheets) $(minor_sheets)
Index: sheets/sheets.map
===================================================================
RCS file: /cvsroot/a2ps/a2ps/sheets/sheets.map,v
retrieving revision 1.7
diff -u -r1.7 sheets.map
--- sheets/sheets.map 27 Dec 2002 21:55:26 -0000 1.7
+++ sheets/sheets.map 27 Dec 2002 22:50:09 -0000
@@ -516,3 +516,6 @@
 # Yacc/Bison grammars
 yacc:  /*.y/
        /*.yacc/
+
+# Stratego files
+stratego:      /*.str/
Index: sheets/stratego.ssh
===================================================================
RCS file: sheets/stratego.ssh
diff -N sheets/stratego.ssh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ sheets/stratego.ssh 27 Dec 2002 22:50:09 -0000
@@ -0,0 +1,108 @@
+# Style sheet for stratego
+# Copyright (c) 2002 Nicolas Tisserand
+#
+
+#
+# This file is part of a2ps.
+# 
+# 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.
+#
+
+#
+# This style sheet is based on the stratego grammar :
+# http://www.cwi.nl/~mdejonge/grammar-base/stratego.0.7/index.html
+#
+
+style "stratego" is
+
+written by "Nicolas Tisserand <address@hidden>"
+
+version is 1.0
+
+requires a2ps 4.9.5
+
+documentation is
+       "Highlights stratego source code"
+end documentation
+
+first alphabet is
+       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.-_"
+second alphabet is
+       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.-_'"
+case sensitive
+
+keywords in Keyword_strong are
+       "all", "constructors", "fail", "id", "imports", "in", "let", "module",
+       "not", "one", "overlays", "override", "prim", "rules", "script",
+       "signature", "some", "sorts", "strategies", "stratego", "test",
+       "thread", "where"
+end keywords
+
+# common keywords from the stratego library
+keywords in Keyword are
+       "try", "if", "ior", "eq", "repeat", "repeat-until",
+       "while", "do-while", "for", "topdown", "bottomup", "downup",
+       "minus", "plus", "add", "subt", "mul", "div", "mod",
+       "geq", "gt", "lt", "leq", "max", "min", "int",
+       "is-int", "int-to-string", "string-to-int",
+       "new", "is-string", "lower-case", "upper-case",
+       "init-name-space", "exit-name-space", "begin-scope", "end-scope",
+       "scope", "assert", "rewrite",
+       "list", "map", "is-list", "length", "fetch", "lookup",
+       "last", "init", "copy",
+       "take", "take-while", "take-until",
+       "drop", "drop-while", "drop-until", 
+       "substitute", "diff", "pattern-match", "unify", "equal",
+       "print", "WriteToTextFile", "WriteToBinaryFile",
+       "open-file", "append-file", "close-file",
+       "say", "echo", "trace", "error", "fatal-error",
+       "printchar", "print-string", "iowrap",
+       "pipe", "exit", "call"
+end keywords
+
+operators in Keyword_strong are
+       -> \rightarrow,
+       -->,
+       =,
+       #,
+       @,
+       _,
+       |,      
+       ],
+       [,
+       ^,
+       },
+       { ,
+       "+" ,
+       "<" ,
+       "<+" ,
+       "<++" ,
+       ">" ,
+       "+>" ,
+       "++>" ,
+       (/^([\t ]*[a-zA-Z0-9'._\-]*)([\t ]*[:=])/ \1 Label_strong, \2 Plain)
+end operators
+
+sequences are
+       "/*" Comment "*/",
+       "//" Comment,
+       "(*" Comment "*)",
+       "\\literate" Comment "\\begin{code}",
+       "\\end{code}" Comment "\\begin{code}",
+       C-string
+end sequences
+
+end style






reply via email to

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