コード例 #1
0
        public static IColumn VisitSelectElement(SelectElementContext context)
        {
            switch (context)
            {
            case SelectColumnElementContext selectColumnElementContext:
                return(new PropertyColumn
                {
                    Name = IdentifierUtility.Parse(selectColumnElementContext.fullColumnName().GetText()),
                    Alias = IdentifierUtility.Unescape(selectColumnElementContext.alias?.GetText()),
                });

            case SelectFunctionElementContext selectFunctionElementContext:
            {
                if (selectFunctionElementContext.builtInFunctionCall() is CountFunctionCallContext)
                {
                    return new CountFunctionColumn
                           {
                               Alias = IdentifierUtility.Unescape(selectFunctionElementContext.alias?.GetText()),
                           }
                }
                ;

                return(VisitorHelper.ThrowNotSupportedFeature <IColumn>("Select Element Function"));
            }

            case SelectExpressionElementContext _:
                return(VisitorHelper.ThrowNotSupportedFeature <IColumn>("Select Element Expression"));
            }

            return(VisitorHelper.ThrowNotSupportedContext <IColumn>(context));
        }
コード例 #2
0
        public static ITableSource VisitTableSourceBase(TableSourceItemContext context)
        {
            IPart[] identifiers = IdentifierUtility.Parse(context.tableName().GetText());
            ValidateTableWithIndexName(identifiers);

            return(new AtomTableSource(
                       identifiers[0].ToString(),
                       identifiers.Length == 2 ? identifiers[1].ToString() : string.Empty
                       ));
        }
コード例 #3
0
 public virtual QsiQualifiedIdentifier VisitFunction(Function function)
 {
     return(new(IdentifierUtility.Parse(function.getName())));
 }
コード例 #4
0
 public virtual QsiQualifiedIdentifier VisitNextValExpression(NextValExpression expression)
 {
     return(new(IdentifierUtility.Parse(expression.getName())));
 }
コード例 #5
0
 public virtual QsiQualifiedIdentifier VisitMultiPartName(MultiPartName name)
 {
     return(new(IdentifierUtility.Parse(name.getFullyQualifiedName())));
 }