Poco::CppParser

class Symbol

Library: CppParser
Package: SymbolTable
Header: Poco/CppParser/Symbol.h

Description

This is the base class for all symbols in the symbol table.

Every symbol has a unique ID (int) and a namespace (which may be null).

Inheritance

Known Derived Classes: Parameter, TypeDef, Variable, Function, BuiltIn, NameSpace, Enum, Struct, EnumValue, Decl

Member Summary

Member Functions: addDocumentation, attrs, extractName, fullName, getAccess, getAttributes, getDocumentation, getFile, getLibrary, getLineNumber, getPackage, hasAttr, id, isIdent, isPrivate, isProtected, isPublic, kind, name, nameSpace, setAccess, setAttributes, setDocumentation, setFile, setLibrary, setLineNumber, setPackage, toString

Enumerations

Access

ACC_PUBLIC

public access

ACC_PROTECTED

protected access

ACC_PRIVATE

private access

Kind

SYM_ENUM

An enumeration

SYM_ENUM_VALUE

An enumeration value

SYM_FUNCTION

A (member) function

SYM_NAMESPACE

A namespace

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

Constructors

Symbol

Symbol();

Creates the Symbol and assigns the symbol a unique ID.

Symbol

Symbol(
    const std::string & name,
    NameSpace * pNameSpace = 0
);

Creates the Symbol and assigns the symbol a unique ID.

Destructor

~Symbol virtual

virtual ~Symbol();

Destroys the Symbol.

Member Functions

addDocumentation

void addDocumentation(
    const std::string & text
);

Adds text to the symbol's documentation.

attrs inline

const Attributes & attrs() const;

Returns the symbol's attributes.

attrs

Attributes & attrs();

Returns the symbol's attributes.

extractName static

static std::string extractName(
    const std::string & decl
);

Extracts the name from the declaration.

fullName

std::string fullName() const;

Returns the symbol's fully qualified name.

getAccess inline

Access getAccess() const;

Returns the symbol's access.

getAttributes

const Attributes & getAttributes() const;

Returns the symbol's attributes.

getDocumentation inline

const std::string & getDocumentation() const;

Returns the symbol's documentation.

getFile inline

const std::string & getFile() const;

Returns the file where the symbol is defined.

getLibrary inline

const std::string & getLibrary() const;

Returns the symbol's library.

getLineNumber inline

int getLineNumber() const;

Returns the line number of the symbol's declaration.

getPackage inline

const std::string & getPackage() const;

Returns the symbol's package.

id inline

int id() const;

Returns the symbol's unique ID.

isPrivate inline

bool isPrivate() const;

Returns true if and only if the symbol is public.

isProtected inline

bool isProtected() const;

Returns true if and only if the symbol is public.

isPublic inline

bool isPublic() const;

Returns true if and only if the symbol is public.

kind virtual

virtual Kind kind() const = 0;

Returns the symbol's kind.

name inline

const std::string & name() const;

Returns the symbol's (local) name.

nameSpace inline

NameSpace * nameSpace() const;

Returns the symbol's namespace which may be null.

setAccess

void setAccess(
    Access v
);

Sets the symbol's access.

setAttributes

void setAttributes(
    const Attributes & attrs
);

Sets the symbol's attributes.

setDocumentation

void setDocumentation(
    const std::string & text
);

Sets the symbol's documentation.

setFile

void setFile(
    const std::string & path
);

Sets the file where the symbol is declared.

setLibrary

void setLibrary(
    const std::string & library
);

Sets the symbol's library.

setLineNumber

void setLineNumber(
    int line
);

Sets the line number of the symbol's declaration.

setPackage

void setPackage(
    const std::string & package
);

Sets the symbol's package.

toString virtual

virtual std::string toString() const = 0;

Returns a string representation of the symbol.

hasAttr protected static

static bool hasAttr(
    const std::string & decl,
    const std::string & attr
);

isIdent protected static

static bool isIdent(
    char c
);