Synopsis - Synopsis::PTree

# Namespace Synopsis::PTree

Namespaces Summary:
Kwd
Class templates Summary:
template <Token::Type t>
class KeywordT
template <typename T>
class StatementT
template <typename T>
class ExpressionT
Classes Summary:
class Literal
class CommentedAtom
class DupAtom
class Identifier
class Keyword
class UserKeyword
class Display

The Display class provides an annotated view of the ptree, for debugging purposes

class RTTIDisplay
class DotFileGenerator
class Encoding

An Encoding represents a mangled (type) name.

class Brace
class Block
class ClassBody
class TemplateDecl
class TemplateInstantiation
class ExternTemplate
class MetaclassDecl
class LinkageSpec
class NamespaceSpec
class Declaration
class Typedef
class UsingDirective
class UsingDeclaration
class NamespaceAlias
class FunctionDefinition
class ParameterDeclaration
class Declarator
class Name
class FstyleCastExpr
class ClassSpec
class EnumSpec
class TypeParameter
class AccessSpec
class AccessDecl
class UserAccessSpec
class UserdefKeyword
class IfStatement
class SwitchStatement
class WhileStatement
class DoStatement
class ForStatement
class TryStatement
class BreakStatement
class ContinueStatement
class ReturnStatement
class GotoStatement
class CaseStatement
class DefaultStatement
class LabelStatement
class ExprStatement
class Expression
class AssignExpr
class CondExpr
class InfixExpr
class PmExpr
class CastExpr
class UnaryExpr
class ThrowExpr
class SizeofExpr
class OffsetofExpr
class TypeidExpr
class TypeofExpr
class NewExpr
class DeleteExpr
class ArrayExpr
class FuncallExpr
class PostfixExpr
class UserStatementExpr
class DotMemberExpr
class ArrowMemberExpr
class ParenExpr
class StaticUserStatementExpr
class Node
class Iterator
class Array
class Atom
class List
class TypeVisitor
class Visitor

The Visitor class is used to dynamically resolve type information about a given Node.

class Writer
Function templates Summary:
template <typename N>
N* nconc(N* p, Node* q)
template <typename N>
N* snoc(N* p, Node* q)
Functions Summary:
inline void display(const Node* node, std::ostream& os, bool encoded = false, bool typeinfo = false)

Display the given parse tree segment on the given output stream.

inline void generate_dot_file(const Node* node, std::ostream& os)

Generate a dot file for the given parse tree segment.

inline bool operator<(const Encoding& e1, const Encoding& e2)
inline std::ostream& operator<<(std::ostream& os, const Encoding& e)
bool operator==(const Node& p, char c)
inline bool operator!=(const Node& p, char c)
bool operator==(const Node& p, const char* str)
inline bool operator!=(const Node& p, const char* str)
bool operator==(const Node& p, const Node& q)
inline bool operator!=(const Node& p, const Node& q)
bool equal(const Node& p, const char* str, size_t len)
bool equal(const Node* p, const Node* q)
bool equiv(const Node* p, const Node* q)
const Node* last(const Node*)

Return the last cons cell.

Node* last(Node*)

Return the last cons cell.

inline const Node* first(const Node* p)
inline Node* first(Node* p)
inline const Node* rest(const Node* p)
inline Node* rest(Node* p)
inline const Node* nth(const Node* p, size_t n)
inline Node* nth(Node* p, size_t n)
inline const Node* tail(const Node* p, size_t k)
inline Node* tail(Node* p, size_t k)
const Node* second(const Node*)
Node* second(Node*)
const Node* third(const Node*)
Node* third(Node*)
int length(const Node*)
inline const Node* cadr(const Node* p)
inline Node* cadr(Node* p)
inline const Node* cddr(const Node* p)
inline Node* cddr(Node* p)
const Node* ca_ar(const Node*)

compute Caa..ar

Node* ca_ar(Node*)
Node* cons(Node*, Node*)
List* list()
List* list(Node*)
List* list(Node*, Node*)
List* list(Node*, Node*, Node*)
List* list(Node*, Node*, Node*, Node*)
List* list(Node*, Node*, Node*, Node*, Node*)
List* list(Node*, Node*, Node*, Node*, Node*, Node*)
List* list(Node*, Node*, Node*, Node*, Node*, Node*, Node*)
List* list(Node*, Node*, Node*, Node*, Node*, Node*, Node*, Node*)
Node* copy(Node*)
Node* append(Node*, Node*)
Node* replace_all(Node*, Node*, Node*)
Node* subst(Node*, Node*, Node*)
Node* subst(Node*, Node*, Node*, Node*, Node*)
Node* subst(Node*, Node*, Node*, Node*, Node*, Node*, Node*)
Node* shallow_subst(Node*, Node*, Node*)
Node* shallow_subst(Node*, Node*, Node*, Node*, Node*)
Node* shallow_subst(Node*, Node*, Node*, Node*, Node*, Node*, Node*)
Node* shallow_subst(Node*, Node*, Node*, Node*, Node*, Node*, Node*, Node*, Node*)
Node* subst_sublist(Node*, Node*, Node*)
Node* nconc(Node*, Node*)
Node* nconc(Node*, Node*, Node*)
Node* snoc(Node*, Node*)
inline Token::Type type_of(const Node* node)
inline bool is_a(const Node* node, Token::Type t)
inline bool is_a(const Node* node, Token::Type t1, Token::Type t2)
inline bool is_a(const Node* node, Token::Type t1, Token::Type t2, Token::Type t3)
inline std::string reify(const Node* p)
Classes Details:
class Display

The Display class provides an annotated view of the ptree, for debugging purposes

class Encoding

An Encoding represents a mangled (type) name. Here is a quick reference of the grammar:

- b: boolean
- c: char
- w: wchar_t
- i: int (signed, unsigned)
- s: short (short int)
- l: long (long int)
- j: long long
- f: float
- d: double
- r: long double
- v: void
- T: template class (e.g. Foo<int,char> ==> T[3]Foo[2]ic. [2] means the length of ic. It doesn't mean the number of template arguments.
- e: ...
- ?: no return type. the return type of constructors
- *: non-type template parameter
- S: signed
- U: unsigned
- C: const
- V: volatile
- P: pointer
- R: reference
- A: array (e.g. char[16] ==> A16_c)
- F: function (e.g. char foo(int) ==> Fi_c)
- M: pointer to member (e.g. Type::* ==> M[4]Type)
- Q: qualified class (e.g. X::YY ==> Q[2][1]X[2]YY, ::YY ==> Q[2][0][2]YY)
- [x]: means 0x80 + x
- 0: means :: (global scope)

Special function names:

- operator + ==> +
- operator new[] ==> new[]
- operator <type> ==> @<encoded type> cast operator

class Visitor

The Visitor class is used to dynamically resolve type information about a given Node. The default implementation does nothing, so you only need to implement the methods you actually need. Any types for which no corresponding 'visit' methods exist will be caught by the 'visit' of the closest parent.

Functions Details:
inline void display(const Node* node, std::ostream& os, bool encoded = false, bool typeinfo = false)

Display the given parse tree segment on the given output stream. If 'encoded' is set to 'true', print encoded names / types on appropriate nodes. If 'typeinfo' is set to 'true', print the class names of the nodes.

inline void generate_dot_file(const Node* node, std::ostream& os)

Generate a dot file for the given parse tree segment.

const Node* last(const Node*)

Return the last cons cell.

Node* last(Node*)

Return the last cons cell.

const Node* ca_ar(const Node*)

compute Caa..ar

Generated on Thu Apr 16 16:27:35 2009 by
synopsis (version devel)