Commit cecc835f authored by Fred Eisele's avatar Fred Eisele
Browse files

instance quotient working

parent caa6df29
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/ib4/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
......
This diff is collapsed.
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/ib4/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.ParserRuleContext;
......@@ -1756,61 +1756,61 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { }
@Override public void enterInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { }
@Override public void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { }
@Override public void enterInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { }
@Override public void exitInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { }
@Override public void enterInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { }
@Override public void exitInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { }
@Override public void enterInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { }
@Override public void exitInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { }
@Override public void enterInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { }
@Override public void exitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { }
/**
* {@inheritDoc}
*
......@@ -2279,6 +2279,18 @@ public class AqlParserBaseListener implements AqlParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceQuotientSection(AqlParser.InstanceQuotientSectionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx) { }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/ib4/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
......@@ -1032,35 +1032,35 @@ 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 visitInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { return visitChildren(ctx); }
@Override public T visitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { return visitChildren(ctx); }
@Override public T visitInstanceExp_QuotientJdbc(AqlParser.InstanceExp_QuotientJdbcContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { return visitChildren(ctx); }
@Override public T visitInstanceExp_QuotientCsv(AqlParser.InstanceExp_QuotientCsvContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { return visitChildren(ctx); }
@Override public T visitInstanceExp_ImportJdbcAll(AqlParser.InstanceExp_ImportJdbcAllContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { return visitChildren(ctx); }
@Override public T visitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......@@ -1334,6 +1334,13 @@ public class AqlParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impleme
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceQuotientSection(AqlParser.InstanceQuotientSectionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/ib4/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
......@@ -1581,6 +1581,18 @@ public interface AqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitInstanceExp_ImportJdbc(AqlParser.InstanceExp_ImportJdbcContext ctx);
/**
* Enter a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
*/
void enterInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Exit a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
*/
void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Enter a parse tree produced by the {@code InstanceExp_QuotientJdbc}
* labeled alternative in {@link AqlParser#instanceExp}.
......@@ -1629,18 +1641,6 @@ public interface AqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx);
/**
* Enter a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
*/
void enterInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Exit a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
*/
void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Enter a parse tree produced by the {@code InstanceExp_Chase}
* labeled alternative in {@link AqlParser#instanceExp}.
......@@ -2059,6 +2059,16 @@ public interface AqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitInstanceQuotientSection(AqlParser.InstanceQuotientSectionContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#instanceQuotientEqn}.
* @param ctx the parse tree
*/
void enterInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#instanceQuotientEqn}.
* @param ctx the parse tree
*/
void exitInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#instanceChaseSection}.
* @param ctx the parse tree
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/ib4/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/iqs/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
......@@ -942,6 +942,13 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitInstanceExp_ImportJdbc(AqlParser.InstanceExp_ImportJdbcContext ctx);
/**
* Visit a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Visit a parse tree produced by the {@code InstanceExp_QuotientJdbc}
* labeled alternative in {@link AqlParser#instanceExp}.
......@@ -970,13 +977,6 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx);
/**
* Visit a parse tree produced by the {@code InstanceExp_Quotient}
* labeled alternative in {@link AqlParser#instanceExp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx);
/**
* Visit a parse tree produced by the {@code InstanceExp_Chase}
* labeled alternative in {@link AqlParser#instanceExp}.
......@@ -1225,6 +1225,12 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitInstanceQuotientSection(AqlParser.InstanceQuotientSectionContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#instanceQuotientEqn}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInstanceQuotientEqn(AqlParser.InstanceQuotientEqnContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#instanceChaseSection}.
* @param ctx the parse tree
......
......@@ -61,6 +61,10 @@ instanceExp
| IMPORT_JDBC jdbcClass jdbcUri COLON schemaKind
(LBRACE instanceImportJdbcSection RBRACE)?
# InstanceExp_ImportJdbc
| QUOTIENT instanceKind
(LBRACE instanceQuotientSection RBRACE)?
# InstanceExp_Quotient
| QUOTIENT_JDBC (jdbcClass (jdbcUri)?)? instanceKind
(LBRACE instanceQuotientJdbcSection RBRACE)?
......@@ -78,10 +82,6 @@ instanceExp
(LBRACE instanceImportCsvSection RBRACE)?
# InstanceExp_ImportCsv
| QUOTIENT instanceRef
(LBRACE instanceQuotientSection RBRACE)?
# InstanceExp_Quotient
| CHASE constraintKind instanceKind INTEGER?
(LBRACE instanceChaseSection RBRACE)?
# InstanceExp_Chase
......@@ -199,10 +199,12 @@ instanceQuotientJdbcSection
;
instanceQuotientSection
: EQUATIONS (instancePath EQUAL instancePath)*
: EQUATIONS instanceQuotientEqn*
allOptions
;
instanceQuotientEqn : instancePath EQUAL instancePath ;
instanceChaseSection : allOptions ;
instanceRandomSection
......
......@@ -47,14 +47,12 @@ import catdata.aql.grammar.AqlParser.InstanceCoProdUnrestrictSectionContext;
import catdata.aql.grammar.AqlParser.InstanceCoequalizeSectionContext;
import catdata.aql.grammar.AqlParser.InstanceCoevalSectionContext;
import catdata.aql.grammar.AqlParser.InstanceColimitSectionContext;
import catdata.aql.grammar.AqlParser.InstanceEquationIdContext;
import catdata.aql.grammar.AqlParser.InstanceEvalSectionContext;
import catdata.aql.grammar.AqlParser.InstanceKindContext;
import catdata.aql.grammar.AqlParser.InstanceLiteralSectionContext;
import catdata.aql.grammar.AqlParser.InstanceLiteralValueContext;
import catdata.aql.grammar.AqlParser.InstanceQuotientSectionContext;
import catdata.aql.grammar.AqlParser.InstanceRefContext;
import catdata.aql.grammar.AqlParser.InstanceSigmaSectionContext;
import catdata.aql.grammar.AqlParser.InstanceSymbolContext;
import catdata.aql.grammar.AqlParser.MappingGenContext;
import catdata.aql.grammar.AqlParser.MappingKindContext;
import catdata.aql.grammar.AqlParser.MappingLiteralSectionContext;
......@@ -1393,7 +1391,32 @@ public class AqlLoaderListener extends AqlParserBaseListener {
@Override public void exitInstanceExp_ImportCsv(AqlParser.InstanceExp_ImportCsvContext ctx) { }
@Override public void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) { }
@Override public void exitInstanceExp_Quotient(AqlParser.InstanceExp_QuotientContext ctx) {
final InstanceKindContext instKind = ctx.instanceKind();
final InstanceQuotientSectionContext instSect = ctx.instanceQuotientSection();
final List<Pair<String, String>>
options = (instSect == null) ? new LinkedList<>() : parseOptions(instSect.allOptions());
@SuppressWarnings("unchecked")
final InstExp<Ty,En,Sym,Fk,Att,Gen,Sk,?,?>
instexp = (InstExp<Ty, En, Sym, Fk, Att, Gen, Sk, ?, ?>) this.exps.get(instKind);
final List<Pair<Integer, Pair<RawTerm, RawTerm>>>
eqs = instSect.instanceQuotientEqn().stream()
.map(eqn ->
new Pair<>(
getLoc(eqn),
new Pair<>(
this.terms.get(eqn.instancePath(0)),
this.terms.get(eqn.instancePath(1)))))
.collect(Collectors.toList());
final InstExp<?,?,?,?,?, Gen, Sk, ?, ?>
inst = new InstExpQuotient<>(instexp, eqs, options);
this.exps.put(ctx, inst);
}
@Override public void exitInstanceExp_Chase(AqlParser.InstanceExp_ChaseContext ctx) {
final ConstraintKindContext constraintKind = ctx.constraintKind();
......@@ -1558,7 +1581,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
@Override public void exitInstanceLiteral(AqlParser.InstanceLiteralContext ctx) {
final String value = ctx.instanceLiteralValue().getText();
final InstanceSymbolContext symbol = ctx.instanceSymbol();
// final InstanceSymbolContext symbol = ctx.instanceSymbol();
final RawTerm term = new RawTerm(value);
this.terms.put(ctx, term);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment