public class org.finos.legend.engine.postgres.TableNameExtractor extends org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParserBaseVisitor
{
private final java.lang.Boolean extractTables;
private final java.lang.Boolean extractTableFunctions;
public void <init>()
{
java.lang.Boolean v, v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: void <init>(java.lang.Boolean,java.lang.Boolean)>(v, v);
return;
}
public void <init>(java.lang.Boolean, java.lang.Boolean)
{
java.lang.Boolean v, v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: java.lang.Boolean;
v := @parameter: java.lang.Boolean;
specialinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParserBaseVisitor: void <init>()>();
v.<org.finos.legend.engine.postgres.TableNameExtractor: java.lang.Boolean extractTables> = v;
v.<org.finos.legend.engine.postgres.TableNameExtractor: java.lang.Boolean extractTableFunctions> = v;
return;
}
public java.util.List visitTableName(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableNameContext)
{
org.finos.legend.engine.protocol.sql.metamodel.QualifiedName v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableNameContext v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext v;
org.finos.legend.engine.postgres.TableNameExtractor v;
java.lang.Boolean v;
org.eclipse.collections.api.list.FixedSizeList v;
org.eclipse.collections.api.factory.list.FixedSizeListFactory v, v;
boolean v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableNameContext;
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableNameContext: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext qname()>();
v = specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: org.finos.legend.engine.protocol.sql.metamodel.QualifiedName getQualifiedName(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext)>(v);
v = v.<org.finos.legend.engine.postgres.TableNameExtractor: java.lang.Boolean extractTables>;
v = virtualinvoke v.<java.lang.Boolean: boolean booleanValue()>();
if v == 0 goto label;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList 'with'(java.lang.Object)>(v);
goto label;
label:
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList empty()>();
label:
return v;
}
public java.util.List visitTableFunction(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableFunctionContext)
{
org.finos.legend.engine.protocol.sql.metamodel.QualifiedName v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableFunctionContext v;
org.finos.legend.engine.postgres.TableNameExtractor v;
java.lang.Boolean v;
org.eclipse.collections.api.list.FixedSizeList v;
org.eclipse.collections.api.factory.list.FixedSizeListFactory v, v;
boolean v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableFunctionContext;
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$TableFunctionContext: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext qname()>();
v = specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: org.finos.legend.engine.protocol.sql.metamodel.QualifiedName getQualifiedName(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext)>(v);
v = v.<org.finos.legend.engine.postgres.TableNameExtractor: java.lang.Boolean extractTableFunctions>;
v = virtualinvoke v.<java.lang.Boolean: boolean booleanValue()>();
if v == 0 goto label;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList 'with'(java.lang.Object)>(v);
goto label;
label:
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList empty()>();
label:
return v;
}
protected java.util.List aggregateResult(java.util.List, java.util.List)
{
java.util.List v, v;
java.lang.Object v;
org.eclipse.collections.api.factory.list.FixedSizeListFactory v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: java.util.List;
v := @parameter: java.util.List;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList empty()>();
if v == null goto label;
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
label:
if v == null goto label;
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
label:
return v;
}
private java.util.List visitIdentifier(org.antlr.v.runtime.tree.ParseTree)
{
org.finos.legend.engine.postgres.TableNameExtractor v;
int v, v;
org.antlr.v.runtime.tree.ParseTree v;
java.lang.String v, v, v, v;
org.eclipse.collections.api.list.FixedSizeList v, v, v;
boolean v, v;
org.eclipse.collections.api.factory.list.FixedSizeListFactory v, v, v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.antlr.v.runtime.tree.ParseTree;
v = v instanceof org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$UnquotedIdentifierContext;
if v == 0 goto label;
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$UnquotedIdentifierContext: java.lang.String getText()>();
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList 'with'(java.lang.Object)>(v);
return v;
label:
v = v instanceof org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QuotedIdentifierContext;
if v == 0 goto label;
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QuotedIdentifierContext: java.lang.String getText()>();
v = virtualinvoke v.<java.lang.String: int length()>();
v = v - 1;
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int,int)>(1, v);
v = virtualinvoke v.<java.lang.String: java.lang.String replace(java.lang.CharSequence,java.lang.CharSequence)>("\"\"", "\"");
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList 'with'(java.lang.Object)>(v);
return v;
label:
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList empty()>();
return v;
}
private java.util.List visitIdentifier(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext)
{
org.finos.legend.engine.postgres.TableNameExtractor v;
java.util.List v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext v;
int v, v;
java.lang.Object v;
org.antlr.v.runtime.tree.ParseTree v;
org.eclipse.collections.api.list.FixedSizeList v;
org.eclipse.collections.api.factory.list.FixedSizeListFactory v, v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList empty()>();
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext: int getChildCount()>();
v = 0;
label:
if v >= v goto label;
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext: org.antlr.v.runtime.tree.ParseTree getChild(int)>(v);
v = specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: java.util.List visitIdentifier(org.antlr.v.runtime.tree.ParseTree)>(v);
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.FixedSizeListFactory fixedSize>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.FixedSizeListFactory: org.eclipse.collections.api.list.FixedSizeList withAll(java.lang.Iterable)>(v);
v = interfaceinvoke v.<org.eclipse.collections.api.list.FixedSizeList: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
v = v + 1;
goto label;
label:
return v;
}
public java.util.List getIdentText(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext)
{
java.util.List v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext;
if v == null goto label;
v = specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: java.util.List visitIdentifier(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$IdentContext)>(v);
return v;
label:
return null;
}
private org.finos.legend.engine.protocol.sql.metamodel.QualifiedName getQualifiedName(org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext)
{
java.util.List v, v;
org.finos.legend.engine.protocol.sql.metamodel.QualifiedName v;
org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext;
v = new org.finos.legend.engine.protocol.sql.metamodel.QualifiedName;
specialinvoke v.<org.finos.legend.engine.protocol.sql.metamodel.QualifiedName: void <init>()>();
v = virtualinvoke v.<org.finos.legend.engine.language.sql.grammar.'from'.antlr.SqlBaseParser$QnameContext: java.util.List ident()>();
v = specialinvoke v.<org.finos.legend.engine.postgres.TableNameExtractor: java.util.List identsToStrings(java.util.List)>(v);
v.<org.finos.legend.engine.protocol.sql.metamodel.QualifiedName: java.util.List parts> = v;
return v;
}
private java.util.List identsToStrings(java.util.List)
{
java.util.List v;
org.eclipse.collections.api.block.function.Function v;
org.eclipse.collections.api.list.MutableList v;
org.finos.legend.engine.postgres.TableNameExtractor v;
v := @this: org.finos.legend.engine.postgres.TableNameExtractor;
v := @parameter: java.util.List;
v = staticinvoke <org.finos.legend.engine.postgres.TableNameExtractor$getIdentText__54: org.eclipse.collections.api.block.function.Function bootstrap$(org.finos.legend.engine.postgres.TableNameExtractor)>(v);
v = staticinvoke <org.eclipse.collections.impl.utility.ListIterate: org.eclipse.collections.api.list.MutableList flatCollect(java.util.List,org.eclipse.collections.api.block.function.Function)>(v, v);
return v;
}
}