public override IQueryElement VisitClause([NotNull] QueryGrammarParser.ClauseContext context) { IQueryElement operation = Visit(context.where_operation()); if (context.and_or_clause() != null) { IQueryElement clasule = Visit(context.and_or_clause().clause()); IQueryCompositeElement operatorElement = GetLogicalElement(context.and_or_clause()).GetComposite(); operatorElement.Add(operation); operatorElement.Add(clasule); return(operatorElement); } return(operation); }
public override IQueryElement VisitGet_stmt([NotNull] QueryGrammarParser.Get_stmtContext context) { if (context.K_DEREF() != null) { Deref deref = new Deref(); IQueryElement parentSelect = Visit(context.get_stmt()); deref.Add(parentSelect); return(deref); } if (context.aggregate_function() != null) { IQueryCompositeElement aggregate = Visit(context.aggregate_function()).GetComposite(); IQueryElement parentSelect = Visit(context.get_stmt()); aggregate.Add(parentSelect); return(aggregate); } if (context.get_stmt() != null) { IQueryCompositeElement parentSelect = Visit(context.get_stmt()).GetComposite(); if (context.child_value() != null) { IQueryElement property = Visit(context.child_value()); parentSelect.Add(property); } return(parentSelect); } SelectStatement select = new SelectStatement(); IQueryElement className = Visit(context.get_header().class_name()); select.Add(className); if (context.where_clause() != null) { IQueryElement where = Visit(context.where_clause()); select.Add(where); } return(select); }