mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-09-23 04:37:20 +02:00
Update POCO to 1.11.0
This commit is contained in:
@@ -52,19 +52,30 @@ public:
|
||||
/// in the form #AnonEnum<n> (where <n> is a unique integer)
|
||||
/// will be assigned.
|
||||
|
||||
Enum(const std::string& name, NameSpace* pNameSpace, const std::string& baseType, int flags = 0);
|
||||
/// Creates the Enum.
|
||||
///
|
||||
/// If name is the empty string, an internal name
|
||||
/// in the form #AnonEnum<n> (where <n> is a unique integer)
|
||||
/// will be assigned.
|
||||
|
||||
~Enum();
|
||||
/// Destroys the Enum.
|
||||
|
||||
void addValue(EnumValue* pValue);
|
||||
/// Adds an enum value. The Enum takes ownership of the value.
|
||||
|
||||
|
||||
Iterator begin() const;
|
||||
/// Returns an iterator for iterating over the Enum's EnumValue's.
|
||||
|
||||
|
||||
Iterator end() const;
|
||||
/// Returns an iterator for iterating over the Enum's EnumValue's.
|
||||
|
||||
|
||||
const std::string& baseType() const;
|
||||
/// Returns the base type or an empty string if no base type has been specified.
|
||||
|
||||
int flags() const;
|
||||
/// Returns the flags.
|
||||
|
||||
Symbol::Kind kind() const;
|
||||
std::string toString() const;
|
||||
@@ -72,8 +83,9 @@ public:
|
||||
protected:
|
||||
static std::string processName(const std::string& name);
|
||||
|
||||
private:
|
||||
private:
|
||||
Values _values;
|
||||
std::string _baseType;
|
||||
int _flags;
|
||||
static int _count;
|
||||
};
|
||||
@@ -82,6 +94,12 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string& Enum::baseType() const
|
||||
{
|
||||
return _baseType;
|
||||
}
|
||||
|
||||
|
||||
inline int Enum::flags() const
|
||||
{
|
||||
return _flags;
|
||||
|
@@ -113,6 +113,12 @@ public:
|
||||
bool isConst() const;
|
||||
/// Returns true iff the method is const.
|
||||
|
||||
bool isDefault() const;
|
||||
/// Returns true iff the method has a default implementation.
|
||||
|
||||
bool isDeleted() const;
|
||||
/// Returns true iff the method has been deleted.
|
||||
|
||||
int countParameters() const;
|
||||
/// Returns the number of parameters.
|
||||
|
||||
@@ -160,6 +166,18 @@ inline bool Function::isConst() const
|
||||
}
|
||||
|
||||
|
||||
inline bool Function::isDefault() const
|
||||
{
|
||||
return (flags() & FN_DEFAULT) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool Function::isDeleted() const
|
||||
{
|
||||
return (flags() & FN_DELETE) != 0;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::CppParser
|
||||
|
||||
|
||||
|
@@ -50,18 +50,18 @@ public:
|
||||
SYM_BUILTIN, /// A built-in type
|
||||
SYM_VARIABLE /// A (member) variable
|
||||
};
|
||||
|
||||
|
||||
enum Access
|
||||
{
|
||||
ACC_PUBLIC, /// public access
|
||||
ACC_PROTECTED, /// protected access
|
||||
ACC_PRIVATE /// private access
|
||||
};
|
||||
|
||||
|
||||
Symbol();
|
||||
/// Creates the Symbol and assigns the symbol
|
||||
/// a unique ID.
|
||||
|
||||
|
||||
Symbol(const std::string& name, NameSpace* pNameSpace = 0);
|
||||
/// Creates the Symbol and assigns the symbol
|
||||
/// a unique ID.
|
||||
@@ -74,87 +74,87 @@ public:
|
||||
|
||||
const std::string& name() const;
|
||||
/// Returns the symbol's (local) name.
|
||||
|
||||
|
||||
NameSpace* nameSpace() const;
|
||||
/// Returns the symbol's namespace which
|
||||
/// may be null.
|
||||
|
||||
|
||||
void setAccess(Access v);
|
||||
/// Sets the symbol's access.
|
||||
|
||||
|
||||
Access getAccess() const;
|
||||
/// Returns the symbol's access.
|
||||
|
||||
|
||||
void setDocumentation(const std::string& text);
|
||||
/// Sets the symbol's documentation.
|
||||
|
||||
|
||||
void addDocumentation(const std::string& text);
|
||||
/// Adds text to the symbol's documentation.
|
||||
|
||||
|
||||
const std::string& getDocumentation() const;
|
||||
/// Returns the symbol's documentation.
|
||||
|
||||
|
||||
void setFile(const std::string& path);
|
||||
/// Sets the file where the symbol is declared.
|
||||
|
||||
|
||||
const std::string& getFile() const;
|
||||
/// Returns the file where the symbol is defined.
|
||||
|
||||
|
||||
void setLineNumber(int line);
|
||||
/// Sets the line number of the symbol's declaration.
|
||||
|
||||
|
||||
int getLineNumber() const;
|
||||
/// Returns the line number of the symbol's declaration.
|
||||
|
||||
|
||||
void setPackage(const std::string& package);
|
||||
/// Sets the symbol's package.
|
||||
|
||||
|
||||
const std::string& getPackage() const;
|
||||
/// Returns the symbol's package.
|
||||
|
||||
|
||||
void setLibrary(const std::string& library);
|
||||
/// Sets the symbol's library.
|
||||
|
||||
|
||||
const std::string& getLibrary() const;
|
||||
/// Returns the symbol's library.
|
||||
|
||||
|
||||
const Attributes& attrs() const;
|
||||
/// Returns the symbol's attributes.
|
||||
|
||||
Attributes& attrs();
|
||||
/// Returns the symbol's attributes.
|
||||
|
||||
|
||||
const Attributes& getAttributes() const;
|
||||
/// Returns the symbol's attributes.
|
||||
|
||||
|
||||
void setAttributes(const Attributes& attrs);
|
||||
/// Sets the symbol's attributes.
|
||||
|
||||
|
||||
std::string fullName() const;
|
||||
/// Returns the symbol's fully qualified name.
|
||||
|
||||
static std::string extractName(const std::string& decl);
|
||||
/// Extracts the name from the declaration.
|
||||
|
||||
|
||||
virtual Kind kind() const = 0;
|
||||
/// Returns the symbol's kind.
|
||||
|
||||
|
||||
virtual std::string toString() const = 0;
|
||||
/// Returns a string representation of the symbol.
|
||||
|
||||
|
||||
bool isPublic() const;
|
||||
/// Returns true iff the symbol is public.
|
||||
|
||||
|
||||
bool isProtected() const;
|
||||
/// Returns true iff the symbol is public.
|
||||
|
||||
bool isPrivate() const;
|
||||
/// Returns true iff the symbol is public.
|
||||
|
||||
|
||||
protected:
|
||||
static bool isIdent(char c);
|
||||
static bool hasAttr(const std::string& decl, const std::string& attr);
|
||||
|
||||
|
||||
private:
|
||||
Symbol(const Symbol&);
|
||||
Symbol& operator = (const Symbol&);
|
||||
@@ -169,7 +169,7 @@ private:
|
||||
std::string _package;
|
||||
std::string _library;
|
||||
Attributes _attrs;
|
||||
|
||||
|
||||
static int _nextId;
|
||||
};
|
||||
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
/// Destroys the TypeDef.
|
||||
|
||||
Symbol::Kind kind() const;
|
||||
|
||||
|
||||
std::string baseType() const;
|
||||
/// Returns the underlying base type.
|
||||
};
|
||||
|
18
vendor/POCO/CppParser/src/Enum.cpp
vendored
18
vendor/POCO/CppParser/src/Enum.cpp
vendored
@@ -35,6 +35,14 @@ Enum::Enum(const std::string& name, NameSpace* pNameSpace, int flags):
|
||||
}
|
||||
|
||||
|
||||
Enum::Enum(const std::string& name, NameSpace* pNameSpace, const std::string& baseType, int flags):
|
||||
Symbol(processName(name), pNameSpace),
|
||||
_baseType(baseType),
|
||||
_flags(flags)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Enum::~Enum()
|
||||
{
|
||||
}
|
||||
@@ -43,11 +51,11 @@ Enum::~Enum()
|
||||
void Enum::addValue(EnumValue* pValue)
|
||||
{
|
||||
poco_check_ptr (pValue);
|
||||
|
||||
|
||||
_values.push_back(pValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Enum::Iterator Enum::begin() const
|
||||
{
|
||||
return _values.begin();
|
||||
@@ -81,7 +89,11 @@ Symbol::Kind Enum::kind() const
|
||||
std::string Enum::toString() const
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr << "enum " << name() << "\n{\n";
|
||||
ostr << "enum ";
|
||||
if (_flags & ENUM_IS_CLASS) ostr << "class ";
|
||||
ostr << name();
|
||||
if (!_baseType.empty()) ostr << ": " << _baseType;
|
||||
ostr << "\n{\n";
|
||||
for (Iterator it = begin(); it != end(); ++it)
|
||||
{
|
||||
ostr << "\t" << (*it)->toString() << "\n";
|
||||
|
70
vendor/POCO/CppParser/src/Parser.cpp
vendored
70
vendor/POCO/CppParser/src/Parser.cpp
vendored
@@ -58,7 +58,7 @@ Parser::Parser(NameSpace::SymbolTable& gst, const std::string& file, std::istrea
|
||||
p.makeAbsolute();
|
||||
_path = p.toString();
|
||||
_currentPath = _path;
|
||||
|
||||
|
||||
_nsStack.push_back(NameSpace::root());
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ const Token* Parser::parseFile(const Token* pNext)
|
||||
const Token* Parser::parseNameSpace(const Token* pNext)
|
||||
{
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_NAMESPACE));
|
||||
|
||||
|
||||
pNext = next();
|
||||
if (pNext->is(Token::IDENTIFIER_TOKEN))
|
||||
{
|
||||
@@ -213,11 +213,11 @@ const Token* Parser::parseNameSpace(const Token* pNext)
|
||||
std::string name = pNext->tokenString();
|
||||
pNext = next();
|
||||
expectOperator(pNext, OperatorToken::OP_OPENBRACE, "{");
|
||||
|
||||
|
||||
std::string fullName = currentNameSpace()->fullName();
|
||||
if (!fullName.empty()) fullName += "::";
|
||||
fullName += name;
|
||||
|
||||
|
||||
NameSpace* pNS = dynamic_cast<NameSpace*>(currentNameSpace()->lookup(fullName));
|
||||
bool undefined = (pNS == 0);
|
||||
if (undefined) pNS = new NameSpace(name, currentNameSpace());
|
||||
@@ -273,7 +273,7 @@ const Token* Parser::parseClass(const Token* pNext, std::string& decl)
|
||||
|
||||
_pCurrentSymbol = 0;
|
||||
bool isClass = isKeyword(pNext, IdentifierToken::KW_CLASS);
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
Symbol::Access prevAccess = _access;
|
||||
append(decl, pNext);
|
||||
Symbol::Access access;
|
||||
@@ -377,7 +377,7 @@ const Token* Parser::parseBaseClassList(const Token* pNext, Struct* pClass)
|
||||
const Token* Parser::parseClassMembers(const Token* pNext, Struct* /*pClass*/)
|
||||
{
|
||||
poco_assert (isOperator(pNext, OperatorToken::OP_OPENBRACE));
|
||||
|
||||
|
||||
pNext = next();
|
||||
while (pNext->is(Token::IDENTIFIER_TOKEN) || pNext->is(Token::KEYWORD_TOKEN) || isOperator(pNext, OperatorToken::OP_COMPL))
|
||||
{
|
||||
@@ -456,7 +456,7 @@ const Token* Parser::parseTemplate(const Token* pNext)
|
||||
const Token* Parser::parseTemplateArgs(const Token* pNext, std::string& decl)
|
||||
{
|
||||
poco_assert (isOperator(pNext, OperatorToken::OP_LT));
|
||||
|
||||
|
||||
append(decl, pNext);
|
||||
int depth = 1;
|
||||
pNext = next();
|
||||
@@ -480,7 +480,7 @@ const Token* Parser::parseTypeDef(const Token* pNext)
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_TYPEDEF));
|
||||
|
||||
_pCurrentSymbol = 0;
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
std::string decl;
|
||||
while (!isOperator(pNext, OperatorToken::OP_SEMICOLON) && !isEOF(pNext))
|
||||
{
|
||||
@@ -499,9 +499,9 @@ const Token* Parser::parseTypeDef(const Token* pNext)
|
||||
const Token* Parser::parseUsing(const Token* pNext)
|
||||
{
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_USING));
|
||||
|
||||
|
||||
_pCurrentSymbol = 0;
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
pNext = next();
|
||||
if (isKeyword(pNext, IdentifierToken::KW_NAMESPACE))
|
||||
{
|
||||
@@ -538,7 +538,7 @@ const Token* Parser::parseUsing(const Token* pNext)
|
||||
{
|
||||
currentNameSpace()->importSymbol(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isOperator(pNext, OperatorToken::OP_SEMICOLON))
|
||||
@@ -552,7 +552,7 @@ const Token* Parser::parseUsing(const Token* pNext)
|
||||
const Token* Parser::parseFriend(const Token* pNext)
|
||||
{
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_FRIEND));
|
||||
|
||||
|
||||
pNext = next();
|
||||
|
||||
while (!isOperator(pNext, OperatorToken::OP_SEMICOLON) && !isEOF(pNext))
|
||||
@@ -595,7 +595,7 @@ const Token* Parser::parseVarFunc(const Token* pNext, std::string& decl)
|
||||
if (!currentNameSpace()->lookup(name))
|
||||
{
|
||||
Variable* pVar = new Variable(decl, currentNameSpace());
|
||||
addSymbol(pVar, _istr.getCurrentLineNumber());
|
||||
addSymbol(pVar, static_cast<int>(_istr.getCurrentLineNumber()));
|
||||
}
|
||||
pNext = next();
|
||||
}
|
||||
@@ -621,7 +621,7 @@ const Token* Parser::parseVarFunc(const Token* pNext, std::string& decl)
|
||||
const Token* Parser::parseExtern(const Token* pNext)
|
||||
{
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_EXTERN));
|
||||
|
||||
|
||||
pNext = next();
|
||||
if (pNext->is(Token::STRING_LITERAL_TOKEN))
|
||||
pNext = next();
|
||||
@@ -644,7 +644,7 @@ const Token* Parser::parseFunc(const Token* pNext, std::string& decl)
|
||||
{
|
||||
poco_assert (isOperator(pNext, OperatorToken::OP_OPENPARENT));
|
||||
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
Function* pFunc = 0;
|
||||
std::string name = Symbol::extractName(decl);
|
||||
if (name.find(':') == std::string::npos)
|
||||
@@ -656,7 +656,7 @@ const Token* Parser::parseFunc(const Token* pNext, std::string& decl)
|
||||
expectOperator(pNext, OperatorToken::OP_CLOSPARENT, ")");
|
||||
pNext = next();
|
||||
while (pNext->is(Poco::Token::IDENTIFIER_TOKEN) || pNext->is(Poco::Token::KEYWORD_TOKEN))
|
||||
{
|
||||
{
|
||||
if (isKeyword(pNext, IdentifierToken::KW_CONST))
|
||||
{
|
||||
if (pFunc) pFunc->makeConst();
|
||||
@@ -664,7 +664,7 @@ const Token* Parser::parseFunc(const Token* pNext, std::string& decl)
|
||||
}
|
||||
if (isKeyword(pNext, IdentifierToken::KW_THROW))
|
||||
{
|
||||
while (!isOperator(pNext, OperatorToken::OP_ASSIGN) && !isOperator(pNext, OperatorToken::OP_SEMICOLON) &&
|
||||
while (!isOperator(pNext, OperatorToken::OP_ASSIGN) && !isOperator(pNext, OperatorToken::OP_SEMICOLON) &&
|
||||
!isOperator(pNext, OperatorToken::OP_OPENBRACE) && !isEOF(pNext))
|
||||
pNext = next();
|
||||
}
|
||||
@@ -721,16 +721,16 @@ const Token* Parser::parseFunc(const Token* pNext, std::string& decl)
|
||||
pNext = next();
|
||||
|
||||
pNext = parseBlock(pNext);
|
||||
|
||||
|
||||
if (isKeyword(pNext, IdentifierToken::KW_CATCH))
|
||||
{
|
||||
while (!isOperator(pNext, OperatorToken::OP_OPENBRACE) && !isEOF(pNext))
|
||||
pNext = next();
|
||||
|
||||
|
||||
pNext = parseBlock(pNext);
|
||||
}
|
||||
else syntaxError("expected catch block");
|
||||
|
||||
|
||||
if (!pFunc)
|
||||
pFunc = dynamic_cast<Function*>(currentNameSpace()->lookup(name));
|
||||
if (pFunc)
|
||||
@@ -785,7 +785,7 @@ const Token* Parser::parseParameters(const Token* pNext, Function* pFunc)
|
||||
const Token* Parser::parseBlock(const Token* pNext)
|
||||
{
|
||||
poco_assert (isOperator(pNext, OperatorToken::OP_OPENBRACE));
|
||||
|
||||
|
||||
pNext = next();
|
||||
int depth = 1;
|
||||
while (depth > 0 && !isEOF(pNext))
|
||||
@@ -804,12 +804,13 @@ const Token* Parser::parseEnum(const Token* pNext)
|
||||
{
|
||||
poco_assert (isKeyword(pNext, IdentifierToken::KW_ENUM));
|
||||
|
||||
std::string baseType;
|
||||
int flags = 0;
|
||||
_pCurrentSymbol = 0;
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
pNext = next();
|
||||
|
||||
if (isKeyword(pNext, IdentifierToken::KW_CLASS))
|
||||
if (isKeyword(pNext, IdentifierToken::KW_CLASS) || isKeyword(pNext, IdentifierToken::KW_STRUCT))
|
||||
{
|
||||
flags = Enum::ENUM_IS_CLASS;
|
||||
pNext = next();
|
||||
@@ -821,8 +822,27 @@ const Token* Parser::parseEnum(const Token* pNext)
|
||||
name = pNext->tokenString();
|
||||
pNext = next();
|
||||
}
|
||||
|
||||
if (isOperator(pNext, OperatorToken::OP_COLON))
|
||||
{
|
||||
pNext = next();
|
||||
if (pNext->is(Token::KEYWORD_TOKEN))
|
||||
{
|
||||
while (pNext->is(Token::KEYWORD_TOKEN)) // int, unsigned int, etc.
|
||||
{
|
||||
if (!baseType.empty()) baseType += ' ';
|
||||
baseType += pNext->tokenString();
|
||||
pNext = next();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pNext = parseIdentifier(pNext, baseType);
|
||||
}
|
||||
}
|
||||
|
||||
expectOperator(pNext, OperatorToken::OP_OPENBRACE, "{");
|
||||
Enum* pEnum = new Enum(name, currentNameSpace(), flags);
|
||||
Enum* pEnum = new Enum(name, currentNameSpace(), baseType, flags);
|
||||
addSymbol(pEnum, line);
|
||||
pNext = next();
|
||||
while (pNext->is(Token::IDENTIFIER_TOKEN))
|
||||
@@ -842,7 +862,7 @@ const Token* Parser::parseEnumValue(const Token* pNext, Enum* pEnum)
|
||||
{
|
||||
_pCurrentSymbol = 0;
|
||||
_doc.clear();
|
||||
int line = _istr.getCurrentLineNumber();
|
||||
int line = static_cast<int>(_istr.getCurrentLineNumber());
|
||||
std::string name = pNext->tokenString();
|
||||
std::string value;
|
||||
pNext = next();
|
||||
|
Reference in New Issue
Block a user