alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jEdit example source code file (freemarker.xml)

This example jEdit source code file (freemarker.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jEdit tags/keywords

begin, begin, delegate, end, keyword1, operator, rules, seq, seq, span, span, span_regexp, type, type

The jEdit freemarker.xml source code

<?xml version="1.0"?>

<!DOCTYPE MODE SYSTEM "xmode.dtd">

<!-- A JEdit mode configuration file for FTL (FreeMarker Template Language)
     Note that this version will only work with JEdit 4.1pre6 or later.
     by Jonathan Revusky, revusky@users.sourceforge.net -->

<MODE>
  <RULES IGNORE_CASE="FALSE">

    <!-- JavaScript -->
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN><script
    <END></script>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN><Script
    <END></Script>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN><SCRIPT
    <END></SCRIPT>
    </SPAN>

    <!-- stylesheet -->
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN><style
    <END></style>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN><Style
    <END></Style>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN><STYLE
    <END></STYLE>
    </SPAN>

    <!-- XML/HTML comment -->
    <SPAN TYPE="COMMENT2" DELEGATE="xml::DTD-TAGS">
    <BEGIN><!--
    <END>-->
    </SPAN>

    <!-- DTD instructions -->
    <SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
    <BEGIN><!
    <END>>
    </SPAN>

    <!-- FTL markup starts here. -->

    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
      <BEGIN>${
      <END>}
    </SPAN>

    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
      <BEGIN>#{
      <END>}
    </SPAN>

    <SPAN_REGEXP TYPE="KEYWORD1" HASH_CHAR="<#ftl" DELEGATE="EXPRESSION">
      <BEGIN><#ftl\b
      <END>>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="<">
      <BEGIN><#?(if|elseif|switch|foreach|list|case|assign|local|global|setting|include|import|stop|escape|macro|function|transform|call|visit|recurse)(\s|/|$)
      <END>>
    </SPAN_REGEXP>

    <SEQ_REGEXP TYPE="KEYWORD1" HASH_CHAR="</"
	></#?(assign|local|global|if|switch|foreach|list|escape|macro|function|transform|compress|noescape)></SEQ_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="<">
      <BEGIN><#?(else|compress|noescape|default|break|flush|nested|t|rt|lt|return|recurse)\b
      <END>>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="</@">
      <BEGIN></@(([_@\p{Alpha}][_@\p{Alnum}]*)(\.[_@\p{Alpha}][_@\p{Alnum}]*)*?)?
      <END>>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="<@">
      <BEGIN><@([_@\p{Alpha}][_@\p{Alnum}]*)(\.[_@\p{Alpha}][_@\p{Alnum}]*?)*
      <END>>
    </SPAN_REGEXP>

    <SPAN TYPE="COMMENT1">
      <BEGIN><#--
      <END>-->
    </SPAN>

    <SEQ TYPE="KEYWORD1"><stop>
     <SPAN TYPE="COMMENT1">
    <BEGIN><comment>
    <END></comment>
    </SPAN>
    <SPAN TYPE="INVALID">
      <BEGIN><#
      <END>>
    </SPAN>
    <SPAN TYPE="INVALID">
      <BEGIN></#
      <END>>
    </SPAN>

    <!-- non-FTL markup -->
    <SPAN TYPE="MARKUP" DELEGATE="TAGS">
    <BEGIN><
    <END>>
    </SPAN>
  </RULES>

  <RULES SET="EXPRESSION"
      DEFAULT="KEYWORD2"
      HIGHLIGHT_DIGITS="TRUE"
      IGNORE_CASE="FALSE"
    >
    <SPAN TYPE="COMMENT1">
      <BEGIN><#--
      <END>-->
    </SPAN>
    <SPAN TYPE="COMMENT1">
      <BEGIN><!--
      <END>-->
    </SPAN>

    <SPAN TYPE="LITERAL1" ESCAPE="\">
    <BEGIN>"
    <END>"
    </SPAN>
    <SPAN TYPE="OPERATOR" DELEGATE="EXPRESSION">
      <BEGIN>()
    </SPAN>
    <SEQ TYPE="OPERATOR">=
    <SEQ TYPE="OPERATOR">!
    <SEQ TYPE="OPERATOR">|
    <SEQ TYPE="OPERATOR">&
    <SEQ TYPE="OPERATOR"><
    <SEQ TYPE="OPERATOR">>
    <SEQ TYPE="OPERATOR">*
    <SEQ TYPE="OPERATOR">/
    <SEQ TYPE="OPERATOR">-
    <SEQ TYPE="OPERATOR">+
    <SEQ TYPE="OPERATOR">%
    <SEQ TYPE="OPERATOR">.
    <SEQ TYPE="OPERATOR">:
    <SEQ TYPE="OPERATOR">.
    <SEQ TYPE="OPERATOR">.
    <SEQ TYPE="OPERATOR">[
    <SEQ TYPE="OPERATOR">]
    <SEQ TYPE="OPERATOR">{
    <SEQ TYPE="OPERATOR">}
    <SEQ TYPE="OPERATOR">;
    <!-- Builtins -->
    <MARK_FOLLOWING TYPE="FUNCTION">?
    <KEYWORDS>
      <KEYWORD1>true
      <KEYWORD1>false
      <KEYWORD1>as
      <KEYWORD1>in
      <KEYWORD1>using
      <OPERATOR>gt
      <OPERATOR>gte
      <OPERATOR>lt
      <OPERATOR>lte
    </KEYWORDS>
  </RULES>

  <RULES SET="TAGS" DEFAULT="MARKUP">
    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
    <BEGIN>"
    <END>"
    </SPAN>

    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
    <BEGIN>'
    <END>'
    </SPAN>

    <SEQ TYPE="OPERATOR">=
  </RULES>


  <!-- a ruleset for when we are within a quoted string within an SGML tag
       It can contain FTL interpolations -->
  <RULES SET="INQUOTE" ESCAPE="\">
    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
    <BEGIN>${
    <END>}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
    <BEGIN>#{
    <END>}
    </SPAN>
  </RULES>

  <!-- empty ruleset to delegate to for spots where any non-whitespace is invalid -->
  <RULES SET="INVALID" DEFAULT="INVALID" />
</MODE>

Other jEdit examples (source code examples)

Here is a short list of links related to this jEdit freemarker.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.