chromium/third_party/perfetto/src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.cc

/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.h"

#include <algorithm>
#include <cctype>
#include <functional>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "perfetto/base/compiler.h"
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/flat_hash_map.h"
#include "perfetto/ext/base/string_utils.h"
#include "src/trace_processor/perfetto_sql/engine/perfetto_sql_preprocessor.h"
#include "src/trace_processor/sqlite/sql_source.h"
#include "src/trace_processor/sqlite/sqlite_tokenizer.h"

namespace perfetto {
namespace trace_processor {
namespace {

Token;
Statement;

enum class State {};

bool KeywordEqual(std::string_view expected, std::string_view actual) {}

bool TokenIsSqliteKeyword(std::string_view keyword, SqliteTokenizer::Token t) {}

bool TokenIsCustomKeyword(std::string_view keyword, SqliteTokenizer::Token t) {}

bool IsValidModuleWord(const std::string& word) {}

bool ValidateModuleName(const std::string& name) {}

}  // namespace

PerfettoSqlParser::PerfettoSqlParser(
    SqlSource source,
    const base::FlatHashMap<std::string, PerfettoSqlPreprocessor::Macro>&
        macros)
    :{}

bool PerfettoSqlParser::Next() {}

bool PerfettoSqlParser::ParseIncludePerfettoModule(
    Token first_non_space_token) {}

bool PerfettoSqlParser::ParseCreatePerfettoTableOrView(
    bool replace,
    Token first_non_space_token,
    TableOrView table_or_view) {}

bool PerfettoSqlParser::ParseCreatePerfettoIndex(bool replace,
                                                 Token first_non_space_token) {}

bool PerfettoSqlParser::ParseDropPerfettoIndex(
    SqliteTokenizer::Token first_non_space_token) {}

bool PerfettoSqlParser::ParseCreatePerfettoFunction(
    bool replace,
    Token first_non_space_token) {}

bool PerfettoSqlParser::ParseCreatePerfettoMacro(bool replace) {}

bool PerfettoSqlParser::ParseRawArguments(std::vector<RawArgument>& args) {}

bool PerfettoSqlParser::ParseArguments(
    std::vector<sql_argument::ArgumentDefinition>& args) {}

std::optional<sql_argument::ArgumentDefinition>
PerfettoSqlParser::ResolveRawArgument(RawArgument arg) {}

bool PerfettoSqlParser::ErrorAtToken(const SqliteTokenizer::Token& token,
                                     const char* error,
                                     ...) {}

}  // namespace trace_processor
}  // namespace perfetto