/* * * 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.plog4u.wiki.macro.code; import java.util.HashMap; import java.util.HashSet; import org.radeox.macro.code.SourceCodeFormatter; /** * Java CodeFilter colourizes C# source code * */ public class PHPCodeFilter extends AbstractCPPBasedCodeFilter implements SourceCodeFormatter { private static HashMap KEYWORD_SET = new HashMap(); private static final String[] KEYWORDS = { "if", "elseif", "else", "endif", "for", "endfor", "while", "endwhile", "switch", "case", "endswitch", "break", "continue", "return", "include", "include_once", "require", "require_once", "function", "class", "new", "do", "old_function", "default", "global", "static", "foreach", "endforeach", "extends", "empty", "array", "echo", "var", "as", "print", "unset", "exit", "and", "or", "xor", "list", "null", "false", "true", "abstract", "catch", "finally", "try", "private", "protected", "public", "interface", "implements", "instanceof", "super", "throw", "const", "declare", "enddeclare", "eval", "use", "isset", "final" }; { for (int i = 0; i < KEYWORDS.length; i++) { //KEYWORD_SET.put(KEYWORDS[i], ""+KEYWORDS[i]+""); createHashMap(KEYWORD_SET, KEYWORDS[i]); } } public PHPCodeFilter() { } /** * @return Returns the KEYWORD_SET. */ public HashMap getKeywordSet() { return KEYWORD_SET; } public String getName() { return "php"; } /** * @return Returns the OBJECT_SET. */ public HashSet getObjectSet() { return null; } /* * (non-Javadoc) * * @see net.sourceforge.phpeclipse.wiki.macro.code.AbstractCPPBasedCodeFilter#isKeywordLowerCase() */ public boolean isKeywordLowerCase() { return false; } /** * */ public boolean isPHPTag() { return true; } }