Hash :
28182485
Author :
Date :
2012-04-24T23:07:34
Drastically simplified Input class. Now most of the heavy lifting is done by in-built yy_scan_string and yy_scan_bytes. Comment handling will be done by the lexer. git-svn-id: https://angleproject.googlecode.com/svn/trunk@1051 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
//
// 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.
//
#include "Lexer.h"
#include <cassert>
namespace pp
{
Lexer::Lexer() : mHandle(0)
{
}
Lexer::~Lexer()
{
destroyLexer();
// Make sure the lexer and associated buffer are deleted.
assert(mHandle == 0);
assert(mInput.buffer == 0);
}
bool Lexer::init(int count, const char* const string[], const int length[])
{
assert((count >= 0) && string);
mInput.count = count;
mInput.string = string;
mInput.length = length;
return initLexer();
}
} // namespace pp