public override Expression VisitIdentity(EqlGrammerParser.IdentityContext context)
        {
            // check that the schema has the property for the context
            var field = context.GetText();

            //TODO - need to get the mapped name for the type to check for fields to support mapped schema too
            if (!_schemaProvider.TypeHasField(_schemaProvider.GetSchemaTypeNameForRealType(_currentContext.Type), field))
            {
                throw new EqlCompilerException($"Field or property '{field}' not found on current context '{_currentContext.Type.Name}'");
            }
            var exp = _schemaProvider.GetExpressionForField(_currentContext, _currentContext.Type.Name, field);

            return(exp);
        }
Beispiel #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="EqlGrammerParser.identity"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitIdentity([NotNull] EqlGrammerParser.IdentityContext context)
 {
     return(VisitChildren(context));
 }