// Copyright 2012 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_PARSING_TOKEN_H_ #define V8_PARSING_TOKEN_H_ #include "src/base/bit-field.h" #include "src/base/bounds.h" #include "src/base/logging.h" #include "src/common/globals.h" namespace v8 { namespace internal { // TOKEN_LIST takes a list of 3 macros M, all of which satisfy the // same signature M(name, string, precedence), where name is the // symbolic token name, string is the corresponding syntactic symbol // (or nullptr, for literals), and precedence is the precedence (or 0). // The parameters are invoked for token categories as follows: // // T: Non-keyword tokens // K: Keyword tokens // IGNORE_TOKEN is a convenience macro that can be supplied as // an argument (at any position) for a TOKEN_LIST call. It does // nothing with tokens belonging to the respective category. #define IGNORE_TOKEN(name, string, precedence) … /* Binary operators */ /* kAdd and kSub are at the end since they are UnaryOp */ #define BINARY_OP_TOKEN_LIST(T, E) … #define EXPAND_BINOP_ASSIGN_TOKEN(T, name, string, precedence) … #define EXPAND_BINOP_TOKEN(T, name, string, precedence) … #define TOKEN_LIST(T, K) … class V8_EXPORT_PRIVATE Token { … }; } // namespace internal } // namespace v8 #endif // V8_PARSING_TOKEN_H_