updated CppParser

This commit is contained in:
Guenter Obiltschnig
2012-10-15 07:50:06 +00:00
parent 4768beeb98
commit 64a4caaf42
38 changed files with 234 additions and 57 deletions

View File

@@ -1,7 +1,7 @@
//
// Attributes.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Attributes.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Attributes.h#2 $
//
// Library: CppParser
// Package: Attributes
@@ -105,6 +105,10 @@ public:
void set(const std::string& name, const std::string& value);
/// Sets the value of an attribute.
void remove(const std::string& name);
/// Removes the attribute with the given name.
/// Does nothing if the attribute does not exist.
const std::string& operator [] (const std::string& name) const;
std::string& operator [] (const std::string& name);

View File

@@ -1,7 +1,7 @@
//
// AttributesParser.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/AttributesParser.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/AttributesParser.h#2 $
//
// Library: CppParser
// Package: Attributes
@@ -61,10 +61,10 @@ class CppParser_API AttributesParser
/// with the syntax:
/// //@ <attrDecl>[,<attrDec>...]
/// where <attrDecl> is
/// <name>=<value>
/// <name>[=<value>]
/// <name> is a valid C++ identifier, or two identifiers separated by
/// a period (struct accessor notation).
/// <value> is a string, integer, bool literal, or a complex value
/// <value> is a string, integer, identifier, bool literal, or a complex value
/// in the form
/// {<name>=<value>[,<name>=<value>...]}
{

View File

@@ -0,0 +1,69 @@
//
// BuiltIn.h
//
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/BuiltIn.h#1 $
//
// Library: CppParser
// Package: SymbolTable
// Module: BuiltIn
//
// Definition of the BuiltIn class.
//
// Copyright (c) 2011, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef CppParser_BuiltIn_INCLUDED
#define CppParser_BuiltIn_INCLUDED
#include "Poco/CppParser/CppParser.h"
#include "Poco/CppParser/Symbol.h"
namespace Poco {
namespace CppParser {
class CppParser_API BuiltIn: public Symbol
/// A placeholder for a built-in type.
{
public:
BuiltIn(const std::string& name, NameSpace* pNameSpace);
/// Creates the BuiltIn.
~BuiltIn();
/// Destroys the BuiltIn.
Symbol::Kind kind() const;
std::string toString() const;
};
} } // namespace Poco::CppParser
#endif // CppParser_BuiltIn_INCLUDED

View File

@@ -1,7 +1,7 @@
//
// CppParser.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/CppParser.h#2 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/CppParser.h#2 $
//
// Library: CppParser
// Package: CppParser

View File

@@ -1,7 +1,7 @@
//
// CppToken.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/CppToken.h#2 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/CppToken.h#1 $
//
// Library: CppParser
// Package: CppParser

View File

@@ -1,7 +1,7 @@
//
// Decl.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Decl.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Decl.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Enum.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Enum.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Enum.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// EnumValue.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/EnumValue.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/EnumValue.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Function.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Function.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Function.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// NameSpace.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/NameSpace.h#2 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/NameSpace.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Parameter.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Parameter.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Parameter.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Parser.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Parser.h#3 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Parser.h#1 $
//
// Library: CppParser
// Package: CppParser

View File

@@ -1,7 +1,7 @@
//
// Struct.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Struct.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Struct.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Symbol.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Symbol.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Symbol.h#2 $
//
// Library: CppParser
// Package: SymbolTable
@@ -68,6 +68,7 @@ public:
SYM_PARAMETER, /// A function parameter
SYM_STRUCT, /// A struct or class
SYM_TYPEDEF, /// A typedef
SYM_BUILTIN, /// A built-in type
SYM_VARIABLE /// A (member) variable
};
@@ -140,7 +141,10 @@ public:
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.
@@ -254,6 +258,12 @@ inline const Attributes& Symbol::attrs() const
}
inline Attributes& Symbol::attrs()
{
return _attrs;
}
inline bool Symbol::isPublic() const
{
return _access == ACC_PUBLIC;

View File

@@ -1,7 +1,7 @@
//
// Tokenizer.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Tokenizer.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Tokenizer.h#1 $
//
// Library: CppParser
// Package: CppParser

View File

@@ -1,7 +1,7 @@
//
// TypeDef.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/TypeDef.h#2 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/TypeDef.h#1 $
//
// Library: CppParser
// Package: SymbolTable

View File

@@ -1,7 +1,7 @@
//
// Utility.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Utility.h#1 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Utility.h#1 $
//
// Library: CppParser
// Package: CppParser

View File

@@ -1,7 +1,7 @@
//
// Variable.h
//
// $Id: //poco/1.3/CppParser/include/Poco/CppParser/Variable.h#2 $
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Variable.h#1 $
//
// Library: CppParser
// Package: SymbolTable