Commit 090eb957 authored by Fred Eisele's avatar Fred Eisele
Browse files

Handler for Schema [checkpoint]

parent 2100b5f2
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/7wu/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/mpv/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
......@@ -47,7 +47,7 @@ public class AqlLexerRules extends Lexer {
EXPORT_CSV_TRANSFORM=124, EXPORT_JDBC_INSTANCE=125, EXPORT_JDBC_QUERY=126,
EXPORT_JDBC_TRANSFORM=127, ADD_TO_CLASSPATH=128, QUERY=129, SIMPLE=130,
GET_MAPPING=131, FROM=132, RETURN=133, TO_QUERY=134, TO_COQUERY=135, SCHEMA=136,
SCHEMA_OF=137, GET_SCHEMA=138, INSTANCE_ALL=139, SCHEMA_COLIMIT=140, MODIFY=141,
SCHEMA_OF=137, GET_SCHEMA=138, IMPORT_ALL=139, SCHEMA_COLIMIT=140, MODIFY=141,
WRAP=142, ENTITY_EQUATIONS=143, PATH_EQUATIONS=144, OBSERVATION_EQUATIONS=145,
RENAME=146, REMOVE=147, TRANSFORM=148, UNIT=149, COUNIT=150, UNIT_QUERY=151,
COUNIT_QUERY=152, TYPESIDE=153, SQL=154, TYPESIDE_OF=155, TYPES=156, CONSTANTS=157,
......@@ -102,9 +102,9 @@ public class AqlLexerRules extends Lexer {
"EXPORT_CSV_INSTANCE", "EXPORT_CSV_TRANSFORM", "EXPORT_JDBC_INSTANCE",
"EXPORT_JDBC_QUERY", "EXPORT_JDBC_TRANSFORM", "ADD_TO_CLASSPATH", "QUERY",
"SIMPLE", "GET_MAPPING", "FROM", "RETURN", "TO_QUERY", "TO_COQUERY", "SCHEMA",
"SCHEMA_OF", "GET_SCHEMA", "INSTANCE_ALL", "SCHEMA_COLIMIT", "MODIFY",
"WRAP", "ENTITY_EQUATIONS", "PATH_EQUATIONS", "OBSERVATION_EQUATIONS",
"RENAME", "REMOVE", "TRANSFORM", "UNIT", "COUNIT", "UNIT_QUERY", "COUNIT_QUERY",
"SCHEMA_OF", "GET_SCHEMA", "IMPORT_ALL", "SCHEMA_COLIMIT", "MODIFY", "WRAP",
"ENTITY_EQUATIONS", "PATH_EQUATIONS", "OBSERVATION_EQUATIONS", "RENAME",
"REMOVE", "TRANSFORM", "UNIT", "COUNIT", "UNIT_QUERY", "COUNIT_QUERY",
"TYPESIDE", "SQL", "TYPESIDE_OF", "TYPES", "CONSTANTS", "FUNCTIONS", "JAVA_TYPES",
"JAVA_CONSTANTS", "JAVA_FUNCTIONS", "CONSTRAINTS", "COLON", "COLON_COLON",
"COMMA", "SEMI", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK",
......@@ -189,9 +189,9 @@ public class AqlLexerRules extends Lexer {
"EXPORT_CSV_INSTANCE", "EXPORT_CSV_TRANSFORM", "EXPORT_JDBC_INSTANCE",
"EXPORT_JDBC_QUERY", "EXPORT_JDBC_TRANSFORM", "ADD_TO_CLASSPATH", "QUERY",
"SIMPLE", "GET_MAPPING", "FROM", "RETURN", "TO_QUERY", "TO_COQUERY", "SCHEMA",
"SCHEMA_OF", "GET_SCHEMA", "INSTANCE_ALL", "SCHEMA_COLIMIT", "MODIFY",
"WRAP", "ENTITY_EQUATIONS", "PATH_EQUATIONS", "OBSERVATION_EQUATIONS",
"RENAME", "REMOVE", "TRANSFORM", "UNIT", "COUNIT", "UNIT_QUERY", "COUNIT_QUERY",
"SCHEMA_OF", "GET_SCHEMA", "IMPORT_ALL", "SCHEMA_COLIMIT", "MODIFY", "WRAP",
"ENTITY_EQUATIONS", "PATH_EQUATIONS", "OBSERVATION_EQUATIONS", "RENAME",
"REMOVE", "TRANSFORM", "UNIT", "COUNIT", "UNIT_QUERY", "COUNIT_QUERY",
"TYPESIDE", "SQL", "TYPESIDE_OF", "TYPES", "CONSTANTS", "FUNCTIONS", "JAVA_TYPES",
"JAVA_CONSTANTS", "JAVA_FUNCTIONS", "CONSTRAINTS", "COLON", "COLON_COLON",
"COMMA", "SEMI", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK",
......
This diff is collapsed.
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/7wu/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/mpv/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.ParserRuleContext;
......@@ -1096,13 +1096,13 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx) { }
@Override public void enterSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx) { }
@Override public void exitSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx) { }
/**
* {@inheritDoc}
*
......@@ -1132,25 +1132,25 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchema_Literal(AqlParser.Schema_LiteralContext ctx) { }
@Override public void enterSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchema_Literal(AqlParser.Schema_LiteralContext ctx) { }
@Override public void exitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { }
@Override public void enterSchema_Literal(AqlParser.Schema_LiteralContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { }
@Override public void exitSchema_Literal(AqlParser.Schema_LiteralContext ctx) { }
/**
* {@inheritDoc}
*
......@@ -1228,25 +1228,49 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx) { }
@Override public void enterSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx) { }
@Override public void exitSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchemaPath(AqlParser.SchemaPathContext ctx) { }
@Override public void enterSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaPath(AqlParser.SchemaPathContext ctx) { }
@Override public void exitSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx) { }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/7wu/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/mpv/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
......@@ -647,7 +647,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 visitSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx) { return visitChildren(ctx); }
@Override public T visitSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......@@ -668,14 +668,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 visitSchema_Literal(AqlParser.Schema_LiteralContext ctx) { return visitChildren(ctx); }
@Override public T visitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) { return visitChildren(ctx); }
@Override public T visitSchema_Literal(AqlParser.Schema_LiteralContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......@@ -724,14 +724,28 @@ 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 visitSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx) { return visitChildren(ctx); }
@Override public T visitSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaPath(AqlParser.SchemaPathContext ctx) { return visitChildren(ctx); }
@Override public T visitSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/7wu/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/mpv/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
......@@ -954,17 +954,17 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitSchema_Empty(AqlParser.Schema_EmptyContext ctx);
/**
* Enter a parse tree produced by the {@code Schema_OfInstanceAll}
* Enter a parse tree produced by the {@code Schema_OfImportAll}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void enterSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx);
void enterSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx);
/**
* Exit a parse tree produced by the {@code Schema_OfInstanceAll}
* Exit a parse tree produced by the {@code Schema_OfImportAll}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void exitSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx);
void exitSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx);
/**
* Enter a parse tree produced by the {@code Schema_OfInstance}
* labeled alternative in {@link AqlParser#schemaDef}.
......@@ -990,29 +990,29 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitSchema_Destination(AqlParser.Schema_DestinationContext ctx);
/**
* Enter a parse tree produced by the {@code Schema_Literal}
* Enter a parse tree produced by the {@code Schema_GetSchemaColimit}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void enterSchema_Literal(AqlParser.Schema_LiteralContext ctx);
void enterSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
/**
* Exit a parse tree produced by the {@code Schema_Literal}
* Exit a parse tree produced by the {@code Schema_GetSchemaColimit}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void exitSchema_Literal(AqlParser.Schema_LiteralContext ctx);
void exitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
/**
* Enter a parse tree produced by the {@code Schema_GetSchemaColimit}
* Enter a parse tree produced by the {@code Schema_Literal}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void enterSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
void enterSchema_Literal(AqlParser.Schema_LiteralContext ctx);
/**
* Exit a parse tree produced by the {@code Schema_GetSchemaColimit}
* Exit a parse tree produced by the {@code Schema_Literal}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
*/
void exitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
void exitSchema_Literal(AqlParser.Schema_LiteralContext ctx);
/**
* Enter a parse tree produced by the {@code SchemaKind_Ref}
* labeled alternative in {@link AqlParser#schemaKind}.
......@@ -1078,25 +1078,51 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitSchemaForeignSig(AqlParser.SchemaForeignSigContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#schemaPathEquation}.
* Enter a parse tree produced by {@link AqlParser#schemaPathEqnSig}.
* @param ctx the parse tree
*/
void enterSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#schemaPathEqnSig}.
* @param ctx the parse tree
*/
void exitSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx);
/**
* Enter a parse tree produced by the {@code SchemaPath_ArrowId}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void enterSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx);
/**
* Exit a parse tree produced by the {@code SchemaPath_ArrowId}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void exitSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx);
/**
* Enter a parse tree produced by the {@code SchemaPath_Paren}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void enterSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx);
void enterSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#schemaPathEquation}.
* Exit a parse tree produced by the {@code SchemaPath_Paren}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void exitSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx);
void exitSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#schemaPath}.
* Enter a parse tree produced by the {@code SchemaPath_Dot}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void enterSchemaPath(AqlParser.SchemaPathContext ctx);
void enterSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#schemaPath}.
* Exit a parse tree produced by the {@code SchemaPath_Dot}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
*/
void exitSchemaPath(AqlParser.SchemaPathContext ctx);
void exitSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#schemaArrowId}.
* @param ctx the parse tree
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/7wu/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/mpv/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
......@@ -574,12 +574,12 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitSchema_Empty(AqlParser.Schema_EmptyContext ctx);
/**
* Visit a parse tree produced by the {@code Schema_OfInstanceAll}
* Visit a parse tree produced by the {@code Schema_OfImportAll}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchema_OfInstanceAll(AqlParser.Schema_OfInstanceAllContext ctx);
T visitSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx);
/**
* Visit a parse tree produced by the {@code Schema_OfInstance}
* labeled alternative in {@link AqlParser#schemaDef}.
......@@ -595,19 +595,19 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitSchema_Destination(AqlParser.Schema_DestinationContext ctx);
/**
* Visit a parse tree produced by the {@code Schema_Literal}
* Visit a parse tree produced by the {@code Schema_GetSchemaColimit}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchema_Literal(AqlParser.Schema_LiteralContext ctx);
T visitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
/**
* Visit a parse tree produced by the {@code Schema_GetSchemaColimit}
* Visit a parse tree produced by the {@code Schema_Literal}
* labeled alternative in {@link AqlParser#schemaDef}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx);
T visitSchema_Literal(AqlParser.Schema_LiteralContext ctx);
/**
* Visit a parse tree produced by the {@code SchemaKind_Ref}
* labeled alternative in {@link AqlParser#schemaKind}.
......@@ -647,17 +647,32 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitSchemaForeignSig(AqlParser.SchemaForeignSigContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#schemaPathEquation}.
* Visit a parse tree produced by {@link AqlParser#schemaPathEqnSig}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchemaPathEqnSig(AqlParser.SchemaPathEqnSigContext ctx);
/**
* Visit a parse tree produced by the {@code SchemaPath_ArrowId}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchemaPath_ArrowId(AqlParser.SchemaPath_ArrowIdContext ctx);
/**
* Visit a parse tree produced by the {@code SchemaPath_Paren}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchemaPathEquation(AqlParser.SchemaPathEquationContext ctx);
T visitSchemaPath_Paren(AqlParser.SchemaPath_ParenContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#schemaPath}.
* Visit a parse tree produced by the {@code SchemaPath_Dot}
* labeled alternative in {@link AqlParser#schemaPath}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchemaPath(AqlParser.SchemaPathContext ctx);
T visitSchemaPath_Dot(AqlParser.SchemaPath_DotContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#schemaArrowId}.
* @param ctx the parse tree
......
......@@ -242,7 +242,7 @@ TO_COQUERY : 'toCoQuery' ;
SCHEMA : 'schema' ;
SCHEMA_OF : 'schemaOf' ;
GET_SCHEMA : 'getSchema' ;
INSTANCE_ALL : 'import_all' ;
IMPORT_ALL : 'import_all' ;
SCHEMA_COLIMIT : 'schema_colimit' ;
MODIFY : 'modify' ;
......
......@@ -7,13 +7,13 @@ schemaRef : symbol ;
schemaAssignment : SCHEMA schemaId EQUAL schemaDef ;
schemaDef
: EMPTY COLON typesideRef #Schema_Empty
| SCHEMA_OF INSTANCE_ALL #Schema_OfInstanceAll
| SCHEMA_OF instanceKind #Schema_OfInstance
| DST queryRef #Schema_Destination
: EMPTY COLON typesideRef # Schema_Empty
| SCHEMA_OF IMPORT_ALL # Schema_OfImportAll
| SCHEMA_OF instanceKind # Schema_OfInstance
| DST queryRef # Schema_Destination
| GET_SCHEMA schemaColimitRef # Schema_GetSchemaColimit
| LITERAL COLON typesideKind
(LBRACE schemaLiteralSection RBRACE)? #Schema_Literal
| GET_SCHEMA schemaColimitRef #Schema_GetSchemaColimit
(LBRACE schemaLiteralSection RBRACE)? # Schema_Literal
;
schemaKind
......@@ -25,10 +25,10 @@ schemaKind
schemaColimitRef : symbol ;
schemaLiteralSection
: (IMPORTS typesideRef*)?
: (IMPORTS typesideImport*)?
(ENTITIES schemaEntityId*)?
(FOREIGN_KEYS schemaForeignSig*)?
(PATH_EQUATIONS schemaPathEquation*)?
(PATH_EQUATIONS schemaPathEqnSig*)?
(ATTRIBUTES schemaAttributeSig*)?
(OBSERVATION_EQUATIONS schemaObservationEquationSig*)?
allOptions
......@@ -39,12 +39,12 @@ schemaEntityId : symbol ;
schemaForeignSig
: schemaForeignId+ COLON schemaEntityId RARROW schemaEntityId ;
schemaPathEquation : schemaPath EQUAL schemaPath ;
schemaPathEqnSig : schemaPath EQUAL schemaPath ;
schemaPath
: schemaArrowId
| schemaPath DOT schemaArrowId
| schemaArrowId LPAREN schemaPath RPAREN
: schemaArrowId # SchemaPath_ArrowId
| schemaPath DOT schemaArrowId # SchemaPath_Dot
| schemaArrowId LPAREN schemaPath RPAREN # SchemaPath_Paren
;
// identity arrows are indicated with entity-names.
......
......@@ -15,6 +15,7 @@ import org.antlr.v4.runtime.tree.ParseTreeProperty;
import org.antlr.v4.runtime.tree.TerminalNode;
import catdata.Pair;
import catdata.Quad;
import catdata.Triple;
import catdata.aql.RawTerm;
import catdata.aql.exp.GraphExp.GraphExpRaw;
......@@ -27,6 +28,7 @@ import catdata.aql.exp.TyExpRaw.Sym;
import catdata.aql.exp.TyExpRaw.Ty;
import catdata.aql.grammar.AqlParser;
import catdata.aql.grammar.AqlParser.GraphLiteralSectionContext;
import catdata.aql.grammar.AqlParser.SchemaLiteralSectionContext;
import catdata.aql.grammar.AqlParser.TypesideLiteralSectionContext;
import catdata.aql.grammar.AqlParserBaseListener;
......@@ -57,12 +59,14 @@ public class AqlLoaderListener extends AqlParserBaseListener {
}
private final ParseTreeProperty<Pair<String,String>> value_option = new ParseTreeProperty<Pair<String,String>>();
private final ParseTreeProperty<Exp<?>> exps = new ParseTreeProperty<Exp<?>>();
private final ParseTreeProperty<List<String>> strList = new ParseTreeProperty<List<String>>();
public final List<Triple<String, Integer, Exp<?>>> decls;
public final List<Pair<String, String>> global_options;
public Function<Exp<?>, String> kind;
public final Map<String, Exp<?>> ns = new HashMap<String, Exp<?>>();
private String currentRefName;
/**
* Program section
......@@ -322,6 +326,17 @@ public class AqlLoaderListener extends AqlParserBaseListener {
this.exps.put(ctx,exp);
};
@Override
public void exitSchema_OfImportAll(AqlParser.Schema_OfImportAllContext ctx) {
// TODO Ryan, what is intended here?
//@SuppressWarnings("unchecked")
//final Exp<?> exp = new SchExp.SchExpInst<Ty,Sym,En,Fk,Att>(
// (InstExp<Ty,Sym,En,Fk,Att,?,?,?,?>)
// this.exps.get(ctx.IMPORT_ALL()));
//this.exps.put(ctx,exp);
};
@Override
public void exitSchema_OfInstance(AqlParser.Schema_OfInstanceContext ctx) {
@SuppressWarnings("unchecked")
......@@ -330,6 +345,119 @@ public class AqlLoaderListener extends AqlParserBaseListener {
this.exps.get(ctx.instanceKind()));
this.exps.put(ctx,exp);
};
@Override public void exitSchema_Destination(AqlParser.Schema_DestinationContext ctx) {
@SuppressWarnings("unchecked")
final Exp<?> exp = new SchExp.SchExpInst<Ty,Sym,En,Fk,Att>(
(InstExp<Ty,Sym,En,Fk,Att,?,?,?,?>)
this.exps.get(ctx.queryRef()));
this.exps.put(ctx,exp);
}
@Override public void exitSchema_GetSchemaColimit(AqlParser.Schema_GetSchemaColimitContext ctx) {
@SuppressWarnings("unchecked")
final Exp<?> exp = new SchExp.SchExpInst<Ty,Sym,En,Fk,Att>(
(InstExp<Ty,Sym,En,Fk,Att,?,?,?,?>)
this.exps.get(ctx.schemaColimitRef()));
this.exps.put(ctx,exp);
}
@Override public void exitSchema_Literal(AqlParser.Schema_LiteralContext ctx) {
final SchemaLiteralSectionContext
ctx_lit = ctx.schemaLiteralSection();
final TyExp<Ty, Sym>
typeside = new TyExp.TyExpVar<Ty,Sym>(ctx.typesideKind().getText());
final List<LocStr>
imports = ctx_lit.typesideImport().stream()
.map(ty -> makeLocStr(ty))
.collect(Collectors.toList());
final List<LocStr>
entities = ctx_lit.schemaEntityId().stream()
.map(elt -> makeLocStr(elt))
.collect(Collectors.toList());
final List<Pair<LocStr, Pair<String, String>>>
arrows = ctx_lit.schemaForeignSig().stream()
.map(fk -> {
final Pair<String,String> arrow = new Pair<String,String>(
fk.schemaEntityId(0).getText(),
fk.schemaEntityId(1).getText());
return new LinkedList<Pair<LocStr, Pair<String,String>>>(
fk.schemaForeignId().stream()
.map(fkid -> new Pair<LocStr,Pair<String,String>>
(makeLocStr(fkid), arrow))
.collect(Collectors.toList()));
})
.flatMap(x -> x.stream())
.collect(Collectors.toList());
final List<Pair<Integer, Pair<List<String>, List<String>>>>
commutes = ctx_lit.schemaPathEqnSig().stream()
.map(eq -> new Pair<Integer, Pair<List<String>, List<String>>>(
eq.getStart().getStartIndex(),
new Pair<List<String>, List<String>>(
this.strList.get(eq.schemaPath(0)),
this.strList.get(eq.schemaPath(0)))))
.collect(Collectors.toList());
final List<Pair<LocStr, Pair<String, String>>>
attrs = ctx_lit.schemaAttributeSig().stream()
.map(att -> {
final Pair<String,String> arrow = new Pair<String,String>(
att.schemaEntityId().getText(),
att.typesideTypeId().getText());
return new LinkedList<Pair<LocStr, Pair<String,String>>>(
att.schemaAttributeId().stream()
.map(attid -> new Pair<LocStr,Pair<String,String>>
(makeLocStr(attid), arrow))