freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [4/4] incubator-freemarker git commit: Some internal cleanup: Renamed ArithmeticExpression to ASTExpArithmetic. Renamed ASTNode.getNodeTypeSymbol to getASTNodeDescriptor.
Date Sat, 17 Jun 2017 13:14:38 GMT
Some internal cleanup: Renamed ArithmeticExpression to ASTExpArithmetic. Renamed ASTNode.getNodeTypeSymbol to getASTNodeDescriptor.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/cb4a93dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/cb4a93dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/cb4a93dc

Branch: refs/heads/3
Commit: cb4a93dc2cbef81c98109814ec2193d39661c1fb
Parents: f50c53f
Author: ddekany <ddekany@apache.org>
Authored: Sat Jun 17 15:14:09 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sat Jun 17 15:14:09 2017 +0200

----------------------------------------------------------------------
 .../org/apache/freemarker/core/ASTPrinter.java  |   2 +-
 .../org/apache/freemarker/core/ast-1.ast        |   2 +-
 .../org/apache/freemarker/core/ast-range.ast    |  26 ++--
 .../org/apache/freemarker/core/ASTComment.java  |   2 +-
 .../apache/freemarker/core/ASTDebugBreak.java   |   2 +-
 .../freemarker/core/ASTDirAssignment.java       |  24 ++--
 .../core/ASTDirAssignmentsContainer.java        |   2 +-
 .../core/ASTDirAttemptRecoverContainer.java     |   8 +-
 .../apache/freemarker/core/ASTDirAutoEsc.java   |   6 +-
 .../org/apache/freemarker/core/ASTDirBreak.java |   4 +-
 .../core/ASTDirCapturingAssignment.java         |   6 +-
 .../org/apache/freemarker/core/ASTDirCase.java  |   4 +-
 .../apache/freemarker/core/ASTDirCompress.java  |   6 +-
 .../freemarker/core/ASTDirElseOfList.java       |   6 +-
 .../apache/freemarker/core/ASTDirEscape.java    |   6 +-
 .../apache/freemarker/core/ASTDirFallback.java  |   4 +-
 .../org/apache/freemarker/core/ASTDirFlush.java |   4 +-
 .../core/ASTDirIfElseIfElseContainer.java       |   4 +-
 .../freemarker/core/ASTDirIfOrElseOrElseIf.java |   4 +-
 .../apache/freemarker/core/ASTDirImport.java    |   4 +-
 .../apache/freemarker/core/ASTDirInclude.java   |   4 +-
 .../org/apache/freemarker/core/ASTDirItems.java |   8 +-
 .../org/apache/freemarker/core/ASTDirList.java  |   6 +-
 .../core/ASTDirListElseContainer.java           |   4 +-
 .../org/apache/freemarker/core/ASTDirMacro.java |   6 +-
 .../apache/freemarker/core/ASTDirNested.java    |   4 +-
 .../apache/freemarker/core/ASTDirNoAutoEsc.java |   6 +-
 .../apache/freemarker/core/ASTDirNoEscape.java  |   8 +-
 .../freemarker/core/ASTDirOutputFormat.java     |   8 +-
 .../apache/freemarker/core/ASTDirRecover.java   |   6 +-
 .../apache/freemarker/core/ASTDirRecurse.java   |   4 +-
 .../apache/freemarker/core/ASTDirReturn.java    |   4 +-
 .../org/apache/freemarker/core/ASTDirSep.java   |   8 +-
 .../apache/freemarker/core/ASTDirSetting.java   |   4 +-
 .../org/apache/freemarker/core/ASTDirStop.java  |   4 +-
 .../apache/freemarker/core/ASTDirSwitch.java    |   6 +-
 .../apache/freemarker/core/ASTDirTOrTrOrTl.java |   4 +-
 .../freemarker/core/ASTDirUserDefined.java      |   2 +-
 .../org/apache/freemarker/core/ASTDirVisit.java |   4 +-
 .../freemarker/core/ASTDollarInterpolation.java |   2 +-
 .../org/apache/freemarker/core/ASTElement.java  |   2 +-
 .../freemarker/core/ASTExpAddOrConcat.java      |   2 +-
 .../org/apache/freemarker/core/ASTExpAnd.java   |   2 +-
 .../freemarker/core/ASTExpArithmetic.java       | 129 +++++++++++++++++++
 .../freemarker/core/ASTExpBooleanLiteral.java   |   2 +-
 .../apache/freemarker/core/ASTExpBuiltIn.java   |   2 +-
 .../freemarker/core/ASTExpBuiltInVariable.java  |   2 +-
 .../freemarker/core/ASTExpComparison.java       |   2 +-
 .../apache/freemarker/core/ASTExpDefault.java   |   2 +-
 .../org/apache/freemarker/core/ASTExpDot.java   |   4 +-
 .../freemarker/core/ASTExpDynamicKeyName.java   |   2 +-
 .../apache/freemarker/core/ASTExpExists.java    |   4 +-
 .../freemarker/core/ASTExpHashLiteral.java      |   2 +-
 .../freemarker/core/ASTExpListLiteral.java      |   2 +-
 .../freemarker/core/ASTExpMethodCall.java       |   2 +-
 .../freemarker/core/ASTExpNegateOrPlus.java     |   2 +-
 .../org/apache/freemarker/core/ASTExpNot.java   |   2 +-
 .../freemarker/core/ASTExpNumberLiteral.java    |   2 +-
 .../org/apache/freemarker/core/ASTExpOr.java    |   2 +-
 .../freemarker/core/ASTExpParenthesis.java      |   2 +-
 .../org/apache/freemarker/core/ASTExpRange.java |   4 +-
 .../freemarker/core/ASTExpStringLiteral.java    |   2 +-
 .../apache/freemarker/core/ASTExpVariable.java  |   2 +-
 .../freemarker/core/ASTHashInterpolation.java   |   2 +-
 .../freemarker/core/ASTImplicitParent.java      |   4 +-
 .../org/apache/freemarker/core/ASTNode.java     |   9 +-
 .../apache/freemarker/core/ASTStaticText.java   |   2 +-
 .../freemarker/core/ArithmeticExpression.java   | 129 -------------------
 .../core/BuiltInWithParseTimeParameters.java    |   4 +-
 .../freemarker/core/ParsingConfiguration.java   |   5 +-
 ...nterruptionSupportTemplatePostProcessor.java |   4 +-
 .../core/_ErrorDescriptionBuilder.java          |   2 +-
 freemarker-core/src/main/javacc/FTL.jj          |  12 +-
 73 files changed, 289 insertions(+), 291 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core-test/src/test/java/org/apache/freemarker/core/ASTPrinter.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/ASTPrinter.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/ASTPrinter.java
index 3518b29..299c70f 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/ASTPrinter.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/ASTPrinter.java
@@ -321,7 +321,7 @@ public class ASTPrinter {
             ASTNode tObj = (ASTNode) node;
 
             printNodeLineStart(paramRole, ind, out);
-            out.write(tObj.getNodeTypeSymbol());
+            out.write(tObj.getASTNodeDescriptor());
             printNodeLineEnd(node, out, opts);
             
             if (opts.getShowConstantValue() && node instanceof ASTExpression) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-1.ast
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-1.ast b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-1.ast
index 1cdd496..9021a8c 100644
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-1.ast
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-1.ast
@@ -86,7 +86,7 @@
                 - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
                     - value part: "x"  // String
                     - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
-                        - content: *  // o.a.f.c.ArithmeticExpression
+                        - content: *  // o.a.f.c.ASTExpArithmetic
                             - left-hand operand: baaz  // o.a.f.c.ASTExpVariable
                             - right-hand operand: 10  // o.a.f.c.ASTExpNumberLiteral
                             - AST-node subtype: "1"  // Integer

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-range.ast
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-range.ast b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-range.ast
index 831c7dc..060934e 100644
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-range.ast
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-range.ast
@@ -89,11 +89,11 @@
         - assignment target: "x"  // String
         - assignment operator: "="  // String
         - assignment source: ..  // o.a.f.c.ASTExpRange
-            - left-hand operand: *  // o.a.f.c.ArithmeticExpression
+            - left-hand operand: *  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: n  // o.a.f.c.ASTExpVariable
                 - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - AST-node subtype: "1"  // Integer
-            - right-hand operand: *  // o.a.f.c.ArithmeticExpression
+            - right-hand operand: *  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: m  // o.a.f.c.ASTExpVariable
                 - right-hand operand: 2  // o.a.f.c.ASTExpNumberLiteral
                 - AST-node subtype: "1"  // Integer
@@ -149,8 +149,8 @@
                         - left-hand operand: n  // o.a.f.c.ASTExpVariable
                         - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                     - right-hand operand: 2  // o.a.f.c.ASTExpNumberLiteral
-                - right-hand operand: -  // o.a.f.c.ArithmeticExpression
-                    - left-hand operand: -  // o.a.f.c.ArithmeticExpression
+                - right-hand operand: -  // o.a.f.c.ASTExpArithmetic
+                    - left-hand operand: -  // o.a.f.c.ASTExpArithmetic
                         - left-hand operand: m  // o.a.f.c.ASTExpVariable
                         - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                         - AST-node subtype: "0"  // Integer
@@ -162,8 +162,8 @@
                         - left-hand operand: o  // o.a.f.c.ASTExpVariable
                         - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                     - right-hand operand: 2  // o.a.f.c.ASTExpNumberLiteral
-                - right-hand operand: -  // o.a.f.c.ArithmeticExpression
-                    - left-hand operand: -  // o.a.f.c.ArithmeticExpression
+                - right-hand operand: -  // o.a.f.c.ASTExpArithmetic
+                    - left-hand operand: -  // o.a.f.c.ASTExpArithmetic
                         - left-hand operand: p  // o.a.f.c.ASTExpVariable
                         - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                         - AST-node subtype: "0"  // Integer
@@ -187,7 +187,7 @@
         - assignment target: "x"  // String
         - assignment operator: "="  // String
         - assignment source: ..  // o.a.f.c.ASTExpRange
-            - left-hand operand: -  // o.a.f.c.ArithmeticExpression
+            - left-hand operand: -  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - right-hand operand: a  // o.a.f.c.ASTExpVariable
                 - AST-node subtype: "0"  // Integer
@@ -200,7 +200,7 @@
         - assignment target: "x"  // String
         - assignment operator: "="  // String
         - assignment source: ..*  // o.a.f.c.ASTExpRange
-            - left-hand operand: *  // o.a.f.c.ArithmeticExpression
+            - left-hand operand: *  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - right-hand operand: a  // o.a.f.c.ASTExpVariable
                 - AST-node subtype: "1"  // Integer
@@ -242,7 +242,7 @@
                 - left-hand operand: m  // o.a.f.c.ASTExpVariable
                 - right-hand operand: null  // Null
             - argument value: ..  // o.a.f.c.ASTExpRange
-                - left-hand operand: -  // o.a.f.c.ArithmeticExpression
+                - left-hand operand: -  // o.a.f.c.ASTExpArithmetic
                     - left-hand operand: m  // o.a.f.c.ASTExpVariable
                     - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                     - AST-node subtype: "0"  // Integer
@@ -251,7 +251,7 @@
                 - left-hand operand: +  // o.a.f.c.ASTExpAddOrConcat
                     - left-hand operand: m  // o.a.f.c.ASTExpVariable
                     - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
-                - right-hand operand: -  // o.a.f.c.ArithmeticExpression
+                - right-hand operand: -  // o.a.f.c.ASTExpArithmetic
                     - left-hand operand: n  // o.a.f.c.ASTExpVariable
                     - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                     - AST-node subtype: "0"  // Integer
@@ -260,11 +260,11 @@
     @  // o.a.f.c.ASTDirUserDefined
         - callee: m  // o.a.f.c.ASTExpVariable
         - argument value: ..  // o.a.f.c.ASTExpRange
-            - left-hand operand: *  // o.a.f.c.ArithmeticExpression
+            - left-hand operand: *  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - right-hand operand: m  // o.a.f.c.ASTExpVariable
                 - AST-node subtype: "1"  // Integer
-            - right-hand operand: -  // o.a.f.c.ArithmeticExpression
+            - right-hand operand: -  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: m  // o.a.f.c.ASTExpVariable
                 - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - AST-node subtype: "0"  // Integer
@@ -272,7 +272,7 @@
             - left-hand operand: +  // o.a.f.c.ASTExpAddOrConcat
                 - left-hand operand: m  // o.a.f.c.ASTExpVariable
                 - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
-            - right-hand operand: -  // o.a.f.c.ArithmeticExpression
+            - right-hand operand: -  // o.a.f.c.ASTExpArithmetic
                 - left-hand operand: n  // o.a.f.c.ASTExpVariable
                 - right-hand operand: 1  // o.a.f.c.ASTExpNumberLiteral
                 - AST-node subtype: "0"  // Integer

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTComment.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTComment.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTComment.java
index 7ee2695..2efd4f7 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTComment.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTComment.java
@@ -48,7 +48,7 @@ final class ASTComment extends ASTElement {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#--...--";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDebugBreak.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDebugBreak.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDebugBreak.java
index fe42f41..577daff 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDebugBreak.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDebugBreak.java
@@ -62,7 +62,7 @@ class ASTDebugBreak extends ASTElement {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#debug_break";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
index 4961f7f..db008f5 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
@@ -32,7 +32,7 @@ import org.apache.freemarker.core.util._StringUtil;
  */
 final class ASTDirAssignment extends ASTDirective {
 
-    // These must not clash with ArithmeticExpression.TYPE_... constants: 
+    // These must not clash with ASTExpArithmetic.TYPE_... constants:
     private static final int OPERATOR_TYPE_EQUALS = 0x10000;
     private static final int OPERATOR_TYPE_PLUS_EQUALS = 0x10001;
     private static final int OPERATOR_TYPE_PLUS_PLUS = 0x10002;
@@ -77,16 +77,16 @@ final class ASTDirAssignment extends ASTDirective {
                 operatorType = OPERATOR_TYPE_PLUS_EQUALS;
                 break;
             case FMParserConstants.MINUS_EQUALS:
-                operatorType = ArithmeticExpression.TYPE_SUBSTRACTION;
+                operatorType = ASTExpArithmetic.TYPE_SUBSTRACTION;
                 break;
             case FMParserConstants.TIMES_EQUALS:
-                operatorType = ArithmeticExpression.TYPE_MULTIPLICATION;
+                operatorType = ASTExpArithmetic.TYPE_MULTIPLICATION;
                 break;
             case FMParserConstants.DIV_EQUALS:
-                operatorType = ArithmeticExpression.TYPE_DIVISION;
+                operatorType = ASTExpArithmetic.TYPE_DIVISION;
                 break;
             case FMParserConstants.MOD_EQUALS:
-                operatorType = ArithmeticExpression.TYPE_MODULO;
+                operatorType = ASTExpArithmetic.TYPE_MODULO;
                 break;
             default:
                 throw new BugException();
@@ -164,11 +164,11 @@ final class ASTDirAssignment extends ASTDirective {
                 if (operatorType == OPERATOR_TYPE_PLUS_PLUS) {
                     value  = ASTExpAddOrConcat._evalOnNumbers(env, getParent(), lhoNumber, ONE);
                 } else if (operatorType == OPERATOR_TYPE_MINUS_MINUS) {
-                    value = ArithmeticExpression._eval(
-                            env, getParent(), lhoNumber, ArithmeticExpression.TYPE_SUBSTRACTION, ONE);
-                } else { // operatorType == ArithmeticExpression.TYPE_...
+                    value = ASTExpArithmetic._eval(
+                            env, getParent(), lhoNumber, ASTExpArithmetic.TYPE_SUBSTRACTION, ONE);
+                } else { // operatorType == ASTExpArithmetic.TYPE_...
                     Number rhoNumber = valueExp.evalToNumber(env);
-                    value = ArithmeticExpression._eval(env, this, lhoNumber, operatorType, rhoNumber);
+                    value = ASTExpArithmetic._eval(env, this, lhoNumber, operatorType, rhoNumber);
                 }
             }
         }
@@ -184,7 +184,7 @@ final class ASTDirAssignment extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
-        String dn = getParent() instanceof ASTDirAssignmentsContainer ? null : getNodeTypeSymbol();
+        String dn = getParent() instanceof ASTDirAssignmentsContainer ? null : getASTNodeDescriptor();
         if (dn != null) {
             if (canonical) buf.append("<");
             buf.append(dn);
@@ -212,7 +212,7 @@ final class ASTDirAssignment extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return getDirectiveName(scope);
     }
     
@@ -272,7 +272,7 @@ final class ASTDirAssignment extends ASTDirective {
         } else if (operatorType == OPERATOR_TYPE_MINUS_MINUS) {
             return "--";
         } else {
-            return ArithmeticExpression.getOperatorSymbol(operatorType) + "=";
+            return ASTExpArithmetic.getOperatorSymbol(operatorType) + "=";
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignmentsContainer.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignmentsContainer.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignmentsContainer.java
index fd2873d..3cd1e91 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignmentsContainer.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAssignmentsContainer.java
@@ -103,7 +103,7 @@ final class ASTDirAssignmentsContainer extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return ASTDirAssignment.getDirectiveName(scope);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAttemptRecoverContainer.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAttemptRecoverContainer.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAttemptRecoverContainer.java
index c01c453..19aff47 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAttemptRecoverContainer.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAttemptRecoverContainer.java
@@ -48,12 +48,12 @@ final class ASTDirAttemptRecoverContainer extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (!canonical) {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         } else {
             StringBuilder buf = new StringBuilder();
-            buf.append("<").append(getNodeTypeSymbol()).append(">");
+            buf.append("<").append(getASTNodeDescriptor()).append(">");
             buf.append(getChildrenCanonicalForm());            
-            buf.append("</").append(getNodeTypeSymbol()).append(">");
+            buf.append("</").append(getASTNodeDescriptor()).append(">");
             return buf.toString();
         }
     }
@@ -76,7 +76,7 @@ final class ASTDirAttemptRecoverContainer extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#attempt";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAutoEsc.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAutoEsc.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAutoEsc.java
index b27dc0a..0f44975 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAutoEsc.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirAutoEsc.java
@@ -38,14 +38,14 @@ final class ASTDirAutoEsc extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (canonical) {
-            return "<" + getNodeTypeSymbol() + "\">" + getChildrenCanonicalForm() + "</" + getNodeTypeSymbol() + ">";
+            return "<" + getASTNodeDescriptor() + "\">" + getChildrenCanonicalForm() + "</" + getASTNodeDescriptor() + ">";
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#autoesc";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirBreak.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirBreak.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirBreak.java
index 19a0c25..ff82b8a 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirBreak.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirBreak.java
@@ -31,11 +31,11 @@ final class ASTDirBreak extends ASTDirective {
 
     @Override
     protected String dump(boolean canonical) {
-        return canonical ? "<" + getNodeTypeSymbol() + "/>" : getNodeTypeSymbol();
+        return canonical ? "<" + getASTNodeDescriptor() + "/>" : getASTNodeDescriptor();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#break";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCapturingAssignment.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCapturingAssignment.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCapturingAssignment.java
index 9aa5eab..4624b65 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCapturingAssignment.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCapturingAssignment.java
@@ -128,7 +128,7 @@ final class ASTDirCapturingAssignment extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append("<");
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         sb.append(' ');
         sb.append(varName);
         if (namespaceExp != null) {
@@ -139,7 +139,7 @@ final class ASTDirCapturingAssignment extends ASTDirective {
             sb.append('>');
             sb.append(getChildrenCanonicalForm());
             sb.append("</");
-            sb.append(getNodeTypeSymbol());
+            sb.append(getASTNodeDescriptor());
             sb.append('>');
         } else {
             sb.append(" = .nested_output");
@@ -148,7 +148,7 @@ final class ASTDirCapturingAssignment extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return ASTDirAssignment.getDirectiveName(scope);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCase.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCase.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCase.java
index 0f87778..eca7ae4 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCase.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCase.java
@@ -43,7 +43,7 @@ final class ASTDirCase extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (condition != null) {
             sb.append(' ');
             sb.append(condition.getCanonicalForm());
@@ -56,7 +56,7 @@ final class ASTDirCase extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return condition != null ? "#case" : "#default";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCompress.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCompress.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCompress.java
index 8810381..ca3fd0a 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCompress.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirCompress.java
@@ -48,14 +48,14 @@ final class ASTDirCompress extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (canonical) {
-            return "<" + getNodeTypeSymbol() + ">" + getChildrenCanonicalForm() + "</" + getNodeTypeSymbol() + ">";
+            return "<" + getASTNodeDescriptor() + ">" + getChildrenCanonicalForm() + "</" + getASTNodeDescriptor() + ">";
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#compress";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirElseOfList.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirElseOfList.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirElseOfList.java
index 7aafd2f..31ebea7 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirElseOfList.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirElseOfList.java
@@ -39,16 +39,16 @@ final class ASTDirElseOfList extends ASTDirective {
     protected String dump(boolean canonical) {
         if (canonical) {
             StringBuilder buf = new StringBuilder();
-            buf.append('<').append(getNodeTypeSymbol()).append('>');
+            buf.append('<').append(getASTNodeDescriptor()).append('>');
             buf.append(getChildrenCanonicalForm());            
             return buf.toString();
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#else";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirEscape.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirEscape.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirEscape.java
index c3db14e..56414e4 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirEscape.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirEscape.java
@@ -59,19 +59,19 @@ class ASTDirEscape extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol())
+        sb.append(getASTNodeDescriptor())
                 .append(' ').append(_StringUtil.toFTLTopLevelIdentifierReference(variable))
                 .append(" as ").append(expr.getCanonicalForm());
         if (canonical) {
             sb.append('>');
             sb.append(getChildrenCanonicalForm());
-            sb.append("</").append(getNodeTypeSymbol()).append('>');
+            sb.append("</").append(getASTNodeDescriptor()).append('>');
         }
         return sb.toString();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#escape";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFallback.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFallback.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFallback.java
index 08b5c42..255de11 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFallback.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFallback.java
@@ -34,11 +34,11 @@ final class ASTDirFallback extends ASTDirective {
 
     @Override
     protected String dump(boolean canonical) {
-        return canonical ? "<" + getNodeTypeSymbol() + "/>" : getNodeTypeSymbol();
+        return canonical ? "<" + getASTNodeDescriptor() + "/>" : getASTNodeDescriptor();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#fallback";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFlush.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFlush.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFlush.java
index ad7aff4..469eff8 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFlush.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirFlush.java
@@ -34,11 +34,11 @@ final class ASTDirFlush extends ASTDirective {
 
     @Override
     protected String dump(boolean canonical) {
-        return canonical ? "<" + getNodeTypeSymbol() + "/>" : getNodeTypeSymbol();
+        return canonical ? "<" + getASTNodeDescriptor() + "/>" : getASTNodeDescriptor();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#flush";
     }
  

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfElseIfElseContainer.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfElseIfElseContainer.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfElseIfElseContainer.java
index d04b0a0..b24bca8 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfElseIfElseContainer.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfElseIfElseContainer.java
@@ -75,12 +75,12 @@ final class ASTDirIfElseIfElseContainer extends ASTDirective {
             buf.append("</#if>");
             return buf.toString();
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#if-#elseif-#else-container";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfOrElseOrElseIf.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfOrElseOrElseIf.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfOrElseOrElseIf.java
index 136b5b7..5dd0ba0 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfOrElseOrElseIf.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirIfOrElseOrElseIf.java
@@ -55,7 +55,7 @@ final class ASTDirIfOrElseOrElseIf extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
         if (canonical) buf.append('<');
-        buf.append(getNodeTypeSymbol());
+        buf.append(getASTNodeDescriptor());
         if (condition != null) {
             buf.append(' ');
             buf.append(condition.getCanonicalForm());
@@ -71,7 +71,7 @@ final class ASTDirIfOrElseOrElseIf extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         if (type == TYPE_ELSE) {
             return "#else";
         } else if (type == TYPE_IF) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirImport.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirImport.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirImport.java
index 38e88bf..db95913 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirImport.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirImport.java
@@ -71,7 +71,7 @@ final class ASTDirImport extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
         if (canonical) buf.append('<');
-        buf.append(getNodeTypeSymbol());
+        buf.append(getASTNodeDescriptor());
         buf.append(' ');
         buf.append(importedTemplateNameExp.getCanonicalForm());
         buf.append(" as ");
@@ -81,7 +81,7 @@ final class ASTDirImport extends ASTDirective {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#import";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirInclude.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirInclude.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirInclude.java
index 2088d62..b458537 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirInclude.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirInclude.java
@@ -102,7 +102,7 @@ final class ASTDirInclude extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
         if (canonical) buf.append('<');
-        buf.append(getNodeTypeSymbol());
+        buf.append(getASTNodeDescriptor());
         buf.append(' ');
         buf.append(includedTemplateNameExp.getCanonicalForm());
         if (ignoreMissingExp != null) {
@@ -113,7 +113,7 @@ final class ASTDirInclude extends ASTDirective {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#include";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirItems.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirItems.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirItems.java
index 292d767..f2c62cd 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirItems.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirItems.java
@@ -48,7 +48,7 @@ class ASTDirItems extends ASTDirective {
         if (iterCtx == null) {
             // The parser should prevent this situation
             throw new _MiscTemplateException(env,
-                    getNodeTypeSymbol(), " without iteration in context");
+                    getASTNodeDescriptor(), " without iteration in context");
         }
         
         iterCtx.loopForItemsElement(env, getChildBuffer(), loopVarName, loopVar2Name);
@@ -64,7 +64,7 @@ class ASTDirItems extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         sb.append(" as ");
         sb.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVarName));
         if (loopVar2Name != null) {
@@ -75,14 +75,14 @@ class ASTDirItems extends ASTDirective {
             sb.append('>');
             sb.append(getChildrenCanonicalForm());
             sb.append("</");
-            sb.append(getNodeTypeSymbol());
+            sb.append(getASTNodeDescriptor());
             sb.append('>');
         }
         return sb.toString();
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#items";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirList.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirList.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirList.java
index 0675882..a374215 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirList.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirList.java
@@ -125,7 +125,7 @@ final class ASTDirList extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
         if (canonical) buf.append('<');
-        buf.append(getNodeTypeSymbol());
+        buf.append(getASTNodeDescriptor());
         buf.append(' ');
         buf.append(listedExp.getCanonicalForm());
         if (loopVarName != null) {
@@ -141,7 +141,7 @@ final class ASTDirList extends ASTDirective {
             buf.append(getChildrenCanonicalForm());
             if (!(getParent() instanceof ASTDirListElseContainer)) {
                 buf.append("</");
-                buf.append(getNodeTypeSymbol());
+                buf.append(getASTNodeDescriptor());
                 buf.append('>');
             }
         }
@@ -184,7 +184,7 @@ final class ASTDirList extends ASTDirective {
     }    
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#list";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirListElseContainer.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirListElseContainer.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirListElseContainer.java
index a85b81c..686b03c 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirListElseContainer.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirListElseContainer.java
@@ -61,12 +61,12 @@ class ASTDirListElseContainer extends ASTDirective {
             buf.append("</#list>");
             return buf.toString();
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#list-#else-container";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirMacro.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirMacro.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirMacro.java
index 5bb2712..6f6dede 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirMacro.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirMacro.java
@@ -93,7 +93,7 @@ final class ASTDirMacro extends ASTDirective implements TemplateModel {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         sb.append(' ');
         sb.append(_StringUtil.toFTLTopLevelTragetIdentifier(name));
         if (function) sb.append('(');
@@ -133,13 +133,13 @@ final class ASTDirMacro extends ASTDirective implements TemplateModel {
         if (canonical) {
             sb.append('>');
             sb.append(getChildrenCanonicalForm());
-            sb.append("</").append(getNodeTypeSymbol()).append('>');
+            sb.append("</").append(getASTNodeDescriptor()).append('>');
         }
         return sb.toString();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return function ? "#function" : "#macro";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNested.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNested.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNested.java
index f08d3b2..e915b01 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNested.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNested.java
@@ -64,7 +64,7 @@ final class ASTDirNested extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (bodyParameters != null) {
             for (int i = 0; i < bodyParameters.size(); i++) {
                 sb.append(' ');
@@ -76,7 +76,7 @@ final class ASTDirNested extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#nested";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoAutoEsc.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoAutoEsc.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoAutoEsc.java
index f1d1f43..73812bb 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoAutoEsc.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoAutoEsc.java
@@ -38,14 +38,14 @@ final class ASTDirNoAutoEsc extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (canonical) {
-            return "<" + getNodeTypeSymbol() + "\">" + getChildrenCanonicalForm() + "</" + getNodeTypeSymbol() + ">";
+            return "<" + getASTNodeDescriptor() + "\">" + getChildrenCanonicalForm() + "</" + getASTNodeDescriptor() + ">";
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#noautoesc";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoEscape.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoEscape.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoEscape.java
index e2f3648..e7decca 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoEscape.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirNoEscape.java
@@ -38,10 +38,10 @@ class ASTDirNoEscape extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (canonical) {
-            return "<" + getNodeTypeSymbol() + '>' + getChildrenCanonicalForm()
-                    + "</" + getNodeTypeSymbol() + '>';
+            return "<" + getASTNodeDescriptor() + '>' + getChildrenCanonicalForm()
+                    + "</" + getASTNodeDescriptor() + '>';
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
 
@@ -61,7 +61,7 @@ class ASTDirNoEscape extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#noescape";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirOutputFormat.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirOutputFormat.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirOutputFormat.java
index ee59a0c..3cd7090 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirOutputFormat.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirOutputFormat.java
@@ -41,15 +41,15 @@ final class ASTDirOutputFormat extends ASTDirective {
     @Override
     protected String dump(boolean canonical) {
         if (canonical) {
-            return "<" + getNodeTypeSymbol() + " \"" + paramExp.getCanonicalForm() + "\">"
-                    + getChildrenCanonicalForm() + "</" + getNodeTypeSymbol() + ">";
+            return "<" + getASTNodeDescriptor() + " \"" + paramExp.getCanonicalForm() + "\">"
+                    + getChildrenCanonicalForm() + "</" + getASTNodeDescriptor() + ">";
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#outputformat";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecover.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecover.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecover.java
index f19e9b2..7879f18 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecover.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecover.java
@@ -39,16 +39,16 @@ final class ASTDirRecover extends ASTDirective {
     protected String dump(boolean canonical) {
         if (canonical) {
             StringBuilder buf = new StringBuilder();
-            buf.append('<').append(getNodeTypeSymbol()).append('>');
+            buf.append('<').append(getASTNodeDescriptor()).append('>');
             buf.append(getChildrenCanonicalForm());            
             return buf.toString();
         } else {
-            return getNodeTypeSymbol();
+            return getASTNodeDescriptor();
         }
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#recover";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecurse.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecurse.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecurse.java
index b95b3fc..7e7551d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecurse.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirRecurse.java
@@ -76,7 +76,7 @@ final class ASTDirRecurse extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (targetNode != null) {
             sb.append(' ');
             sb.append(targetNode.getCanonicalForm());
@@ -90,7 +90,7 @@ final class ASTDirRecurse extends ASTDirective {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#recurse";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirReturn.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirReturn.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirReturn.java
index 0e82a74..b3fe6a5 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirReturn.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirReturn.java
@@ -46,7 +46,7 @@ final class ASTDirReturn extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (exp != null) {
             sb.append(' ');
             sb.append(exp.getCanonicalForm());
@@ -56,7 +56,7 @@ final class ASTDirReturn extends ASTDirective {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#return";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSep.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSep.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSep.java
index 9e83e83..ca2107d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSep.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSep.java
@@ -37,7 +37,7 @@ class ASTDirSep extends ASTDirective {
         if (iterCtx == null) {
             // The parser should prevent this situation
             throw new _MiscTemplateException(env,
-                    getNodeTypeSymbol(), " without iteration in context");
+                    getASTNodeDescriptor(), " without iteration in context");
         }
         
         if (iterCtx.hasNext()) {
@@ -55,19 +55,19 @@ class ASTDirSep extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (canonical) {
             sb.append('>');
             sb.append(getChildrenCanonicalForm());
             sb.append("</");
-            sb.append(getNodeTypeSymbol());
+            sb.append(getASTNodeDescriptor());
             sb.append('>');
         }
         return sb.toString();
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#sep";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSetting.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSetting.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSetting.java
index a2c077f..fe2c4f8 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSetting.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSetting.java
@@ -127,7 +127,7 @@ final class ASTDirSetting extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         sb.append(' ');
         sb.append(_StringUtil.toFTLTopLevelTragetIdentifier(key));
         sb.append('=');
@@ -137,7 +137,7 @@ final class ASTDirSetting extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#setting";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirStop.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirStop.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirStop.java
index f453734..bef9654 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirStop.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirStop.java
@@ -42,7 +42,7 @@ final class ASTDirStop extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (exp != null) {
             sb.append(' ');
             sb.append(exp.getCanonicalForm());
@@ -52,7 +52,7 @@ final class ASTDirStop extends ASTDirective {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#stop";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
index e66c419..069d70e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
@@ -84,7 +84,7 @@ final class ASTDirSwitch extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder buf = new StringBuilder();
         if (canonical) buf.append('<');
-        buf.append(getNodeTypeSymbol());
+        buf.append(getASTNodeDescriptor());
         buf.append(' ');
         buf.append(searched.getCanonicalForm());
         if (canonical) {
@@ -94,13 +94,13 @@ final class ASTDirSwitch extends ASTDirective {
                 ASTDirCase cas = (ASTDirCase) getChild(i);
                 buf.append(cas.getCanonicalForm());
             }
-            buf.append("</").append(getNodeTypeSymbol()).append('>');
+            buf.append("</").append(getASTNodeDescriptor()).append('>');
         }
         return buf.toString();
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#switch";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
index 937bc18..3cf4b9d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
@@ -46,13 +46,13 @@ final class ASTDirTOrTrOrTl extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         if (canonical) sb.append("/>");
         return sb.toString();
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         if (left && right) {
             return "#t";
         } else if (left) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirUserDefined.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirUserDefined.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirUserDefined.java
index 6042bd8..2fab592 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirUserDefined.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirUserDefined.java
@@ -166,7 +166,7 @@ final class ASTDirUserDefined extends ASTDirective implements DirectiveCallPlace
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "@";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirVisit.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirVisit.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirVisit.java
index 4a4023b..59db5f0 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirVisit.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDirVisit.java
@@ -74,7 +74,7 @@ final class ASTDirVisit extends ASTDirective {
     protected String dump(boolean canonical) {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
-        sb.append(getNodeTypeSymbol());
+        sb.append(getASTNodeDescriptor());
         sb.append(' ');
         sb.append(targetNode.getCanonicalForm());
         if (namespaces != null) {
@@ -86,7 +86,7 @@ final class ASTDirVisit extends ASTDirective {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#visit";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDollarInterpolation.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDollarInterpolation.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDollarInterpolation.java
index 1e5a7b4..a2c68e4 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDollarInterpolation.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTDollarInterpolation.java
@@ -112,7 +112,7 @@ final class ASTDollarInterpolation extends ASTInterpolation {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "${...}";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTElement.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTElement.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTElement.java
index 574b22d..e9b2c4e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTElement.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTElement.java
@@ -79,7 +79,7 @@ abstract class ASTElement extends ASTNode {
      * This final implementation calls {@link #dump(boolean) dump(false)}.
      * 
      * @see #getCanonicalForm()
-     * @see #getNodeTypeSymbol()
+     * @see #getASTNodeDescriptor()
      */
     public final String getDescription() {
         return dump(false);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
index 15e632a..c303daa 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
@@ -171,7 +171,7 @@ final class ASTExpAddOrConcat extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "+";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAnd.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAnd.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAnd.java
index 346d526..0d3d3b0 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAnd.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpAnd.java
@@ -43,7 +43,7 @@ final class ASTExpAnd extends ASTExpBoolean {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "&&";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpArithmetic.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpArithmetic.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpArithmetic.java
new file mode 100644
index 0000000..99fd7f0
--- /dev/null
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpArithmetic.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.freemarker.core;
+
+import org.apache.freemarker.core.arithmetic.ArithmeticEngine;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.impl.SimpleNumber;
+
+/**
+ * An operator for arithmetic operations. Note that the + operator is in {@link ASTExpAddOrConcat}, because its
+ * overloaded (does string concatenation and more).
+ */
+final class ASTExpArithmetic extends ASTExpression {
+
+    static final int TYPE_SUBSTRACTION = 0;
+    static final int TYPE_MULTIPLICATION = 1;
+    static final int TYPE_DIVISION = 2;
+    static final int TYPE_MODULO = 3;
+
+    private static final char[] OPERATOR_IMAGES = new char[] { '-', '*', '/', '%' };
+
+    private final ASTExpression lho;
+    private final ASTExpression rho;
+    private final int operator;
+
+    ASTExpArithmetic(ASTExpression lho, ASTExpression rho, int operator) {
+        this.lho = lho;
+        this.rho = rho;
+        this.operator = operator;
+    }
+
+    @Override
+    TemplateModel _eval(Environment env) throws TemplateException {
+        return _eval(env, this, lho.evalToNumber(env), operator, rho.evalToNumber(env));
+    }
+
+    static TemplateModel _eval(Environment env, ASTNode parent, Number lhoNumber, int operator, Number rhoNumber)
+            throws TemplateException {
+        ArithmeticEngine ae = _EvalUtil.getArithmeticEngine(env, parent);
+        switch (operator) {
+            case TYPE_SUBSTRACTION : 
+                return new SimpleNumber(ae.subtract(lhoNumber, rhoNumber));
+            case TYPE_MULTIPLICATION :
+                return new SimpleNumber(ae.multiply(lhoNumber, rhoNumber));
+            case TYPE_DIVISION :
+                return new SimpleNumber(ae.divide(lhoNumber, rhoNumber));
+            case TYPE_MODULO :
+                return new SimpleNumber(ae.modulus(lhoNumber, rhoNumber));
+            default:
+                if (parent instanceof ASTExpression) {
+                    throw new _MiscTemplateException((ASTExpression) parent,
+                            "Unknown operation: ", Integer.valueOf(operator));
+                } else {
+                    throw new _MiscTemplateException("Unknown operation: ", Integer.valueOf(operator));
+                }
+        }
+    }
+
+    @Override
+    public String getCanonicalForm() {
+        return lho.getCanonicalForm() + ' ' + getOperatorSymbol(operator) + ' ' + rho.getCanonicalForm();
+    }
+    
+    @Override
+    String getASTNodeDescriptor() {
+        return String.valueOf(getOperatorSymbol(operator));
+    }
+
+    static char getOperatorSymbol(int operator) {
+        return OPERATOR_IMAGES[operator];
+    }
+    
+    @Override
+    boolean isLiteral() {
+        return constantValue != null || (lho.isLiteral() && rho.isLiteral());
+    }
+
+    @Override
+    protected ASTExpression deepCloneWithIdentifierReplaced_inner(
+            String replacedIdentifier, ASTExpression replacement, ReplacemenetState replacementState) {
+    	return new ASTExpArithmetic(
+    	        lho.deepCloneWithIdentifierReplaced(replacedIdentifier, replacement, replacementState),
+    	        rho.deepCloneWithIdentifierReplaced(replacedIdentifier, replacement, replacementState),
+    	        operator);
+    }
+    
+    @Override
+    int getParameterCount() {
+        return 3;
+    }
+
+    @Override
+    Object getParameterValue(int idx) {
+        switch (idx) {
+        case 0: return lho;
+        case 1: return rho;
+        case 2: return Integer.valueOf(operator);
+        default: throw new IndexOutOfBoundsException();
+        }
+    }
+
+    @Override
+    ParameterRole getParameterRole(int idx) {
+        switch (idx) {
+        case 0: return ParameterRole.LEFT_HAND_OPERAND;
+        case 1: return ParameterRole.RIGHT_HAND_OPERAND;
+        case 2: return ParameterRole.AST_NODE_SUBTYPE;
+        default: throw new IndexOutOfBoundsException();
+        }
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBooleanLiteral.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBooleanLiteral.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBooleanLiteral.java
index e38578b..8525ea3 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBooleanLiteral.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBooleanLiteral.java
@@ -48,7 +48,7 @@ final class ASTExpBooleanLiteral extends ASTExpression {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return getCanonicalForm();
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltIn.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltIn.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltIn.java
index 5a276a5..b246ad4 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltIn.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltIn.java
@@ -375,7 +375,7 @@ abstract class ASTExpBuiltIn extends ASTExpression implements Cloneable {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "?" + key;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltInVariable.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltInVariable.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltInVariable.java
index 0dda491..d2304fe 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltInVariable.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpBuiltInVariable.java
@@ -246,7 +246,7 @@ final class ASTExpBuiltInVariable extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return getCanonicalForm();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpComparison.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpComparison.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpComparison.java
index 4e3559f..138b69e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpComparison.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpComparison.java
@@ -68,7 +68,7 @@ final class ASTExpComparison extends ASTExpBoolean {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return opString;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDefault.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDefault.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDefault.java
index b891374..35b7816 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDefault.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDefault.java
@@ -116,7 +116,7 @@ class ASTExpDefault extends ASTExpression {
 	}
 	
 	@Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "...!...";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDot.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDot.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDot.java
index 1e6a742..8fc6a82 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDot.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDot.java
@@ -46,11 +46,11 @@ final class ASTExpDot extends ASTExpression {
 
     @Override
     public String getCanonicalForm() {
-        return target.getCanonicalForm() + getNodeTypeSymbol() + _StringUtil.toFTLIdentifierReferenceAfterDot(key);
+        return target.getCanonicalForm() + getASTNodeDescriptor() + _StringUtil.toFTLIdentifierReferenceAfterDot(key);
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return ".";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
index b904ce4..c6dae95 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
@@ -250,7 +250,7 @@ final class ASTExpDynamicKeyName extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "...[...]";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpExists.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpExists.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpExists.java
index 72b8182..24f6e19 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpExists.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpExists.java
@@ -65,11 +65,11 @@ class ASTExpExists extends ASTExpression {
 
 	@Override
     public String getCanonicalForm() {
-		return exp.getCanonicalForm() + getNodeTypeSymbol();
+		return exp.getCanonicalForm() + getASTNodeDescriptor();
 	}
 	
 	@Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "??";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpHashLiteral.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpHashLiteral.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpHashLiteral.java
index 792787a..32af9bb 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpHashLiteral.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpHashLiteral.java
@@ -70,7 +70,7 @@ final class ASTExpHashLiteral extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "{...}";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpListLiteral.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpListLiteral.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpListLiteral.java
index b3fba1f..1612a79 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpListLiteral.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpListLiteral.java
@@ -117,7 +117,7 @@ final class ASTExpListLiteral extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "[...]";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpMethodCall.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpMethodCall.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpMethodCall.java
index 86e376f..4f51904 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpMethodCall.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpMethodCall.java
@@ -96,7 +96,7 @@ final class ASTExpMethodCall extends ASTExpression {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "...(...)";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
index a211ef7..dc41129 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
@@ -67,7 +67,7 @@ final class ASTExpNegateOrPlus extends ASTExpression {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return isMinus ? "-..." : "+...";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNot.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNot.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNot.java
index 19dd088..934c58e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNot.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNot.java
@@ -41,7 +41,7 @@ final class ASTExpNot extends ASTExpBoolean {
     }
  
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "!";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNumberLiteral.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNumberLiteral.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNumberLiteral.java
index 01847a6..eccb446 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNumberLiteral.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpNumberLiteral.java
@@ -59,7 +59,7 @@ final class ASTExpNumberLiteral extends ASTExpression implements TemplateNumberM
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return getCanonicalForm();
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpOr.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpOr.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpOr.java
index 5673ec3..26dab92 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpOr.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpOr.java
@@ -43,7 +43,7 @@ final class ASTExpOr extends ASTExpBoolean {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "||";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpParenthesis.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpParenthesis.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpParenthesis.java
index eabccbf..9f64b3d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpParenthesis.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpParenthesis.java
@@ -43,7 +43,7 @@ final class ASTExpParenthesis extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "(...)";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpRange.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpRange.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpRange.java
index 194c402..6932827 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpRange.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpRange.java
@@ -68,11 +68,11 @@ final class ASTExpRange extends ASTExpression {
     @Override
     public String getCanonicalForm() {
         String rhs = rho != null ? rho.getCanonicalForm() : "";
-        return lho.getCanonicalForm() + getNodeTypeSymbol() + rhs;
+        return lho.getCanonicalForm() + getASTNodeDescriptor() + rhs;
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         switch (endType) {
         case END_EXCLUSIVE: return "..<";
         case END_INCLUSIVE: return "..";

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpStringLiteral.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpStringLiteral.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpStringLiteral.java
index 96c15df..e8e0d96 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpStringLiteral.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpStringLiteral.java
@@ -167,7 +167,7 @@ final class ASTExpStringLiteral extends ASTExpression implements TemplateScalarM
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return dynamicValue == null ? getCanonicalForm() : "dynamic \"...\"";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpVariable.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpVariable.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpVariable.java
index 59ceddc..e4a2327 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpVariable.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTExpVariable.java
@@ -61,7 +61,7 @@ final class ASTExpVariable extends ASTExpression {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return getCanonicalForm();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
index 8c3f8fa..1b49248 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
@@ -116,7 +116,7 @@ final class ASTHashInterpolation extends ASTInterpolation {
     }
     
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#{...}";
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cb4a93dc/freemarker-core/src/main/java/org/apache/freemarker/core/ASTImplicitParent.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTImplicitParent.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTImplicitParent.java
index 4d3c339..453bcf5 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/ASTImplicitParent.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ASTImplicitParent.java
@@ -54,7 +54,7 @@ final class ASTImplicitParent extends ASTElement {
             if (getParent() == null) {
                 return "root";
             }
-            return getNodeTypeSymbol(); // ASTImplicitParent is uninteresting in a stack trace.
+            return getASTNodeDescriptor(); // ASTImplicitParent is uninteresting in a stack trace.
         }
     }
 
@@ -70,7 +70,7 @@ final class ASTImplicitParent extends ASTElement {
     }
 
     @Override
-    String getNodeTypeSymbol() {
+    String getASTNodeDescriptor() {
         return "#mixed_content";
     }
     



Mime
View raw message