Skip to content

Commit

Permalink
Merge pull request #50 from csamak/master
Browse files Browse the repository at this point in the history
Update to ph-javacc-maven-plugin 4.1.4
  • Loading branch information
henrib committed Jun 3, 2021
2 parents 44c4345 + 12390b6 commit 5b84709
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 15 deletions.
11 changes: 3 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,9 @@
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<version>2.6</version>
<!--
<groupId>com.helger.maven</groupId>
<artifactId>ph-javacc-maven-plugin</artifactId>
<version>4.0.3</version>
-->
<groupId>com.helger.maven</groupId>
<artifactId>ph-javacc-maven-plugin</artifactId>
<version>4.1.4</version>
<executions>
<execution>
<id>jexl-jjtree</id>
Expand Down
8 changes: 8 additions & 0 deletions src/main/config/clirr-ignored.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@
<method>java.lang.ClassLoader getClassLoader()</method>
<to>java.lang.ClassLoader getClassLoader()</to>
</difference>

<!-- The parser now expects/generates TokenMgrException instead of TokenMgrError -->
<difference>
<className>org/apache/commons/jexl3/JexlException$Tokenization</className>
<differenceType>7005</differenceType> <!-- parser now constructs this exception using TokenMgrException -->
<method>JexlException$Tokenization(org.apache.commons.jexl3.JexlInfo, org.apache.commons.jexl3.parser.TokenMgrError)</method>
<to>JexlException$Tokenization(org.apache.commons.jexl3.JexlInfo, org.apache.commons.jexl3.parser.TokenMgrException)</to>
</difference>
</differences>
4 changes: 2 additions & 2 deletions src/main/java/org/apache/commons/jexl3/JexlException.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.jexl3.parser.JavaccError;
import org.apache.commons.jexl3.parser.JexlNode;
import org.apache.commons.jexl3.parser.ParseException;
import org.apache.commons.jexl3.parser.TokenMgrError;
import org.apache.commons.jexl3.parser.TokenMgrException;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;
Expand Down Expand Up @@ -294,7 +294,7 @@ public static class Tokenization extends JexlException {
* @param info the location info
* @param cause the javacc cause
*/
public Tokenization(final JexlInfo info, final TokenMgrError cause) {
public Tokenization(final JexlInfo info, final TokenMgrException cause) {
super(merge(info, cause), Objects.requireNonNull(cause).getAfter(), null);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/jexl3/parser/Parser.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public final class Parser extends JexlParser
? Collections.unmodifiableMap(pragmas)
: Collections.emptyMap());
return script;
} catch (TokenMgrError xtme) {
} catch (TokenMgrException xtme) {
throw new JexlException.Tokenization(info, xtme).clean();
} catch (ParseException xparse) {
Token errortok = errorToken(jj_lastpos, jj_scanpos, token.next, token);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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.commons.jexl3.parser;

/**
* This class only exists to prevent JJTree from generating it, since it
* expects {@link ParserVisitor} to be an interface, not an abstract class.
*/
class ParserDefaultVisitor { }
5 changes: 5 additions & 0 deletions src/main/java/org/apache/commons/jexl3/parser/SimpleNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ public void dump(final String prefix) {
}
}
}

@Override
public int getId() {
return id;
}
}

/* JavaCC - OriginalChecksum=7dff880883d088a37c1e3197e4b455a0 (do not edit this line) */
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Token Manager Error.
*/
public class TokenMgrError extends Error implements JavaccError {
public class TokenMgrException extends RuntimeException implements JavaccError {
/**
* The version identifier for this Serializable class.
* Increment only if the <i>serialized</i> form of the
Expand Down Expand Up @@ -94,19 +94,19 @@ public String getMessage() {


/** Constructor with message and reason. */
public TokenMgrError(final String message, final int reason) {
public TokenMgrException(final String message, final int reason) {
super(message);
errorCode = reason;
}

/** Full Constructor. */
public TokenMgrError(final boolean EOFSeen, final int lexState, final int errorLine, final int errorColumn, final String errorAfter, final char curChar, final int reason) {
public TokenMgrException(final boolean EOFSeen, final int lexState, final int errorLine, final int errorColumn, final String errorAfter, final int curChar, final int reason) {
eof = EOFSeen;
state = lexState;
line = errorLine;
column = errorColumn;
after = errorAfter;
current = curChar;
current = (char) curChar;
errorCode = reason;
}

Expand Down

0 comments on commit 5b84709

Please sign in to comment.