Exemplo n.º 1
0
        public static IList <ColumnDesc> GetColTypeList(EsperEPL2GrammarParser.CreateColumnListContext ctx)
        {
            if (ctx == null)
            {
                return(Collections.GetEmptyList <ColumnDesc>());
            }
            IList <ColumnDesc> result = new List <ColumnDesc>(ctx.createColumnListElement().Length);

            foreach (var colctx in ctx.createColumnListElement())
            {
                IList <EsperEPL2GrammarParser.ClassIdentifierContext> idents = colctx.classIdentifier();
                var name = ASTUtil.UnescapeClassIdent(idents[0]);

                string type;
                if (colctx.VALUE_NULL() != null)
                {
                    type = null;
                }
                else
                {
                    type = ASTUtil.UnescapeClassIdent(idents[1]);
                }

                var array          = colctx.b != null;
                var primitiveArray = ValidateIsPrimitiveArray(colctx.p);
                result.Add(new ColumnDesc(name, type, array, primitiveArray));
            }
            return(result);
        }
Exemplo n.º 2
0
        public static IList<ColumnDesc> GetColTypeList(EsperEPL2GrammarParser.CreateColumnListContext ctx)
        {
            if (ctx == null)
            {
                return new EmptyList<ColumnDesc>();
            }

            IList<ColumnDesc> result = new List<ColumnDesc>(ctx.createColumnListElement().Length);
            foreach (var colctx in ctx.createColumnListElement())
            {
                var colname = colctx.classIdentifier();
                var name = ASTUtil.UnescapeClassIdent(colname);
                var classIdent = ASTClassIdentifierHelper.Walk(colctx.classIdentifierWithDimensions());
                result.Add(new ColumnDesc(name, classIdent?.ToEPL()));
            }

            return result;
        }