diff --git a/src/main/java/org/sablecc/sablecc/parser/Parser.java b/src/main/java/org/sablecc/sablecc/parser/Parser.java index 939999117e023a9bd968ce4567c06ec404a0a5bd..6f04f9d70c21b0cf4e7c0004b3f8fefd6ad4b23d 100644 --- a/src/main/java/org/sablecc/sablecc/parser/Parser.java +++ b/src/main/java/org/sablecc/sablecc/parser/Parser.java @@ -36,7 +36,7 @@ public class Parser implements IParser this.lexer = lexer; } - private void computePositions(PositionedNode node, List<?> beginNodeList, List<?> endNodeList) { + private static void computePositions(PositionedNode node, List<?> beginNodeList, List<?> endNodeList) { // This method should only ever be called for newly created AST nodes (that are not tokens). assert !(node instanceof Token); assert node.getStartPos() == null; @@ -49,7 +49,7 @@ public class Parser implements IParser node.setEndPos(endNode.getEndPos()); } - private PositionedNode findBeginNode(final List<?> list) { + private static PositionedNode findBeginNode(final List<?> list) { Object first = list.get(0); if (first instanceof List<?>) { List<?> list2 = (List<?>) first; @@ -59,7 +59,7 @@ public class Parser implements IParser return (PositionedNode)first; } - private PositionedNode findEndNode(final List<?> list) { + private static PositionedNode findEndNode(final List<?> list) { Object last = list.get(list.size() - 1); if (last instanceof List<?>) { final List<?> list2 = (List<?>) last; diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index 1c23fcf47490a7758e6b01aa2d06b6891820f508..72b1419148fb67793cc751dfde29c5b5ddd8053f 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -44,7 +44,7 @@ public class Parser implements IParser this.lexer = lexer; } - private void computePositions(PositionedNode node, List<?> beginNodeList, List<?> endNodeList) { + private static void computePositions(PositionedNode node, List<?> beginNodeList, List<?> endNodeList) { // This method should only ever be called for newly created AST nodes (that are not tokens). assert !(node instanceof Token); assert node.getStartPos() == null; @@ -57,7 +57,7 @@ public class Parser implements IParser node.setEndPos(endNode.getEndPos()); } - private PositionedNode findBeginNode(final List<?> list) { + private static PositionedNode findBeginNode(final List<?> list) { Object first = list.get(0); if (first instanceof List<?>) { List<?> list2 = (List<?>) first; @@ -67,7 +67,7 @@ public class Parser implements IParser return (PositionedNode)first; } - private PositionedNode findEndNode(final List<?> list) { + private static PositionedNode findEndNode(final List<?> list) { Object last = list.get(list.size() - 1); if (last instanceof List<?>) { final List<?> list2 = (List<?>) last;