Skip to content
Snippets Groups Projects
Commit 0d8c93cc authored by dgelessus's avatar dgelessus
Browse files

Fix remaining javac warnings

parent e2c0465e
No related branches found
No related tags found
No related merge requests found
Pipeline #86731 passed
......@@ -46,7 +46,7 @@ public class ConstructNFA extends DepthFirstAdapter
@Override
public void outATokens(ATokens node)
{
ATokenDef[] tokenDefs = (ATokenDef[]) node.getTokenDefs().toArray(new ATokenDef[0]);
PTokenDef[] tokenDefs = node.getTokenDefs().toArray(new PTokenDef[0]);
for(int i = tokenDefs.length - 1; i >= 0 ; i--)
{
......@@ -101,7 +101,7 @@ public class ConstructNFA extends DepthFirstAdapter
final AStateList node = (AStateList)stateList;
Set<String> set = new TreeSet<>();
AStateListTail[] stateListTails = (AStateListTail[]) node.getStateLists().toArray(new AStateListTail[0]);
AStateListTail[] stateListTails = node.getStateLists().toArray(new AStateListTail[0]);
for(int i = stateListTails.length - 1; i >= 0 ; i--)
{
......@@ -116,7 +116,7 @@ public class ConstructNFA extends DepthFirstAdapter
@Override
public void outARegExp(ARegExp node)
{
AConcat[] concats = (AConcat[]) node.getConcats().toArray(new AConcat[0]);
PConcat[] concats = node.getConcats().toArray(new PConcat[0]);
NFA result = null;
if(concats.length > 1)
......@@ -152,7 +152,7 @@ public class ConstructNFA extends DepthFirstAdapter
@Override
public void outAConcat(AConcat node)
{
AUnExp[] unExps = (AUnExp[]) node.getUnExps().toArray(new AUnExp[0]);
PUnExp[] unExps = node.getUnExps().toArray(new PUnExp[0]);
if(unExps.length == 0)
{
......
......@@ -34,10 +34,9 @@ public class ConstructParserGenerationDatas extends DepthFirstAdapter
public void caseAProd(AProd node)
{
currentProd = ids.names.get(node);
AAlt[] alts = (AAlt[])node.getAlts().toArray(new AAlt[0]);
for(int i=0; i<alts.length; i++)
for(PAlt alt : node.getAlts())
{
alts[i].apply(this);
alt.apply(this);
}
}
......@@ -47,10 +46,9 @@ public class ConstructParserGenerationDatas extends DepthFirstAdapter
currentAlt = Grammar.addProduction(currentProd, ids.names.get(node));
alts.put(ids.names.get(node), node);
AElem[] temp = (AElem[])node.getElems().toArray(new AElem[0]);
for(int i = 0; i < temp.length; i++)
for(PElem elem : node.getElems())
{
temp[i].apply(this);
elem.apply(this);
}
}
......
......@@ -387,6 +387,6 @@ public class IntSet
public int[] elements()
{
return (int[]) elements/*.clone()*/;
return elements/*.clone()*/;
}
}
......@@ -24,8 +24,12 @@ final class LR1Collection
// Initialize lookaheads to nothing, propagation to nothing
LR0ItemSet[] sets = collection.sets();
lookaheads = (TreeMap<LR0Item, SymbolSet>[])new TreeMap<?, ?>[sets.length];
propagation = (TreeMap<LR0Item, Vector<LR0ItemAndSetPair>>[])new TreeMap<?, ?>[sets.length];
@SuppressWarnings("unchecked")
final TreeMap<LR0Item, SymbolSet>[] lookaheadsTemp = (TreeMap<LR0Item, SymbolSet>[])new TreeMap<?, ?>[sets.length];
lookaheads = lookaheadsTemp;
@SuppressWarnings("unchecked")
final TreeMap<LR0Item, Vector<LR0ItemAndSetPair>>[] propagationTemp = (TreeMap<LR0Item, Vector<LR0ItemAndSetPair>>[])new TreeMap<?, ?>[sets.length];
propagation = propagationTemp;
for(int i = 0; i < sets.length; i++)
{
......
......@@ -75,11 +75,11 @@ final class Symbol implements Comparable<Symbol>
{
if(terminal)
{
return (Symbol) terminals.elementAt(index);
return terminals.elementAt(index);
}
else
{
return (Symbol) nonterminals.elementAt(index);
return nonterminals.elementAt(index);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment