chromium/components/subresource_filter/tools/rule_parser/rule_parser.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/subresource_filter/tools/rule_parser/rule_parser.h"

#include <map>
#include <string_view>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/check_op.h"
#include "base/logging.h"
#include "base/not_fatal_until.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "components/subresource_filter/tools/rule_parser/rule_options.h"
#include "components/url_pattern_index/proto/rules.pb.h"

namespace subresource_filter {

namespace {

// Encapsulates meta-information of URL rule options identified by keywords.
class KeywordMap {};

KeywordMap::KeywordMap() {}

KeywordMap::~KeywordMap() = default;

const KeywordMap::OptionDetails* KeywordMap::Lookup(
    std::string_view name) const {}

void KeywordMap::AddOption(std::string_view name,
                           const OptionDetails& details) {}

KeywordMap* GetKeywordsMapSingleton() {}

}  // namespace

// RuleParser ------------------------------------------------------------------

RuleParser::ParseError::ParseError() = default;
RuleParser::ParseError::~ParseError() = default;

RuleParser::RuleParser() = default;
RuleParser::~RuleParser() = default;

const char* RuleParser::GetParseErrorCodeDescription(
    ParseError::ErrorCode code) {}

// TODO(pkalinnikov): Refactor parsing approach to use a FSM.
RuleType RuleParser::Parse(std::string_view line) {}

RuleType RuleParser::ParseUrlRule(std::string_view origin,
                                  std::string_view part) {}

bool RuleParser::ParseUrlRuleOptions(std::string_view origin,
                                     std::string_view options) {}

RuleType RuleParser::ParseCssRule(std::string_view origin,
                                  std::string_view part,
                                  size_t css_section_start) {}

void RuleParser::SetParseError(ParseError::ErrorCode code,
                               std::string_view origin,
                               const char* error_begin) {}

std::ostream& operator<<(std::ostream& out,
                         const RuleParser::ParseError& error) {}

}  // namespace subresource_filter