Author: nbubna
Date: Mon Feb 23 19:25:14 2009
New Revision: 747106
URL: http://svn.apache.org/viewvc?rev=747106&view=rev
Log:
VELOCITY-704 turn #stop into a true directive that accepts a Scope as an
optional argument identifying exactly what to stop, but still stops everything
if no argument is given
Added:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
(with props)
Removed:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTStop.java
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/defaults/directive.properties
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTreeConstants.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ParserVisitor.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/BaseVisitor.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/NodeViewMode.java
velocity/engine/trunk/src/parser/Parser.jjt
velocity/engine/trunk/src/test/org/apache/velocity/test/StopDirectiveTestCase.java
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/defaults/directive.properties
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/defaults/directive.properties?rev=747106&r1=747105&r2=747106&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/defaults/directive.properties
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/defaults/directive.properties
Mon Feb 23 19:25:14 2009
@@ -22,3 +22,4 @@
directive.6=org.apache.velocity.runtime.directive.Evaluate
directive.7=org.apache.velocity.runtime.directive.Break
directive.8=org.apache.velocity.runtime.directive.Define
+directive.9=org.apache.velocity.runtime.directive.Stop
Added:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java?rev=747106&view=auto
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
(added)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
Mon Feb 23 19:25:14 2009
@@ -0,0 +1,129 @@
+package org.apache.velocity.runtime.directive;
+
+/*
+ * 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.
+ */
+
+import java.io.Writer;
+import org.apache.velocity.Template;
+import org.apache.velocity.context.InternalContextAdapter;
+import org.apache.velocity.exception.VelocityException;
+import org.apache.velocity.runtime.RuntimeInstance;
+import org.apache.velocity.runtime.RuntimeServices;
+import org.apache.velocity.runtime.log.Log;
+import org.apache.velocity.runtime.parser.node.Node;
+
+/**
+ * This class implements the #stop directive which allows
+ * a user to stop rendering the current execution context. The #stop directive
+ * with no arguments will immediately stop rendering the current Template merge
+ * or evaluate(...) call.
+ * If the stop directive is called with a Scope argument, e.g.;
#stop($foreach),
+ * then rendering will end within that particular directive, but resume at
+ * the parent level.
+ */
+public class Stop extends Directive
+{
+ private static final StopCommand STOP_ALL = new StopAllCommand();
+
+ private boolean scopedStop = false;
+
+ /**
+ * Return name of this directive.
+ * @return The name of this directive.
+ */
+ public String getName()
+ {
+ return "stop";
+ }
+
+ /**
+ * Return type of this directive.
+ * @return The type of this directive.
+ */
+ public int getType()
+ {
+ return LINE;
+ }
+
+ /**
+ * Since there is no processing of content,
+ * there is never a need for an internal scope.
+ */
+ public boolean isScopeProvided()
+ {
+ return false;
+ }
+
+ public void init(RuntimeServices rs, InternalContextAdapter context, Node
node)
+ {
+ super.init(rs, context, node);
+
+ int kids = node.jjtGetNumChildren();
+ if (kids > 1)
+ {
+ throw new VelocityException("The #stop directive only accepts a
single scope object at "
+ + Log.formatFileString(this));
+ }
+ else
+ {
+ this.scopedStop = (kids == 1);
+ }
+ }
+
+ public boolean render(InternalContextAdapter context, Writer writer, Node
node)
+ {
+ if (!scopedStop)
+ {
+ // Only the top level calls that render an AST node tree catch and
keep
+ // this, thereby terminating at Template.merge or
RuntimeInstance.evaluate.
+ throw STOP_ALL;
+ }
+
+ Object argument = node.jjtGetChild(0).value(context);
+ if (argument instanceof Scope)
+ {
+ ((Scope)argument).stop();
+ }
+ else
+ {
+ throw new VelocityException(node.jjtGetChild(0).literal()+" is not
a valid Scope instance at "
+ + Log.formatFileString(this));
+ }
+ return false;
+ }
+
+ /**
+ * Specialized StopCommand that stops all merge or evaluate activity.
+ */
+ public static class StopAllCommand extends StopCommand
+ {
+ public StopAllCommand()
+ {
+ super("Template.merge or RuntimeInstance.evaluate");
+ }
+
+ public boolean isFor(Object that)
+ {
+ // only stop for the top :)
+ return (that instanceof Template ||
+ that instanceof RuntimeInstance);
+ }
+ }
+}
+
Propchange:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
------------------------------------------------------------------------------
svn:executable = *
Propchange:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
------------------------------------------------------------------------------
svn:keywords = Revision
Propchange:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Stop.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=747106&r1=747105&r2=747106&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
Mon Feb 23 19:25:14 2009
@@ -221,7 +221,6 @@
|| dirTag.equals("set")
|| dirTag.equals("else")
|| dirTag.equals("elseif")
- || dirTag.equals("stop")
)
{
bRecognizedDirective = true;
@@ -314,7 +313,6 @@
case TEXTBLOCK:
case STRING_LITERAL:
case IF_DIRECTIVE:
- case STOP_DIRECTIVE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case WORD:
@@ -367,9 +365,6 @@
case IF_DIRECTIVE:
IfStatement();
break;
- case STOP_DIRECTIVE:
- StopStatement();
- break;
default:
jj_la1[1] = jj_gen;
if (jj_2_1(2)) {
@@ -483,7 +478,6 @@
case ELSE_DIRECTIVE :
case ELSEIF_DIRECTIVE :
case END :
- case STOP_DIRECTIVE :
control = true;
break;
}
@@ -920,7 +914,6 @@
case TEXTBLOCK:
case STRING_LITERAL:
case IF_DIRECTIVE:
- case STOP_DIRECTIVE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case WORD:
@@ -1695,7 +1688,6 @@
case TEXTBLOCK:
case STRING_LITERAL:
case IF_DIRECTIVE:
- case STOP_DIRECTIVE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case WORD:
@@ -1808,7 +1800,6 @@
case TEXTBLOCK:
case STRING_LITERAL:
case IF_DIRECTIVE:
- case STOP_DIRECTIVE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case WORD:
@@ -1904,7 +1895,6 @@
case TEXTBLOCK:
case STRING_LITERAL:
case IF_DIRECTIVE:
- case STOP_DIRECTIVE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case WORD:
@@ -2028,27 +2018,6 @@
}
}
-/**
- * This method corresponds to the #stop
- * directive which just simulates and EOF
- * so that parsing stops. The #stop directive
- * is useful for end-user debugging
- * purposes.
- */
- final public void StopStatement() throws ParseException {
- /*...@bgen(jjtree) #Stop( 0) */
- ASTStop jjtn000 = new ASTStop(this, JJTSTOP);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- try {
- jj_consume_token(STOP_DIRECTIVE);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, 0);
- }
- }
- }
-
/* -----------------------------------------------------------------------
*
* Expression Syntax
@@ -2785,6 +2754,83 @@
finally { jj_save(11, xla); }
}
+ private boolean jj_3R_80() {
+ if (jj_3R_24()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_79() {
+ if (jj_3R_65()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_72() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(31)) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_79()) {
+ jj_scanpos = xsp;
+ if (jj_3R_80()) {
+ jj_scanpos = xsp;
+ if (jj_3R_81()) {
+ jj_scanpos = xsp;
+ if (jj_3R_82()) {
+ jj_scanpos = xsp;
+ if (jj_3R_83()) {
+ jj_scanpos = xsp;
+ if (jj_3R_84()) {
+ jj_scanpos = xsp;
+ if (jj_3R_85()) {
+ jj_scanpos = xsp;
+ if (jj_3R_86()) {
+ jj_scanpos = xsp;
+ if (jj_3R_87()) {
+ jj_scanpos = xsp;
+ if (jj_3R_88()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_73() {
+ if (jj_scan_token(INDEX_LBRACKET)) return true;
+ if (jj_3R_91()) return true;
+ if (jj_scan_token(INDEX_RBRACKET)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_35() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_11()) {
+ jj_scanpos = xsp;
+ if (jj_3R_62()) return true;
+ }
+ return false;
+ }
+
+ private boolean jj_3_11() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(31)) jj_scanpos = xsp;
+ if (jj_scan_token(LOGICAL_NOT)) return true;
+ if (jj_3R_35()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_62() {
+ if (jj_3R_72()) return true;
+ return false;
+ }
+
private boolean jj_3_6() {
if (jj_scan_token(LBRACKET)) return true;
Token xsp;
@@ -2929,6 +2975,11 @@
return false;
}
+ private boolean jj_3_2() {
+ if (jj_scan_token(DOUBLE_ESCAPE)) return true;
+ return false;
+ }
+
private boolean jj_3R_76() {
if (jj_3R_40()) return true;
return false;
@@ -2940,11 +2991,6 @@
return false;
}
- private boolean jj_3_2() {
- if (jj_scan_token(DOUBLE_ESCAPE)) return true;
- return false;
- }
-
private boolean jj_3R_91() {
Token xsp;
xsp = jj_scanpos;
@@ -3063,7 +3109,7 @@
xsp = jj_scanpos;
if (jj_scan_token(9)) {
jj_scanpos = xsp;
- if (jj_scan_token(70)) return true;
+ if (jj_scan_token(69)) return true;
}
return false;
}
@@ -3114,11 +3160,6 @@
return false;
}
- private boolean jj_3R_37() {
- if (jj_3R_40()) return true;
- return false;
- }
-
private boolean jj_3R_47() {
if (jj_3R_68()) return true;
return false;
@@ -3139,8 +3180,8 @@
return false;
}
- private boolean jj_3R_36() {
- if (jj_3R_24()) return true;
+ private boolean jj_3R_37() {
+ if (jj_3R_40()) return true;
return false;
}
@@ -3172,6 +3213,11 @@
return false;
}
+ private boolean jj_3R_36() {
+ if (jj_3R_24()) return true;
+ return false;
+ }
+
private boolean jj_3R_41() {
if (jj_3R_24()) return true;
return false;
@@ -3247,22 +3293,6 @@
return false;
}
- private boolean jj_3_12() {
- if (jj_scan_token(LBRACKET)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_36()) {
- jj_scanpos = xsp;
- if (jj_3R_37()) return true;
- }
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- if (jj_scan_token(DOUBLEDOT)) return true;
- return false;
- }
-
private boolean jj_3R_71() {
if (jj_scan_token(FALSE)) return true;
return false;
@@ -3283,31 +3313,16 @@
return false;
}
- private boolean jj_3R_88() {
- if (jj_scan_token(LPAREN)) return true;
- return false;
- }
-
private boolean jj_3R_30() {
if (jj_3R_24()) return true;
return false;
}
- private boolean jj_3R_87() {
- if (jj_3R_71()) return true;
- return false;
- }
-
private boolean jj_3R_70() {
if (jj_scan_token(TRUE)) return true;
return false;
}
- private boolean jj_3R_86() {
- if (jj_3R_70()) return true;
- return false;
- }
-
private boolean jj_3_9() {
if (jj_scan_token(DOT)) return true;
Token xsp;
@@ -3323,23 +3338,19 @@
return false;
}
- private boolean jj_3R_85() {
- if (jj_3R_69()) return true;
- return false;
- }
-
- private boolean jj_3R_84() {
- if (jj_3R_68()) return true;
- return false;
- }
-
- private boolean jj_3R_83() {
- if (jj_3R_67()) return true;
- return false;
- }
-
- private boolean jj_3R_82() {
- if (jj_3R_66()) return true;
+ private boolean jj_3_12() {
+ if (jj_scan_token(LBRACKET)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(31)) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_36()) {
+ jj_scanpos = xsp;
+ if (jj_3R_37()) return true;
+ }
+ xsp = jj_scanpos;
+ if (jj_scan_token(31)) jj_scanpos = xsp;
+ if (jj_scan_token(DOUBLEDOT)) return true;
return false;
}
@@ -3348,11 +3359,6 @@
return false;
}
- private boolean jj_3R_81() {
- if (jj_3R_40()) return true;
- return false;
- }
-
private boolean jj_3_7() {
if (jj_scan_token(DOT)) return true;
Token xsp;
@@ -3378,11 +3384,6 @@
return false;
}
- private boolean jj_3R_80() {
- if (jj_3R_24()) return true;
- return false;
- }
-
private boolean jj_3R_39() {
if (jj_scan_token(LCURLY)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
@@ -3399,49 +3400,23 @@
return false;
}
- private boolean jj_3R_79() {
- if (jj_3R_65()) return true;
+ private boolean jj_3R_40() {
+ if (jj_scan_token(INTEGER_LITERAL)) return true;
return false;
}
- private boolean jj_3R_40() {
- if (jj_scan_token(INTEGER_LITERAL)) return true;
+ private boolean jj_3R_88() {
+ if (jj_scan_token(LPAREN)) return true;
return false;
}
- private boolean jj_3R_72() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_79()) {
- jj_scanpos = xsp;
- if (jj_3R_80()) {
- jj_scanpos = xsp;
- if (jj_3R_81()) {
- jj_scanpos = xsp;
- if (jj_3R_82()) {
- jj_scanpos = xsp;
- if (jj_3R_83()) {
- jj_scanpos = xsp;
- if (jj_3R_84()) {
- jj_scanpos = xsp;
- if (jj_3R_85()) {
- jj_scanpos = xsp;
- if (jj_3R_86()) {
- jj_scanpos = xsp;
- if (jj_3R_87()) {
- jj_scanpos = xsp;
- if (jj_3R_88()) return true;
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ private boolean jj_3R_87() {
+ if (jj_3R_71()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_86() {
+ if (jj_3R_70()) return true;
return false;
}
@@ -3459,6 +3434,21 @@
return false;
}
+ private boolean jj_3R_85() {
+ if (jj_3R_69()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_84() {
+ if (jj_3R_68()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_83() {
+ if (jj_3R_67()) return true;
+ return false;
+ }
+
private boolean jj_3R_67() {
if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
return false;
@@ -3474,34 +3464,13 @@
return false;
}
- private boolean jj_3R_35() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_11()) {
- jj_scanpos = xsp;
- if (jj_3R_62()) return true;
- }
- return false;
- }
-
- private boolean jj_3_11() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- if (jj_scan_token(LOGICAL_NOT)) return true;
- if (jj_3R_35()) return true;
- return false;
- }
-
- private boolean jj_3R_62() {
- if (jj_3R_72()) return true;
+ private boolean jj_3R_82() {
+ if (jj_3R_66()) return true;
return false;
}
- private boolean jj_3R_73() {
- if (jj_scan_token(INDEX_LBRACKET)) return true;
- if (jj_3R_91()) return true;
- if (jj_scan_token(INDEX_RBRACKET)) return true;
+ private boolean jj_3R_81() {
+ if (jj_3R_40()) return true;
return false;
}
@@ -3528,10 +3497,10 @@
jj_la1_0 = new int[]
{0x1de06c00,0x0,0x1de06c00,0x2000000,0xc200000,0x0,0x108,0x0,0x80000000,0x80000000,0x80000000,0x20,0x80000000,0x1de06c00,0x20,0x80000000,0x200,0x20,0x80000108,0x80000000,0x0,0x80000000,0x80000000,0x0,0x80000000,0x80000000,0x0,0x80000000,0x80000000,0x0,0x108,0x80000000,0x20,0x80000108,0x2,0x0,0x2,0x2,0x0,0x2,0x0,0x1800c00,0x80000000,0x1de06c00,0x0,0x0,0x0,0x1de06c00,0x80000000,0x1de06c00,0x80000000,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000508,0x80000000,0x0,0x508,0x80000000,};
}
private static void jj_la1_init_1() {
- jj_la1_1 = new int[]
{0xc6900001,0x900000,0xc6000001,0x0,0x0,0x42000001,0x4000006,0xc0000000,0x0,0x0,0x0,0x0,0x0,0xc6900001,0x0,0x0,0x0,0x0,0x6000007,0x0,0x2000000,0x0,0x0,0x2000000,0x0,0x0,0x2000007,0x0,0x0,0x2000001,0x4000006,0x0,0x0,0x6000007,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6000001,0x0,0xc6900001,0x200000,0x200000,0x400000,0xc6900001,0x0,0xc6900001,0x0,0x0,0x8,0x400,0x200,0x18000,0x18000,0x7800,0x7800,0x30,0x30,0x1c0,0x1c0,0x0,0x6000007,0x0,0x2000001,0x4000006,0x0,};
+ jj_la1_1 = new int[]
{0x63100001,0x100000,0x63000001,0x0,0x0,0x21000001,0x2000006,0x60000000,0x0,0x0,0x0,0x0,0x0,0x63100001,0x0,0x0,0x0,0x0,0x3000007,0x0,0x1000000,0x0,0x0,0x1000000,0x0,0x0,0x1000007,0x0,0x0,0x1000001,0x2000006,0x0,0x0,0x3000007,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3000001,0x0,0x63100001,0x200000,0x200000,0x400000,0x63100001,0x0,0x63100001,0x0,0x0,0x8,0x400,0x200,0x18000,0x18000,0x7800,0x7800,0x30,0x30,0x1c0,0x1c0,0x0,0x3000007,0x0,0x1000001,0x2000006,0x0,};
}
private static void jj_la1_init_2() {
- jj_la1_2 = new int[]
{0x278,0x0,0x270,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x278,0x0,0x0,0x40,0x0,0x28,0x0,0x28,0x0,0x0,0x28,0x0,0x0,0x28,0x0,0x0,0x0,0x28,0x0,0x0,0x28,0x0,0x8,0x0,0x0,0x8,0x0,0x28,0x270,0x0,0x278,0x0,0x0,0x0,0x278,0x0,0x278,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x28,0x0,0x0,};
+ jj_la1_2 = new int[]
{0x13c,0x0,0x138,0x0,0x0,0x14,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x13c,0x0,0x0,0x20,0x0,0x14,0x0,0x14,0x0,0x0,0x14,0x0,0x0,0x14,0x0,0x0,0x0,0x14,0x0,0x0,0x14,0x0,0x4,0x0,0x0,0x4,0x0,0x14,0x138,0x0,0x13c,0x0,0x0,0x0,0x13c,0x0,0x13c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[12];
private boolean jj_rescan = false;
@@ -3687,7 +3656,7 @@
/** Generate ParseException. */
public ParseException generateParseException() {
jj_expentries.clear();
- boolean[] la1tokens = new boolean[74];
+ boolean[] la1tokens = new boolean[73];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
@@ -3707,7 +3676,7 @@
}
}
}
- for (int i = 0; i < 74; i++) {
+ for (int i = 0; i < 73; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java?rev=747106&r1=747105&r2=747106&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
Mon Feb 23 19:25:14 2009
@@ -109,43 +109,41 @@
/** RegularExpression Id. */
int ELSE_DIRECTIVE = 54;
/** RegularExpression Id. */
- int STOP_DIRECTIVE = 55;
+ int DIGIT = 55;
/** RegularExpression Id. */
- int DIGIT = 56;
+ int INTEGER_LITERAL = 56;
/** RegularExpression Id. */
- int INTEGER_LITERAL = 57;
+ int FLOATING_POINT_LITERAL = 57;
/** RegularExpression Id. */
- int FLOATING_POINT_LITERAL = 58;
+ int EXPONENT = 58;
/** RegularExpression Id. */
- int EXPONENT = 59;
+ int LETTER = 59;
/** RegularExpression Id. */
- int LETTER = 60;
+ int DIRECTIVE_CHAR = 60;
/** RegularExpression Id. */
- int DIRECTIVE_CHAR = 61;
+ int WORD = 61;
/** RegularExpression Id. */
- int WORD = 62;
+ int BRACKETED_WORD = 62;
/** RegularExpression Id. */
- int BRACKETED_WORD = 63;
+ int ALPHA_CHAR = 63;
/** RegularExpression Id. */
- int ALPHA_CHAR = 64;
+ int ALPHANUM_CHAR = 64;
/** RegularExpression Id. */
- int ALPHANUM_CHAR = 65;
+ int IDENTIFIER_CHAR = 65;
/** RegularExpression Id. */
- int IDENTIFIER_CHAR = 66;
+ int IDENTIFIER = 66;
/** RegularExpression Id. */
- int IDENTIFIER = 67;
+ int DOT = 67;
/** RegularExpression Id. */
- int DOT = 68;
+ int LCURLY = 68;
/** RegularExpression Id. */
- int LCURLY = 69;
+ int RCURLY = 69;
/** RegularExpression Id. */
- int RCURLY = 70;
+ int REFERENCE_TERMINATOR = 70;
/** RegularExpression Id. */
- int REFERENCE_TERMINATOR = 71;
+ int DIRECTIVE_TERMINATOR = 71;
/** RegularExpression Id. */
- int DIRECTIVE_TERMINATOR = 72;
- /** RegularExpression Id. */
- int EMPTY_INDEX = 73;
+ int EMPTY_INDEX = 72;
/** Lexical state. */
int REFERENCE = 0;
@@ -229,7 +227,6 @@
"<IF_DIRECTIVE>",
"<ELSEIF_DIRECTIVE>",
"<ELSE_DIRECTIVE>",
- "<STOP_DIRECTIVE>",
"<DIGIT>",
"<INTEGER_LITERAL>",
"<FLOATING_POINT_LITERAL>",