gfx/angle/src/compiler/preprocessor/Input.h

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 //
michael@0 2 // Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
michael@0 3 // Use of this source code is governed by a BSD-style license that can be
michael@0 4 // found in the LICENSE file.
michael@0 5 //
michael@0 6
michael@0 7 #ifndef COMPILER_PREPROCESSOR_INPUT_H_
michael@0 8 #define COMPILER_PREPROCESSOR_INPUT_H_
michael@0 9
michael@0 10 #include <stddef.h>
michael@0 11 #include <vector>
michael@0 12
michael@0 13 namespace pp
michael@0 14 {
michael@0 15
michael@0 16 // Holds and reads input for Lexer.
michael@0 17 class Input
michael@0 18 {
michael@0 19 public:
michael@0 20 Input();
michael@0 21 Input(size_t count, const char* const string[], const int length[]);
michael@0 22
michael@0 23 size_t count() const { return mCount; }
michael@0 24 const char* string(size_t index) const { return mString[index]; }
michael@0 25 size_t length(size_t index) const { return mLength[index]; }
michael@0 26
michael@0 27 size_t read(char* buf, size_t maxSize);
michael@0 28
michael@0 29 struct Location
michael@0 30 {
michael@0 31 size_t sIndex; // String index;
michael@0 32 size_t cIndex; // Char index.
michael@0 33
michael@0 34 Location() : sIndex(0), cIndex(0) { }
michael@0 35 };
michael@0 36 const Location& readLoc() const { return mReadLoc; }
michael@0 37
michael@0 38 private:
michael@0 39 // Input.
michael@0 40 size_t mCount;
michael@0 41 const char* const* mString;
michael@0 42 std::vector<size_t> mLength;
michael@0 43
michael@0 44 Location mReadLoc;
michael@0 45 };
michael@0 46
michael@0 47 } // namespace pp
michael@0 48 #endif // COMPILER_PREPROCESSOR_INPUT_H_
michael@0 49

mercurial