chromium/v8/src/ast/ast-source-ranges.h

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_AST_AST_SOURCE_RANGES_H_
#define V8_AST_AST_SOURCE_RANGES_H_

#include "src/ast/ast.h"
#include "src/zone/zone-containers.h"

namespace v8 {
namespace internal {

// Specifies a range within the source code. {start} is 0-based and inclusive,
// {end} is 0-based and exclusive.
struct SourceRange {};

// The list of ast node kinds that have associated source ranges. Note that this
// macro is not undefined at the end of this file.
#define AST_SOURCE_RANGE_LIST(V)

enum class SourceRangeKind {};

class AstNodeSourceRanges : public ZoneObject {};

class BinaryOperationSourceRanges final : public AstNodeSourceRanges {};

class ContinuationSourceRanges : public AstNodeSourceRanges {};

class BlockSourceRanges final : public ContinuationSourceRanges {};

class CaseClauseSourceRanges final : public AstNodeSourceRanges {};

class ConditionalChainSourceRanges final : public AstNodeSourceRanges {};

class ConditionalSourceRanges final : public AstNodeSourceRanges {};

class FunctionLiteralSourceRanges final : public AstNodeSourceRanges {};

class IfStatementSourceRanges final : public AstNodeSourceRanges {};

class IterationStatementSourceRanges final : public AstNodeSourceRanges {};

class JumpStatementSourceRanges final : public ContinuationSourceRanges {};

class NaryOperationSourceRanges final : public AstNodeSourceRanges {};

class ExpressionSourceRanges final : public AstNodeSourceRanges {};

class SuspendSourceRanges final : public ContinuationSourceRanges {};

class SwitchStatementSourceRanges final : public ContinuationSourceRanges {};

class ThrowSourceRanges final : public ContinuationSourceRanges {};

class TryCatchStatementSourceRanges final : public AstNodeSourceRanges {};

class TryFinallyStatementSourceRanges final : public AstNodeSourceRanges {};

// Maps ast node pointers to associated source ranges. The parser creates these
// mappings and the bytecode generator consumes them.
class SourceRangeMap final : public ZoneObject {};

}  // namespace internal
}  // namespace v8

#endif  // V8_AST_AST_SOURCE_RANGES_H_