Skip to content
Snippets Groups Projects
Commit 9e1f31d5 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

Merge branch 'release/3.2.5'

parents e743bb1f 60e18981
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ apply plugin: 'eclipse' ...@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
apply plugin: 'maven' apply plugin: 'maven'
project.version = '3.2.2' project.version = '3.2.5'
project.group = 'de.stups' project.group = 'de.stups'
repositories { repositories {
......
...@@ -5,6 +5,7 @@ package org.sablecc.sablecc.node; ...@@ -5,6 +5,7 @@ package org.sablecc.sablecc.node;
import java.util.*; import java.util.*;
import org.sablecc.sablecc.analysis.*; import org.sablecc.sablecc.analysis.*;
@SuppressWarnings({"rawtypes","unchecked"})
public abstract class Node implements Switchable, Cloneable public abstract class Node implements Switchable, Cloneable
{ {
private Node parent; private Node parent;
......
...@@ -21,7 +21,7 @@ $ ...@@ -21,7 +21,7 @@ $
Macro:AlternativeHeader2 Macro:AlternativeHeader2
import $0$.*; import $0$.*;
@SuppressWarnings("nls")
public final class $1$ extends $2$ public final class $1$ extends $2$
{ {
...@@ -44,12 +44,12 @@ $ ...@@ -44,12 +44,12 @@ $
Macro:ConstructorHeaderDeclNode Macro:ConstructorHeaderDeclNode
@SuppressWarnings("hiding") $0$ _$1$_$2$ $0$ _$1$_$2$
$ $
Macro:ConstructorHeaderDeclList Macro:ConstructorHeaderDeclList
@SuppressWarnings("hiding") List<$0$> _$1$_$2$ List<$0$> _$1$_$2$
$ $
Macro:ConstructorBodyHeader Macro:ConstructorBodyHeader
...@@ -189,7 +189,7 @@ $ ...@@ -189,7 +189,7 @@ $
Macro:RemoveChildHeader Macro:RemoveChildHeader
@Override @Override
void removeChild(@SuppressWarnings("unused") Node child) void removeChild( Node child)
{ {
// Remove child // Remove child
...@@ -223,7 +223,7 @@ $ ...@@ -223,7 +223,7 @@ $
Macro:ReplaceChildHeader Macro:ReplaceChildHeader
@Override @Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) void replaceChild( Node oldChild, Node newChild)
{ {
// Replace child // Replace child
......
...@@ -131,7 +131,7 @@ Macro:AnalysisAdapterTail ...@@ -131,7 +131,7 @@ Macro:AnalysisAdapterTail
defaultCase(node); defaultCase(node);
} }
public void defaultCase(@SuppressWarnings("unused") Node node) public void defaultCase( Node node)
{ {
// do nothing // do nothing
} }
...@@ -149,6 +149,9 @@ import $1$.*; ...@@ -149,6 +149,9 @@ import $1$.*;
public class DepthFirstAdapter extends AnalysisAdapter public class DepthFirstAdapter extends AnalysisAdapter
{ {
final List<Void> dummy = new ArrayList<Void>();
public void inStart(Start node) public void inStart(Start node)
{ {
defaultIn(node); defaultIn(node);
...@@ -159,12 +162,12 @@ public class DepthFirstAdapter extends AnalysisAdapter ...@@ -159,12 +162,12 @@ public class DepthFirstAdapter extends AnalysisAdapter
defaultOut(node); defaultOut(node);
} }
public void defaultIn(@SuppressWarnings("unused") Node node) public void defaultIn( Node node)
{ {
// Do nothing // Do nothing
} }
public void defaultOut(@SuppressWarnings("unused") Node node) public void defaultOut( Node node)
{ {
// Do nothing // Do nothing
} }
...@@ -188,8 +191,11 @@ package $0$; ...@@ -188,8 +191,11 @@ package $0$;
import java.util.*; import java.util.*;
import $1$.*; import $1$.*;
public class ReversedDepthFirstAdapter extends AnalysisAdapter public class ReversedDepthFirstAdapter extends AnalysisAdapter
{ {
final List<Void> dummy = new ArrayList<Void>();
public void inStart(Start node) public void inStart(Start node)
{ {
defaultIn(node); defaultIn(node);
...@@ -200,12 +206,12 @@ public class ReversedDepthFirstAdapter extends AnalysisAdapter ...@@ -200,12 +206,12 @@ public class ReversedDepthFirstAdapter extends AnalysisAdapter
defaultOut(node); defaultOut(node);
} }
public void defaultIn(@SuppressWarnings("unused") Node node) public void defaultIn( Node node)
{ {
// Do nothing // Do nothing
} }
public void defaultOut(@SuppressWarnings("unused") Node node) public void defaultOut( Node node)
{ {
// Do nothing // Do nothing
} }
......
...@@ -10,7 +10,7 @@ Macro:LexerException ...@@ -10,7 +10,7 @@ Macro:LexerException
package $0$; package $0$;
@SuppressWarnings("serial") @SuppressWarnings({"serial"})
public class LexerException extends Exception public class LexerException extends Exception
{ {
public LexerException(String message) public LexerException(String message)
...@@ -32,7 +32,7 @@ import $1$.*; ...@@ -32,7 +32,7 @@ import $1$.*;
import de.hhu.stups.sablecc.patch.*; import de.hhu.stups.sablecc.patch.*;
@SuppressWarnings("nls") @SuppressWarnings({"unused"})
public class Lexer implements ITokenListContainer public class Lexer implements ITokenListContainer
{ {
protected Token token; protected Token token;
...@@ -63,7 +63,7 @@ public class Lexer implements ITokenListContainer ...@@ -63,7 +63,7 @@ public class Lexer implements ITokenListContainer
tokenList = list; tokenList = list;
} }
@SuppressWarnings("unused")
protected void filter() throws LexerException, IOException protected void filter() throws LexerException, IOException
{ {
// Do nothing // Do nothing
...@@ -78,7 +78,7 @@ public class Lexer implements ITokenListContainer ...@@ -78,7 +78,7 @@ public class Lexer implements ITokenListContainer
} }
public Lexer(@SuppressWarnings("hiding") PushbackReader in) public Lexer( PushbackReader in)
{ {
this.in = in; this.in = in;
setTokenList(new ArrayList<IToken>()); setTokenList(new ArrayList<IToken>());
...@@ -121,8 +121,8 @@ public class Lexer implements ITokenListContainer ...@@ -121,8 +121,8 @@ public class Lexer implements ITokenListContainer
int accept_pos = -1; int accept_pos = -1;
int accept_line = -1; int accept_line = -1;
@SuppressWarnings("hiding") int[][][] gotoTable = Lexer.gotoTable[this.state.id()]; int[][][] gotoTable = Lexer.gotoTable[this.state.id()];
@SuppressWarnings("hiding") int[] accept = Lexer.accept[this.state.id()]; int[] accept = Lexer.accept[this.state.id()];
this.text.setLength(0); this.text.setLength(0);
while(true) while(true)
...@@ -216,7 +216,7 @@ $ ...@@ -216,7 +216,7 @@ $
Macro:LexerVariableToken Macro:LexerVariableToken
case $0$: case $0$:
{ {
@SuppressWarnings("hiding") Token token = new$0$( Token token = new$0$(
getText(accept_length), getText(accept_length),
start_line + 1, start_line + 1,
start_pos + 1); start_pos + 1);
...@@ -229,7 +229,7 @@ $ ...@@ -229,7 +229,7 @@ $
Macro:LexerFixedToken Macro:LexerFixedToken
case $0$: case $0$:
{ {
@SuppressWarnings("hiding") Token token = new$0$( Token token = new$0$(
start_line + 1, start_line + 1,
start_pos + 1); start_pos + 1);
pushBack(accept_length); pushBack(accept_length);
...@@ -272,7 +272,7 @@ Macro:LexerBody1 ...@@ -272,7 +272,7 @@ Macro:LexerBody1
" Unknown token: " + this.text); " Unknown token: " + this.text);
} }
@SuppressWarnings("hiding") EOF token = new EOF( EOF token = new EOF(
start_line + 1, start_line + 1,
start_pos + 1); start_pos + 1);
return token; return token;
...@@ -285,12 +285,12 @@ Macro:LexerBody1 ...@@ -285,12 +285,12 @@ Macro:LexerBody1
$ $
Macro:LexerNewVariableToken Macro:LexerNewVariableToken
Token new$0$(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new $1$(text, line, pos); } Token new$0$( String text, int line, int pos) { return new $1$(text, line, pos); }
$ $
Macro:LexerNewFixedToken Macro:LexerNewFixedToken
Token new$0$(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new $1$(line, pos); } Token new$0$( int line, int pos) { return new $1$(line, pos); }
$ $
...@@ -324,9 +324,9 @@ Macro:LexerBody2 ...@@ -324,9 +324,9 @@ Macro:LexerBody2
} }
} }
protected void unread(@SuppressWarnings("hiding") Token token) throws IOException protected void unread( Token token) throws IOException
{ {
@SuppressWarnings("hiding") String text = token.getText(); String text = token.getText();
int length = text.length(); int length = text.length();
for(int i = length - 1; i >= 0; i--) for(int i = length - 1; i >= 0; i--)
...@@ -385,7 +385,7 @@ Macro:LexerStateTail ...@@ -385,7 +385,7 @@ Macro:LexerStateTail
private int id; private int id;
private State(@SuppressWarnings("hiding") int id) private State( int id)
{ {
this.id = id; this.id = id;
} }
......
...@@ -21,7 +21,7 @@ import java.io.DataInputStream; ...@@ -21,7 +21,7 @@ import java.io.DataInputStream;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.IOException; import java.io.IOException;
@SuppressWarnings("nls") @SuppressWarnings({"rawtypes","unchecked","unused"})
public class Parser implements IParser public class Parser implements IParser
{ {
public final Analysis ignoredTokens = new AnalysisAdapter(); public final Analysis ignoredTokens = new AnalysisAdapter();
...@@ -45,7 +45,7 @@ public class Parser implements IParser ...@@ -45,7 +45,7 @@ public class Parser implements IParser
private ArrayList lastPopped = null; private ArrayList lastPopped = null;
private ITokenListContainer lex; private ITokenListContainer lex;
public Parser(@SuppressWarnings("hiding") Lexer lexer) public Parser( Lexer lexer)
{ {
this.lexer = lexer; this.lexer = lexer;
this.lex = lexer; this.lex = lexer;
...@@ -59,7 +59,7 @@ public class Parser implements IParser ...@@ -59,7 +59,7 @@ public class Parser implements IParser
checkResult(elementToCheck, false); checkResult(elementToCheck, false);
} }
@SuppressWarnings("unchecked")
private void checkResult(Object elementToCheck, boolean slurp) { private void checkResult(Object elementToCheck, boolean slurp) {
// nodes with no tokens or sub nodes at all may exist // nodes with no tokens or sub nodes at all may exist
if (this.firstPopped == null) { if (this.firstPopped == null) {
...@@ -98,7 +98,8 @@ public class Parser implements IParser ...@@ -98,7 +98,8 @@ public class Parser implements IParser
} }
final int begin = findBeginPos(this.lastPopped, node); final int begin = findBeginPos(this.lastPopped, node);
final int end = findEndPos(this.firstPopped); int end = findEndPos(this.firstPopped);
if (end == -1) end = begin;
final SourcecodeRange range = new SourcecodeRange(begin, end); final SourcecodeRange range = new SourcecodeRange(begin, end);
this.getMapping().put(node, range); this.getMapping().put(node, range);
...@@ -108,7 +109,7 @@ public class Parser implements IParser ...@@ -108,7 +109,7 @@ public class Parser implements IParser
} }
} }
@SuppressWarnings({ "unchecked", "unused" })
private int findBeginPos(final ArrayList list, private int findBeginPos(final ArrayList list,
PositionedNode n) { PositionedNode n) {
Object first = list.get(0); Object first = list.get(0);
...@@ -139,7 +140,7 @@ public class Parser implements IParser ...@@ -139,7 +140,7 @@ public class Parser implements IParser
return item.getBeginIndex(); return item.getBeginIndex();
} }
@SuppressWarnings({ "unchecked", "unused" })
private int findEndPos(final ArrayList list) { private int findEndPos(final ArrayList list) {
Object last = list.get(list.size() - 1); Object last = list.get(list.size() - 1);
if (!(last instanceof PositionedNode) && !(last instanceof IToken)) { if (!(last instanceof PositionedNode) && !(last instanceof IToken)) {
...@@ -153,6 +154,8 @@ public class Parser implements IParser ...@@ -153,6 +154,8 @@ public class Parser implements IParser
final PositionedNode node = (PositionedNode) last; final PositionedNode node = (PositionedNode) last;
final SourcecodeRange item = this.getMapping().get(node); final SourcecodeRange item = this.getMapping().get(node);
if (item == null)
return -1;
return item.getEndIndex(); return item.getEndIndex();
} }
...@@ -184,7 +187,7 @@ public class Parser implements IParser ...@@ -184,7 +187,7 @@ public class Parser implements IParser
$ $
Macro:ParserInliningPushHeader Macro:ParserInliningPushHeader
@SuppressWarnings({"unchecked","unused"})
private void push(int numstate, ArrayList listNode) throws ParserException, LexerException, IOException private void push(int numstate, ArrayList listNode) throws ParserException, LexerException, IOException
{ {
this.nodeList = listNode; this.nodeList = listNode;
...@@ -276,7 +279,7 @@ Macro:ParserCommon ...@@ -276,7 +279,7 @@ Macro:ParserCommon
return this.converter.index; return this.converter.index;
} }
@SuppressWarnings("unchecked")
public Start parse() throws ParserException, LexerException, IOException public Start parse() throws ParserException, LexerException, IOException
{ {
this.getMapping().clear(); this.getMapping().clear();
...@@ -391,18 +394,18 @@ $ ...@@ -391,18 +394,18 @@ $
Macro:ParserNewHeader Macro:ParserNewHeader
@SuppressWarnings("unchecked")
ArrayList new$0$() /* reduce $1$ */ ArrayList new$0$() /* reduce $1$ */
{ {
this.firstPopped = null; this.firstPopped = null;
this.lastPopped = null; this.lastPopped = null;
@SuppressWarnings("hiding") ArrayList nodeList = new ArrayList(); ArrayList nodeList = new ArrayList();
$ $
Macro:ParserNewBodyDecl Macro:ParserNewBodyDecl
@SuppressWarnings("unused") ArrayList nodeArrayList$0$ = pop(); ArrayList nodeArrayList$0$ = pop();
$ $
...@@ -433,7 +436,7 @@ Macro:ParserListVariableDeclaration ...@@ -433,7 +436,7 @@ Macro:ParserListVariableDeclaration
$ $
Macro:ParserNullVariableDeclaration Macro:ParserNullVariableDeclaration
@SuppressWarnings("unused") Object nullNode$0$ = null; Object nullNode$0$ = null;
$ $
...@@ -641,7 +644,7 @@ $ ...@@ -641,7 +644,7 @@ $
Macro:TokenIndexBody Macro:TokenIndexBody
@Override @Override
public void case$0$(@SuppressWarnings("unused") $0$ node) public void case$0$( $0$ node)
{ {
this.index = $1$; this.index = $1$;
} }
...@@ -651,7 +654,7 @@ $ ...@@ -651,7 +654,7 @@ $
Macro:TokenIndexTail Macro:TokenIndexTail
@Override @Override
public void caseEOF(@SuppressWarnings("unused") EOF node) public void caseEOF( EOF node)
{ {
this.index = $0$; this.index = $0$;
} }
...@@ -671,7 +674,7 @@ public class ParserException extends Exception ...@@ -671,7 +674,7 @@ public class ParserException extends Exception
{ {
Token token; Token token;
public ParserException(@SuppressWarnings("hiding") Token token, String message) public ParserException( Token token, String message)
{ {
super(message); super(message);
this.token = token; this.token = token;
...@@ -692,12 +695,13 @@ package $0$; ...@@ -692,12 +695,13 @@ package $0$;
import java.util.ArrayList; import java.util.ArrayList;
@SuppressWarnings("rawtypes")
final class State final class State
{ {
int state; int state;
ArrayList nodes; ArrayList nodes;
State(@SuppressWarnings("hiding") int state, @SuppressWarnings("hiding") ArrayList nodes) State( int state, ArrayList nodes)
{ {
this.state = state; this.state = state;
this.nodes = nodes; this.nodes = nodes;
......
...@@ -15,7 +15,7 @@ package $0$; ...@@ -15,7 +15,7 @@ package $0$;
import $1$.*; import $1$.*;
@SuppressWarnings("nls")
public final class $2$ extends Token public final class $2$ extends Token
{ {
public $2$(String text) public $2$(String text)
...@@ -55,7 +55,7 @@ package $0$; ...@@ -55,7 +55,7 @@ package $0$;
import $1$.*; import $1$.*;
@SuppressWarnings("nls")
public final class $2$ extends Token public final class $2$ extends Token
{ {
public $2$() public $2$()
...@@ -82,7 +82,7 @@ public final class $2$ extends Token ...@@ -82,7 +82,7 @@ public final class $2$ extends Token
} }
@Override @Override
public void setText(@SuppressWarnings("unused") String text) public void setText( String text)
{ {
throw new RuntimeException("Cannot change $2$ text."); throw new RuntimeException("Cannot change $2$ text.");
} }
......
...@@ -12,7 +12,6 @@ package $0$; ...@@ -12,7 +12,6 @@ package $0$;
import $1$.*; import $1$.*;
@SuppressWarnings("nls")
public final class Start extends Node public final class Start extends Node
{ {
private $2$ _$3$_; private $2$ _$3$_;
...@@ -24,8 +23,8 @@ public final class Start extends Node ...@@ -24,8 +23,8 @@ public final class Start extends Node
} }
public Start( public Start(
@SuppressWarnings("hiding") $2$ _$3$_, $2$ _$3$_,
@SuppressWarnings("hiding") EOF _eof_) EOF _eof_)
{ {
set$2$(_$3$_); set$2$(_$3$_);
setEOF(_eof_); setEOF(_eof_);
...@@ -148,7 +147,7 @@ package $0$; ...@@ -148,7 +147,7 @@ package $0$;
import $1$.*; import $1$.*;
@SuppressWarnings("nls")
public final class EOF extends Token public final class EOF extends Token
{ {
public EOF() public EOF()
...@@ -185,7 +184,7 @@ package $0$; ...@@ -185,7 +184,7 @@ package $0$;
import de.hhu.stups.sablecc.patch.IToken; import de.hhu.stups.sablecc.patch.IToken;
@SuppressWarnings("nls")
public abstract class Token extends Node implements IToken public abstract class Token extends Node implements IToken
{ {
private String text; private String text;
...@@ -197,7 +196,7 @@ public abstract class Token extends Node implements IToken ...@@ -197,7 +196,7 @@ public abstract class Token extends Node implements IToken
return this.text; return this.text;
} }
public void setText(@SuppressWarnings("hiding") String text) public void setText( String text)
{ {
this.text = text; this.text = text;
} }
...@@ -207,7 +206,7 @@ public abstract class Token extends Node implements IToken ...@@ -207,7 +206,7 @@ public abstract class Token extends Node implements IToken
return this.line; return this.line;
} }
public void setLine(@SuppressWarnings("hiding") int line) public void setLine( int line)
{ {
this.line = line; this.line = line;
} }
...@@ -217,7 +216,7 @@ public abstract class Token extends Node implements IToken ...@@ -217,7 +216,7 @@ public abstract class Token extends Node implements IToken
return this.pos; return this.pos;
} }
public void setPos(@SuppressWarnings("hiding") int pos) public void setPos( int pos)
{ {
this.pos = pos; this.pos = pos;
} }
...@@ -229,13 +228,13 @@ public abstract class Token extends Node implements IToken ...@@ -229,13 +228,13 @@ public abstract class Token extends Node implements IToken
} }
@Override @Override
void removeChild(@SuppressWarnings("unused") Node child) void removeChild( Node child)
{ {
throw new RuntimeException("Not a child."); throw new RuntimeException("Not a child.");
} }
@Override @Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) void replaceChild( Node oldChild, Node newChild)
{ {
throw new RuntimeException("Not a child."); throw new RuntimeException("Not a child.");
} }
...@@ -251,7 +250,7 @@ package $0$; ...@@ -251,7 +250,7 @@ package $0$;
import java.util.*; import java.util.*;
import de.hhu.stups.sablecc.patch.PositionedNode; import de.hhu.stups.sablecc.patch.PositionedNode;
@SuppressWarnings("nls") @SuppressWarnings({"rawtypes","unchecked"})
public abstract class Node extends PositionedNode implements Switchable, Cloneable public abstract class Node extends PositionedNode implements Switchable, Cloneable
{ {
private Node parent; private Node parent;
...@@ -264,7 +263,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab ...@@ -264,7 +263,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return this.parent; return this.parent;
} }
void parent(@SuppressWarnings("hiding") Node parent) void parent( Node parent)
{ {
this.parent = parent; this.parent = parent;
} }
...@@ -299,7 +298,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab ...@@ -299,7 +298,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return s.toString(); return s.toString();
} }
@SuppressWarnings("unchecked")
protected <T extends Node> T cloneNode(T node) protected <T extends Node> T cloneNode(T node)
{ {
if(node != null) if(node != null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment