//===---- QueryParser.cpp - mlir-query command parser ---------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "QueryParser.h" #include "llvm/ADT/StringSwitch.h" namespace mlir::query { // Lex any amount of whitespace followed by a "word" (any sequence of // non-whitespace characters) from the start of region [begin,end). If no word // is found before end, return StringRef(). begin is adjusted to exclude the // lexed region. llvm::StringRef QueryParser::lexWord() { … } // This is the StringSwitch-alike used by LexOrCompleteWord below. See that // function for details. template <typename T> struct QueryParser::LexOrCompleteWord { … }; QueryRef QueryParser::endQuery(QueryRef queryRef) { … } namespace { enum class ParsedQueryKind { … }; QueryRef makeInvalidQueryFromDiagnostics(const matcher::internal::Diagnostics &diag) { … } } // namespace QueryRef QueryParser::completeMatcherExpression() { … } QueryRef QueryParser::doParse() { … } QueryRef QueryParser::parse(llvm::StringRef line, const QuerySession &qs) { … } std::vector<llvm::LineEditor::Completion> QueryParser::complete(llvm::StringRef line, size_t pos, const QuerySession &qs) { … } } // namespace mlir::query