Commit 64f78bbe authored by Fred Eisele's avatar Fred Eisele
Browse files

suppressed or fixed warnings, added transform for compose and distinct

parent cecc835f
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
......@@ -13535,6 +13535,26 @@ public class AqlParser extends Parser {
else return visitor.visitChildren(this);
}
}
public static class TransformExp_DistinctContext extends TransformExpContext {
public TerminalNode DISTINCT() { return getToken(AqlParser.DISTINCT, 0); }
public TransformRefContext transformRef() {
return getRuleContext(TransformRefContext.class,0);
}
public TransformExp_DistinctContext(TransformExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).enterTransformExp_Distinct(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).exitTransformExp_Distinct(this);
}
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof AqlParserVisitor ) return ((AqlParserVisitor<? extends T>)visitor).visitTransformExp_Distinct(this);
else return visitor.visitChildren(this);
}
}
public static class TransformExp_DeltaContext extends TransformExpContext {
public TerminalNode DELTA() { return getToken(AqlParser.DELTA, 0); }
public MappingKindContext mappingKind() {
......@@ -13816,26 +13836,6 @@ public class AqlParser extends Parser {
else return visitor.visitChildren(this);
}
}
public static class TransformExp_DestinationContext extends TransformExpContext {
public TerminalNode DISTINCT() { return getToken(AqlParser.DISTINCT, 0); }
public TransformRefContext transformRef() {
return getRuleContext(TransformRefContext.class,0);
}
public TransformExp_DestinationContext(TransformExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).enterTransformExp_Destination(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).exitTransformExp_Destination(this);
}
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof AqlParserVisitor ) return ((AqlParserVisitor<? extends T>)visitor).visitTransformExp_Destination(this);
else return visitor.visitChildren(this);
}
}
 
public final TransformExpContext transformExp() throws RecognitionException {
TransformExpContext _localctx = new TransformExpContext(_ctx, getState());
......@@ -13872,7 +13872,7 @@ public class AqlParser extends Parser {
}
break;
case DISTINCT:
_localctx = new TransformExp_DestinationContext(_localctx);
_localctx = new TransformExp_DistinctContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1883);
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.ParserRuleContext;
......@@ -2764,13 +2764,13 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx) { }
@Override public void enterTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx) { }
@Override public void exitTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx) { }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
......@@ -1620,7 +1620,7 @@ public class AqlParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impleme
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx) { return visitChildren(ctx); }
@Override public T visitTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
......@@ -2486,17 +2486,17 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitTransformExp_Compose(AqlParser.TransformExp_ComposeContext ctx);
/**
* Enter a parse tree produced by the {@code TransformExp_Destination}
* Enter a parse tree produced by the {@code TransformExp_Distinct}
* labeled alternative in {@link AqlParser#transformExp}.
* @param ctx the parse tree
*/
void enterTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx);
void enterTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx);
/**
* Exit a parse tree produced by the {@code TransformExp_Destination}
* Exit a parse tree produced by the {@code TransformExp_Distinct}
* labeled alternative in {@link AqlParser#transformExp}.
* @param ctx the parse tree
*/
void exitTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx);
void exitTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx);
/**
* Enter a parse tree produced by the {@code TransformExp_Delta}
* labeled alternative in {@link AqlParser#transformExp}.
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/p48/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
......@@ -1479,12 +1479,12 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitTransformExp_Compose(AqlParser.TransformExp_ComposeContext ctx);
/**
* Visit a parse tree produced by the {@code TransformExp_Destination}
* Visit a parse tree produced by the {@code TransformExp_Distinct}
* labeled alternative in {@link AqlParser#transformExp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx);
T visitTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx);
/**
* Visit a parse tree produced by the {@code TransformExp_Delta}
* labeled alternative in {@link AqlParser#transformExp}.
......
......@@ -14,7 +14,7 @@ transformExp
# TransformExp_Compose
| DISTINCT transformRef
# TransformExp_Destination
# TransformExp_Distinct
| DELTA mappingKind transformRef
# TransformExp_Delta
......
......@@ -28,6 +28,7 @@ public class BinRelMap<X, Y> implements Iterable<Pair<X, Y>> {
return false;
if (!(obj instanceof BinRelMap))
return false;
@SuppressWarnings("rawtypes")
BinRelMap other = (BinRelMap) obj;
if (R == null) {
if (other.R != null)
......
......@@ -10,7 +10,6 @@ import java.util.stream.Collectors;
import catdata.Util;
import catdata.aql.AqlProver.ProverName;
import catdata.aql.exp.AqlParserFactory;
import catdata.aql.exp.InstExpRaw.Gen;
import catdata.aql.exp.InstExpRaw.Sk;
import catdata.aql.exp.SchExpRaw.Att;
......@@ -356,10 +355,12 @@ public final class AqlOptions {
* @param map
* @param col possibly null
*/
public <Ty, En, Sym, Fk, Att, Gen, Sk> AqlOptions(Map<String, String> map, Collage col, AqlOptions defaults) {
@SuppressWarnings("hiding")
public <Ty, En, Sym, Fk, Att, Gen, Sk> AqlOptions(Map<String, String> map, @SuppressWarnings("rawtypes") Collage col, AqlOptions defaults) {
options = new HashMap<>(defaults.options);
for (String key : map.keySet()) {
AqlOption op = AqlOption.valueOf(key);
@SuppressWarnings("unchecked")
Object ob = getFromMap(map, col, op);
options.put(op, ob);
}
......
......@@ -39,12 +39,14 @@ public class CodyCmdLine {
Util.writeFile(s, f.getAbsolutePath());
}
for (String k : env.defs.insts.keySet()) {
@SuppressWarnings("rawtypes")
Instance ts = env.defs.insts.get(k);
File f = new File(dir, k + ".tptp");
String s = ts.collage().toKB().tptp(true); //maedmax is unsound with empty sorts, but true here proceeds anyway
Util.writeFile(s, f.getAbsolutePath());
}
for (String k : env.defs.schs.keySet()) {
@SuppressWarnings("rawtypes")
Schema ts = env.defs.schs.get(k);
File f = new File(dir, k + ".tptp");
String s = ts.collage().toKB().tptp(true); //maedmax is unsound with empty sorts, but true here proceeds anyway
......
......@@ -21,7 +21,6 @@ import catdata.aql.exp.SchExpRaw;
import catdata.aql.exp.SchExpRaw.Att;
import catdata.aql.exp.SchExpRaw.En;
import catdata.aql.exp.SchExpRaw.Fk;
import catdata.aql.exp.TyExpRaw;
import catdata.aql.exp.TyExpRaw.Sym;
import catdata.aql.exp.TyExpRaw.Ty;
import catdata.graph.DMG;
......@@ -405,6 +404,7 @@ public class ColimitSchema<N> implements Semantics {
}
//should be real terms in the String schema
@SuppressWarnings("unchecked")
public ColimitSchema(TypeSide<Ty, Sym> ty, Ctx<N, Schema<Ty, En, Sym, Fk, Att>> nodes,
Set<Quad<N,En,N,En>> eqEn,
Set<Quad<String,String,RawTerm,RawTerm>> eqTerms,
......@@ -459,6 +459,7 @@ public class ColimitSchema<N> implements Semantics {
for (N n : x.second.keySet()) {
Mapping<Ty, En, Sym, Fk, Att, En, Fk, Att> f = x.second.get(n);
@SuppressWarnings({ "rawtypes" })
Mapping g
= new Mapping(f.ens.map, f.atts.map, f.fks.map, f.src, q, b);
......
......@@ -5,6 +5,7 @@ public class Lineage<Ty,En,Sym,Fk,Att,Gen,Sk> {
public final Integer i;
public final Term<Ty,En,Sym,Fk,Att,Gen,Sk> t;
@SuppressWarnings({ "hiding", "unchecked" })
public <Ty,En,Sym,Fk,Att,Gen,Sk> Lineage<Ty,En,Sym,Fk,Att,Gen,Sk> convert() {
return (Lineage<Ty, En, Sym, Fk, Att, Gen, Sk>) this;
}
......@@ -28,6 +29,7 @@ public class Lineage<Ty,En,Sym,Fk,Att,Gen,Sk> {
return true;
if (obj == null)
return false;
@SuppressWarnings("rawtypes")
Lineage other = (Lineage) obj;
if (i == null) {
if (other.i != null)
......
......@@ -56,7 +56,6 @@ import catdata.aql.grammar.AqlParser.InstanceSigmaSectionContext;
import catdata.aql.grammar.AqlParser.MappingGenContext;
import catdata.aql.grammar.AqlParser.MappingKindContext;
import catdata.aql.grammar.AqlParser.MappingLiteralSectionContext;
import catdata.aql.grammar.AqlParser.MappingRefContext;
import catdata.aql.grammar.AqlParser.QueryGenContext;
import catdata.aql.grammar.AqlParser.QueryKindContext;
import catdata.aql.grammar.AqlParser.QueryLiteralSectionContext;
......@@ -436,7 +435,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
@Override
public void exitSchemaExp_Identity(AqlParser.SchemaExp_IdentityContext ctx) {
final SchExpVar<Object, Object, Object, Object, Object>
final SchExpVar<?,?,?,?,?>
sch = new SchExp.SchExpVar<>(ctx.schemaRef().getText());
this.exps.put(ctx,sch);
......@@ -684,23 +683,31 @@ public class AqlLoaderListener extends AqlParserBaseListener {
this.exps.put(ctx,exp);
}
public class MapComposer {
private MapExp<?,?,?,?,?,?,?,?> comp = null;
public MapExp<?,?,?,?,?,?,?,?> result() { return this.comp; }
@SuppressWarnings({ "unchecked", "rawtypes" })
public void compose(final MapExp<?,?,?,?,?,?,?,?> next) {
this.comp = (this.comp == null)
? next
: new MapExp.MapExpComp(next, this.comp);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void combine(final MapComposer other) {
this.comp = new MapExp.MapExpComp(other.comp, this.comp);
}
}
@Override
public void exitMappingExp_Compose(AqlParser.MappingExp_ComposeContext ctx) {
final MapExp<Object, Object, Object, Object, Object, Object, Object, Object>
primary = new MapExp.MapExpVar(ctx.mappingRef(0).getText());
// this.ns.get(ctx.mappingRef(0).getText());
final List<MappingRefContext>
secondary = ctx.mappingRef().subList(1, ctx.mappingRef().size());
final MapExp<Object, Object, Object, Object, Object, Object, Object, Object>
comp = secondary.stream()
.map(ref -> (MapExp<Object, Object, Object, Object, Object, Object, Object, Object>)
new MapExp.MapExpVar(ref.getText()))
// this.ns.get(ref.getText()))
.reduce(
(MapExp<Object, Object, Object, Object, Object, Object, Object, Object>) primary,
(acc, next) -> new MapExp.MapExpComp<>(acc, next));
final MapExp<?,?,?,?,?,?,?,?>
comp = ctx.mappingRef().stream()
.map(ref -> new MapExp.MapExpVar(ref.getText()))
.collect(MapComposer::new,
MapComposer::compose,
MapComposer::combine)
.result();
this.exps.put(ctx,comp);
}
......@@ -893,7 +900,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
options = parseOptions(ctx.queryDeltaEvalSection().allOptions());
final MapExp<?,?,?,?,?,?,?,?>
mapExp = (MapExp<?, ?, ?, ?, ?, ?, ?, ?>) this.exps.get(ctx.mappingKind());
mapExp = (MapExp<?,?,?,?,?,?,?,?>) this.exps.get(ctx.mappingKind());
final QueryExp<?,?,?,?,?,?,?,?>
toQuery = new QueryExp.QueryExpDeltaEval<>(mapExp, options);
......@@ -1142,7 +1149,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
queryKindExp = (QueryExp<?,?,?,?,?,?,?,?>) this.exps.get(queryKind);
final InstExp<?,?,?,?,?,?,?,?,?>
instKindExp = (InstExp<?, ?, ?, ?, ?, ?, ?, ?, ?>) this.exps.get(instKind);
instKindExp = (InstExp<?,?,?,?,?,?,?,?,?>) this.exps.get(instKind);
final List<Pair<String, String>>
options = (instEval == null) ? new LinkedList<>() : parseOptions(instEval.allOptions());
......@@ -1163,7 +1170,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
queryKindExp = (QueryExp<?,?,?,?,?,?,?,?>) this.exps.get(queryKind);
final InstExp<?,?,?,?,?,?,?,?,?>
instKindExp = (InstExp<?, ?, ?, ?, ?, ?, ?, ?, ?>) this.exps.get(instKind);
instKindExp = (InstExp<?,?,?,?,?,?,?,?,?>) this.exps.get(instKind);
final List<Pair<String, String>>
options = parseOptions(instCoeval.allOptions());
......@@ -1360,7 +1367,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
nodes = instSect.instanceColimitNode().stream()
.map(x ->
new Pair<>(makeLocStr(x.instanceRef()),
(InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, ?, ?>)
(InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, ?,?>)
this.exps.get(x.instanceKind())))
.collect(Collectors.toList());
......@@ -1400,7 +1407,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
@SuppressWarnings("unchecked")
final InstExp<Ty,En,Sym,Fk,Att,Gen,Sk,?,?>
instexp = (InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, ?, ?>) this.exps.get(instKind);
instexp = (InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, ?,?>) this.exps.get(instKind);
final List<Pair<Integer, Pair<RawTerm, RawTerm>>>
eqs = instSect.instanceQuotientEqn().stream()
......@@ -1412,7 +1419,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
this.terms.get(eqn.instancePath(1)))))
.collect(Collectors.toList());
final InstExp<?,?,?,?,?, Gen, Sk, ?, ?>
final InstExp<?,?,?,?,?, Gen, Sk, ?,?>
inst = new InstExpQuotient<>(instexp, eqs, options);
this.exps.put(ctx, inst);
......@@ -1497,8 +1504,8 @@ public class AqlLoaderListener extends AqlParserBaseListener {
.map(elt -> makeLocStr(elt))
.collect(Collectors.toList());
final SchExp<?, ?, ?, ?, ?>
schema = (SchExp<?, ?, ?, ?, ?>) this.exps.get(schemaKind);
final SchExp<?,?,?,?,?>
schema = (SchExp<?,?,?,?,?>) this.exps.get(schemaKind);
final List<Pair<LocStr, String>>
gens = ctx_lit.instanceLiteralGen().stream()
......@@ -1641,34 +1648,43 @@ public class AqlLoaderListener extends AqlParserBaseListener {
@Override
public void exitTransformExp_Compose(AqlParser.TransformExp_ComposeContext ctx) {
final TransExp<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object>
primary = new TransExp.TransExpVar(ctx.transformRef(0).getText());
// this.ns.get(ctx.mappingRef(0).getText());
final List<TransformRefContext>
secondary = ctx.transformRef().subList(1, ctx.transformRef().size());
final TransExp<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object>
comp = secondary.stream()
.map(ref -> (TransExp<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object>)
new TransExp.TransExpVar(ref.getText()))
// this.ns.get(ref.getText()))
.reduce(
(TransExp<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object>) primary,
(acc, next) ->
new TransExpCompose<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object>
(acc, next));
final List<TransformRefContext> refs = ctx.transformRef();
@SuppressWarnings("rawtypes")
final List<TransExp>
refexp = refs.stream()
.map(ref -> new TransExp.TransExpVar(ref.getText()))
.collect(Collectors.toList());
@SuppressWarnings({ "unchecked", "rawtypes" })
final TransExp comp = new TransExpCompose<>(refexp.get(0), refexp.get(1));
this.exps.put(ctx,comp);
}
@Override public void exitTransformExp_Destination(AqlParser.TransformExp_DestinationContext ctx) { }
@Override public void exitTransformExp_Distinct(AqlParser.TransformExp_DistinctContext ctx) {
final TransformRefContext ref = ctx.transformRef();
@SuppressWarnings("rawtypes")
final TransExp
transRaw = new TransExp.TransExpVar(ref.getText());
@SuppressWarnings({ "rawtypes", "unchecked" })
final TransExp trans = new TransExp.TransExpDistinct(transRaw);
this.exps.put(ctx,trans);
}
@Override public void exitTransformExp_Delta(AqlParser.TransformExp_DeltaContext ctx) { }
@Override public void exitTransformExp_Delta(AqlParser.TransformExp_DeltaContext ctx) {
}
@Override public void exitTransformExp_Sigma(AqlParser.TransformExp_SigmaContext ctx) { }
@Override public void exitTransformExp_Eval(AqlParser.TransformExp_EvalContext ctx) { }
@Override public void exitTransformExp_Eval(AqlParser.TransformExp_EvalContext ctx) {
}
@Override public void exitTransformExp_Coeval(AqlParser.TransformExp_CoevalContext ctx) { }
......
......@@ -72,6 +72,7 @@ public abstract class ColimSchExp<N> extends Exp<ColimitSchema<N>> {
@SuppressWarnings("unchecked")
public ColimSchExpQuotient(TyExp<Ty, Sym> ty, List<LocStr> nodes, List<Pair<Integer, Quad<String, String, String, String>>> eqEn, List<Pair<Integer, Quad<String, String, RawTerm, RawTerm>>> eqTerms, List<Pair<Integer, Pair<List<String>, List<String>>>> eqTerms2, List<Pair<String, String>> options) {
this.ty = ty;
this.nodes = new Ctx<>();
......@@ -318,6 +319,7 @@ public abstract class ColimSchExp<N> extends Exp<ColimitSchema<N>> {
return false;
if (getClass() != obj.getClass())
return false;
@SuppressWarnings("rawtypes")
ColimSchExpVar other = (ColimSchExpVar) obj;
return var.equals(other.var);
}
......@@ -472,6 +474,7 @@ public abstract class ColimSchExp<N> extends Exp<ColimitSchema<N>> {
return nodes.get(n);
}
@SuppressWarnings("unchecked")
public ColimSchExpRaw(GraphExp<N, E> shape, TyExp<Ty, Sym> ty, List<Pair<LocStr, SchExp<Ty, En, Sym, Fk, Att>>> nodes, List<Pair<LocStr, MapExp<Ty, En, Sym, Fk, Att, En, Fk, Att>>> edges, List<Pair<String, String>> options) {
this.shape = shape;
this.ty = ty;
......
......@@ -488,7 +488,7 @@ public class CombinatorParser implements IAqlParser {
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({ "unchecked" })
private static Parser<InstExpCsv> instExpCsv() {
Parser<catdata.Pair<List<catdata.Pair<LocStr, String>>, List<catdata.Pair<String, String>>>> b = Parsers
.tuple(token("{"), env(ident, "->"), options, token("}")).map(x -> new catdata.Pair<>(x.b, x.c));
......@@ -714,6 +714,7 @@ public class CombinatorParser implements IAqlParser {
l = Parsers.tuple(token("literal"), token(":"), ty_ref.lazy(), token("{")); // .map(x -> x.c);
// needs tyexp
@SuppressWarnings("unchecked")
Parser<SchExpRaw>
ret = Parsers.tuple(l, pa, pb, token("}"))
.map(x -> new SchExpRaw((TyExp<Ty, Sym>) x.a.c, x.b.a, Util.newIfNull(x.b.b), Util.newIfNull(x.b.c),
......@@ -883,6 +884,7 @@ public class CombinatorParser implements IAqlParser {
Parser<Tuple3<Token, InstExp<?, ?, ?, ?, ?, ?, ?, ?, ?>, Token>>
l = Parsers.tuple(token("quotient"), inst_ref.lazy(), token("{")); // .map(x -> x.c);
@SuppressWarnings({ "unchecked", "rawtypes" })
Parser<InstExpQuotient<?, ?>> ret = Parsers.tuple(l, pa, token("}")).map(x -> new InstExpQuotient(x.a.b,
new LinkedList<>(Util.append(Util.newIfNull(x.b.a), Util.newIfNull(x.b.b))), x.b.c));
......@@ -1015,6 +1017,7 @@ public class CombinatorParser implements IAqlParser {
* }
*/
private static void queryExp() {
@SuppressWarnings({ "rawtypes", "unchecked" })
Parser<QueryExp<?, ?, ?, ?, ?, ?, ?, ?>> var = ident.map(QueryExpVar::new),
deltaQueryEval = Parsers
.tuple(token("toQuery"), map_ref.lazy(), options.between(token("{"), token("}")).optional())
......@@ -1185,12 +1188,10 @@ public class CombinatorParser implements IAqlParser {
return ret;
}
@SuppressWarnings("rawtypes")
private static Parser<InstExpJdbc> instExpJdbc() {
Parser<Pair<List<catdata.Pair<LocStr, String>>, List<catdata.Pair<String, String>>>>
qs = Parsers.tuple(env(ident, "->"), options).between(token("{"), token("}"));
@SuppressWarnings("unchecked")
Parser<InstExpJdbc>
ret = Parsers
.tuple(token("import_jdbc"), ident, ident.followedBy(token(":")), sch_ref.lazy(), qs)
......@@ -1235,9 +1236,9 @@ public class CombinatorParser implements IAqlParser {
// List<Pair<LocStr, Triple<String, List<Pair<LocStr, List<String>>>,
// List<Pair<LocStr, Triple<String, String, RawTerm>>>>>> list,
Parser<List<catdata.Pair<LocStr, String>>>
ens = Parsers.tuple(token("entities"), env(ident, "->"))
.map(x -> x.b);
// Parser<List<catdata.Pair<LocStr, String>>>
// ens = Parsers.tuple(token("entities"), env(ident, "->"))
// .map(x -> x.b);
Parser<Tuple3<List<LocStr>, List<catdata.Pair<LocStr, Triple<String, List<catdata.Pair<LocStr, List<String>>>, List<catdata.Pair<LocStr, Triple<String, String, RawTerm>>>>>>, List<catdata.Pair<String, String>>>>
pa = Parsers.tuple(imports, Parsers
......@@ -1258,7 +1259,6 @@ public class CombinatorParser implements IAqlParser {
return ret;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private static Parser<ColimSchExpModify<?>> colimExpModify() {
Parser<List<catdata.Pair<LocStr, String>>>
ens = Parsers.tuple(token("rename").followedBy(token("entities")), env(ident, "->")).map(x -> x.b);
......
......@@ -72,6 +72,7 @@ public class EasikAql {
//////////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("hiding")
private static <Ty,En,Sym,Fk,Att> String aqlToEasik(String name, Schema<Ty,En,Sym,Fk,Att> schema, int x, int y, int len, Set<String> warnings) {
String pre = "\n<easketch cascade=\"cascade\" name=\"" + name + "\" partial-cascade=\"set_null\" x=\"" + x + "\" y=\"" + y + "\">"
+ "\n<header>"
......@@ -134,11 +135,13 @@ public class EasikAql {
return pre + str;
}
@SuppressWarnings("hiding")
private static <Ty,En,Sym,Fk,Att> String aqlTypeToString(Schema<Ty,En,Sym,Fk,Att> schema, Ty t) {
String s = schema.typeSide.js.java_tys.containsKey(t) ? schema.typeSide.js.java_tys.get(t) : "";
return easikTypeFor(s);
}
@SuppressWarnings("hiding")
private static <Ty,En,Sym,Fk,Att> String aqlToEasik(Schema<Ty,En,Sym,Fk,Att> schema, Pair<Var, En> p, Term<Ty, En, Sym, Fk, Att, Void, Void> term) {
String str = "\n<path codomain=\"" + schema.type(p, term).r + "\" domain=\"" + p.second +"\">";
List<String> l = new LinkedList<>();
......@@ -157,6 +160,7 @@ public class EasikAql {
return s.replace(" ", "_").replace("-", "_").replace(".", "_").replaceAll("/", "_");
}
@SuppressWarnings("rawtypes")
private static Pair<SchExp<?, ?, ?, ?, ?>,List<Pair<String,EdsExpRaw>>> translate1(Node sketch, Set<String> used, Set<String> warnings, String sname) {
List<String> ens = new LinkedList<>();
List<Pair<String, Pair<String, Ty>>> atts = new LinkedList<>();
......@@ -595,6 +599,7 @@ public class EasikAql {
return new TyExpRaw(new LinkedList<>(), new LinkedList<>(), new LinkedList<>(), new LinkedList<>(), java_tys, java_parsers, new LinkedList<>(), new LinkedList<>());
} */
@SuppressWarnings("rawtypes")
public static String easikToAql(String in) {
String ret = "";
Set<String> tys = new HashSet<>();
......
......@@ -252,9 +252,11 @@ public abstract class InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, X, Y>
return true;
}
@SuppressWarnings("unchecked")
@Override
public SchExp<Ty, En, Sym, Fk, Att> type(AqlTyping G) {
for (String x : Is) {