[hmath-commits] org.hmath.server/WEB-INF/src/org/hmath/server/macro/code CHashCodeFilter.java,NONE,1
Status: Pre-Alpha
Brought to you by:
jsurfer
|
From: Klaus H. <js...@us...> - 2004-04-02 18:31:52
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hmath/server/macro/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10875/WEB-INF/src/org/hmath/server/macro/code Added Files: CHashCodeFilter.java Log Message: misc changes --- NEW FILE: CHashCodeFilter.java --- /* * This file is part of "SnipSnap Radeox Rendering Engine". * * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel All Rights Reserved. * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hmath.server.macro.code; import org.radeox.macro.code.DefaultRegexCodeFormatter; import org.radeox.macro.code.SourceCodeFormatter; /* * JavaCodeFilter colourizes Java source code * * @author stephan @team sonicteam * * @version $Id: CHashCodeFilter.java,v 1.1 2004/04/02 18:19:39 jsurfer Exp $ */ public class CHashCodeFilter extends DefaultRegexCodeFormatter implements SourceCodeFormatter { private static final String KEYWORDS = "\\b(abstract|event|new|struct|as|explicit|null|switch|base|extern" + "object|this|bool|false|operator|throw|break|finally|out|true" + "byte|fixed|override|try|case|float|params|typeof|catch|for" + "private|uint|char|foreach|protected|ulong|checked|goto|public" + "unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort" + "continue|in|return|using|decimal|int|sbyte|virtual|default" + "interface|sealed|volatile|delegate|internal|short|void|do|is" + "sizeof|while|double|lock|stackalloc|else|long|static|enum" + "namespace|string)\\b"; // private static final String OBJECTS = // "\\b(Boolean|Byte|Character|Class|ClassLoader|Cloneable|Compiler|" // + "Double|Float|Integer|Long|Math|Number|Object|Process|" // + "Runnable|Runtime|SecurityManager|Short|String|StringBuffer|" // + "System|Thread|ThreadGroup|Void|boolean|char|byte|short|int|long|float|double)\\b"; private static final String QUOTES = "\"(([^\"\\\\]|\\.)*)\""; public CHashCodeFilter() { super(QUOTES, "<span class=\"java-quote\">\"$1\"</span>"); addRegex(KEYWORDS, "<span class=\"java-keyword\">$1</span>"); // addRegex(OBJECTS, "<span class=\"java-object\">$1</span>"); } public String getName() { return "chash"; } } |