mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-23 21:27:14 +01:00
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
47 lines
807 B
C++
47 lines
807 B
C++
//
|
|
// Tokenizer.cpp
|
|
//
|
|
// Library: CppParser
|
|
// Package: CppParser
|
|
// Module: Tokenizer
|
|
//
|
|
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#include "Poco/CppParser/Tokenizer.h"
|
|
#include "Poco/CppParser/CppToken.h"
|
|
|
|
|
|
using Poco::StreamTokenizer;
|
|
using Poco::WhitespaceToken;
|
|
|
|
|
|
namespace Poco {
|
|
namespace CppParser {
|
|
|
|
|
|
Tokenizer::Tokenizer(std::istream& istr):
|
|
StreamTokenizer(istr)
|
|
{
|
|
addToken(new OperatorToken);
|
|
addToken(new IdentifierToken);
|
|
addToken(new StringLiteralToken);
|
|
addToken(new CharLiteralToken);
|
|
addToken(new NumberLiteralToken);
|
|
addToken(new CommentToken, false);
|
|
addToken(new PreprocessorToken);
|
|
addToken(new WhitespaceToken);
|
|
}
|
|
|
|
|
|
Tokenizer::~Tokenizer()
|
|
{
|
|
}
|
|
|
|
|
|
} } // namespace Poco::CppParser
|