Esempio n. 1
0
 public static string ExpectMayTypeAnno(EsperEPL2GrammarParser.TypeExpressionAnnotationContext ctx, CommonTokenStream tokenStream)
 {
     if (ctx == null)
     {
         return null;
     }
     string annoName = ctx.n.Text;
     if (!string.Equals(annoName, "type", StringComparison.InvariantCultureIgnoreCase))
     {
         throw ASTWalkException.From("Invalid annotation for property selection, expected 'type' but found '" + annoName + "'", tokenStream, ctx);
     }
     return ctx.v.Text;
 }
        public static string ExpectMayTypeAnno(
            EsperEPL2GrammarParser.TypeExpressionAnnotationContext ctx,
            CommonTokenStream tokenStream)
        {
            if (ctx == null)
            {
                return(null);
            }
            string annoName = ctx.n.Text;

            if (!annoName.ToLowerInvariant().Equals("type"))
            {
                throw ASTWalkException.From(
                          "Invalid annotation for property selection, expected 'type' but found '" + annoName + "'",
                          tokenStream, ctx);
            }
            return(ctx.v.Text);
        }