Hash :
3a01d1bc
Author :
Date :
2011-08-30T05:10:53
Preparation for macro expansion. Review URL: http://codereview.appspot.com/4919045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@741 736b8ea6-26fd-11df-bfd4-992fa37f6226
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
//
// Copyright (c) 2011 The ANGLE 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 COMPILER_PREPROCESSOR_TOKEN_H_
#define COMPILER_PREPROCESSOR_TOKEN_H_
#include <string>
#include <vector>
#include "common/angleutils.h"
namespace pp
{
class Token
{
public:
typedef int Location;
static Location encodeLocation(int line, int file);
static void decodeLocation(Location loc, int* line, int* file);
// Takes ownership of string.
Token(Location location, int type, std::string* value);
~Token();
Location location() const { return mLocation; }
int type() const { return mType; }
const std::string* value() const { return mValue; }
private:
DISALLOW_COPY_AND_ASSIGN(Token);
Location mLocation;
int mType;
std::string* mValue;
};
typedef std::vector<Token*> TokenVector;
typedef TokenVector::const_iterator TokenIterator;
extern std::ostream& operator<<(std::ostream& out, const Token& token);
} // namepsace pp
#endif // COMPILER_PREPROCESSOR_TOKEN_H_