You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/09/18 21:42:55 UTC

svn commit: r696780 - /tomcat/trunk/java/org/apache/el/parser/ELParser.jjt

Author: markt
Date: Thu Sep 18 12:42:54 2008
New Revision: 696780

URL: http://svn.apache.org/viewvc?rev=696780&view=rev
Log:
Add explicit lookaheads where they could be ambiguity. This resolves some TCK failures with the fix for 42565.

Modified:
    tomcat/trunk/java/org/apache/el/parser/ELParser.jjt

Modified: tomcat/trunk/java/org/apache/el/parser/ELParser.jjt
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/ELParser.jjt?rev=696780&r1=696779&r2=696780&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/ELParser.jjt (original)
+++ tomcat/trunk/java/org/apache/el/parser/ELParser.jjt Thu Sep 18 12:42:54 2008
@@ -104,7 +104,7 @@
  */
 void Choice() : {}
 {
-    Or() (<QUESTIONMARK> Choice() <COLON> Choice() #Choice(3))*
+    Or() (LOOKAHEAD(3) <QUESTIONMARK> Choice() <COLON> Choice() #Choice(3))*
 }
 
 /*
@@ -278,7 +278,7 @@
     Token t1 = null;
 }
 {
-    (t0=<IDENTIFIER> <COLON>)? t1=<IDENTIFIER>
+    (LOOKAHEAD(2) t0=<IDENTIFIER> <COLON>)? t1=<IDENTIFIER>
     {
         if (t0 != null) {
             jjtThis.setPrefix(t0.image);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r696780 - /tomcat/trunk/java/org/apache/el/parser/ELParser.jjt

Posted by Mark Thomas <ma...@apache.org>.
Remy Maucherat wrote:
> On Thu, 2008-09-18 at 19:42 +0000, markt@apache.org wrote:
>> Author: markt
>> Date: Thu Sep 18 12:42:54 2008
>> New Revision: 696780
>>
>> URL: http://svn.apache.org/viewvc?rev=696780&view=rev
>> Log:
>> Add explicit lookaheads where they could be ambiguity. This resolves some TCK failures with the fix for 42565.
> 
> I suppose not abusing lookahead is a lot more efficient.

Probably, although my reason for doing it this way is as soon as you set
any global lookahead javacc assumes you know what you are doing and stops
giving you any lookahead warnings even if it knows you need a larger
lookahead than your global setting.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r696780 - /tomcat/trunk/java/org/apache/el/parser/ELParser.jjt

Posted by Remy Maucherat <re...@apache.org>.
On Thu, 2008-09-18 at 19:42 +0000, markt@apache.org wrote:
> Author: markt
> Date: Thu Sep 18 12:42:54 2008
> New Revision: 696780
> 
> URL: http://svn.apache.org/viewvc?rev=696780&view=rev
> Log:
> Add explicit lookaheads where they could be ambiguity. This resolves some TCK failures with the fix for 42565.

I suppose not abusing lookahead is a lot more efficient.

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org