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

frozen takes a SchExpRaw.En

parent 134cb1c2
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/6y7/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-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/6y7/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
......@@ -4265,25 +4265,49 @@ public class AqlParser extends Parser {
}
 
public static class TypesideImportContext extends ParserRuleContext {
public TerminalNode SQL() { return getToken(AqlParser.SQL, 0); }
public TypesideRefContext typesideRef() {
return getRuleContext(TypesideRefContext.class,0);
}
public TypesideImportContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typesideImport; }
public TypesideImportContext() { }
public void copyFrom(TypesideImportContext ctx) {
super.copyFrom(ctx);
}
}
public static class TypesideImport_RefContext extends TypesideImportContext {
public TypesideRefContext typesideRef() {
return getRuleContext(TypesideRefContext.class,0);
}
public TypesideImport_RefContext(TypesideImportContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).enterTypesideImport_Ref(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).exitTypesideImport_Ref(this);
}
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof AqlParserVisitor ) return ((AqlParserVisitor<? extends T>)visitor).visitTypesideImport_Ref(this);
else return visitor.visitChildren(this);
}
}
public static class TypesideImport_SqlContext extends TypesideImportContext {
public TerminalNode SQL() { return getToken(AqlParser.SQL, 0); }
public TypesideImport_SqlContext(TypesideImportContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).enterTypesideImport(this);
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).enterTypesideImport_Sql(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).exitTypesideImport(this);
if ( listener instanceof AqlParserListener ) ((AqlParserListener)listener).exitTypesideImport_Sql(this);
}
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof AqlParserVisitor ) return ((AqlParserVisitor<? extends T>)visitor).visitTypesideImport(this);
if ( visitor instanceof AqlParserVisitor ) return ((AqlParserVisitor<? extends T>)visitor).visitTypesideImport_Sql(this);
else return visitor.visitChildren(this);
}
}
......@@ -4296,6 +4320,7 @@ public class AqlParser extends Parser {
_errHandler.sync(this);
switch (_input.LA(1)) {
case SQL:
_localctx = new TypesideImport_SqlContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(892);
......@@ -4305,6 +4330,7 @@ public class AqlParser extends Parser {
case UPPER_ID:
case LOWER_ID:
case SPECIAL_ID:
_localctx = new TypesideImport_RefContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(893);
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/6y7/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.ParserRuleContext;
......@@ -808,13 +808,25 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterTypesideImport(AqlParser.TypesideImportContext ctx) { }
@Override public void enterTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitTypesideImport(AqlParser.TypesideImportContext ctx) { }
@Override public void exitTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx) { }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/6y7/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
......@@ -479,7 +479,14 @@ 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 visitTypesideImport(AqlParser.TypesideImportContext ctx) { return visitChildren(ctx); }
@Override public T visitTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/6y7/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
......@@ -704,15 +704,29 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitTypesideLiteralSection(AqlParser.TypesideLiteralSectionContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#typesideImport}.
* Enter a parse tree produced by the {@code TypesideImport_Sql}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
*/
void enterTypesideImport(AqlParser.TypesideImportContext ctx);
void enterTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#typesideImport}.
* Exit a parse tree produced by the {@code TypesideImport_Sql}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
*/
void exitTypesideImport(AqlParser.TypesideImportContext ctx);
void exitTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx);
/**
* Enter a parse tree produced by the {@code TypesideImport_Ref}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
*/
void enterTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx);
/**
* Exit a parse tree produced by the {@code TypesideImport_Ref}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
*/
void exitTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#typesideTypeSig}.
* @param ctx the parse tree
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/6y7/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
......@@ -425,11 +425,19 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitTypesideLiteralSection(AqlParser.TypesideLiteralSectionContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#typesideImport}.
* Visit a parse tree produced by the {@code TypesideImport_Sql}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypesideImport(AqlParser.TypesideImportContext ctx);
T visitTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx);
/**
* Visit a parse tree produced by the {@code TypesideImport_Ref}
* labeled alternative in {@link AqlParser#typesideImport}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#typesideTypeSig}.
* @param ctx the parse tree
......
......@@ -39,7 +39,10 @@ typesideLiteralSection
allOptions
;
typesideImport : SQL | typesideRef ;
typesideImport
: SQL # TypesideImport_Sql
| typesideRef # TypesideImport_Ref
;
typesideTypeSig : typesideTypeId ;
typesideJavaTypeSig : typesideTypeId EQUAL typesideJavaType ;
......
......@@ -404,7 +404,7 @@ public class AqlLoaderListener extends AqlParserBaseListener {
.map(elt ->
new Pair<Integer,TyExp<?,?>>(
getLoc(elt),
(TyExp<?, ?>) this.exps.get(elt)))
(TyExp<?,?>) this.exps.get(elt)))
.collect(Collectors.toList());
final List<LocStr>
......@@ -499,6 +499,14 @@ public class AqlLoaderListener extends AqlParserBaseListener {
this.exps.put(ctx,typeside);
};
@Override public void exitTypesideImport_Ref(AqlParser.TypesideImport_RefContext ctx) {
this.exps.put(ctx, new TyExp.TyExpVar<>(ctx.typesideRef().getText()));
}
@Override public void exitTypesideImport_Sql(AqlParser.TypesideImport_SqlContext ctx) {
this.exps.put(ctx, new TyExpSql());
}
@Override public void exitTypesideEval_Number(AqlParser.TypesideEval_NumberContext ctx) {
final RawTerm term = new RawTerm(ctx.NUMBER().getText());
......@@ -1635,15 +1643,14 @@ public class AqlLoaderListener extends AqlParserBaseListener {
}
@Override public void exitInstanceExp_Frozen(AqlParser.InstanceExp_FrozenContext ctx) {
final QueryExp<?,?,?,?,?,?,?,?>
queryExp = (QueryExp<?,?,?,?,?,?,?,?>) this.exps.get(ctx.queryKind());
@SuppressWarnings("unchecked")
final QueryExp<Ty, En, Sym, Fk, Att, En, Fk, Att>
queryExp = (QueryExp<Ty, En, Sym, Fk, Att, En, Fk, Att>) this.exps.get(ctx.queryKind());
final SchExp<?, ?, ?, ?, ?>
schemaExp = (SchExp<?, ?, ?, ?, ?>) this.exps.get(ctx.schemaKind());
final SchExpRaw.En schEn = new SchExpRaw.En(ctx.schemaKind().getText());
@SuppressWarnings({ "rawtypes", "unchecked" })
final InstExpFrozen
inst = new InstExpFrozen(queryExp, schemaExp);
final InstExpFrozen<Ty, En, Sym, Fk, Att, En, Fk, Att>
inst = new InstExpFrozen<>(queryExp, schEn);
this.exps.put(ctx, inst);
}
......
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