Hash :
30a487c7
Author :
Date :
2012-05-02T17:30:46
Minor refactoring for Input class. Chnaged a raw array to std::vector. git-svn-id: https://angleproject.googlecode.com/svn/trunk@1068 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 49
//
// Copyright (c) 2012 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_LEXER_H_
#define COMPILER_PREPROCESSOR_LEXER_H_
#include <memory>
#include "Input.h"
#include "pp_utils.h"
namespace pp
{
struct Token;
class Lexer
{
public:
struct Context
{
Input input;
// The location where yytext points to. Token location should track
// scanLoc instead of Input::mReadLoc because they may not be the same
// if text is buffered up in the lexer input buffer.
Input::Location scanLoc;
};
Lexer();
~Lexer();
bool init(int count, const char* const string[], const int length[]);
int lex(Token* token);
private:
PP_DISALLOW_COPY_AND_ASSIGN(Lexer);
bool initLexer();
void destroyLexer();
void* mHandle; // Lexer handle.
Context mContext; // Lexer extra.
};
} // namespace pp
#endif // COMPILER_PREPROCESSOR_LEXER_H_