Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ptree_util.h File Reference

#include <vector>

Include dependency graph for ptree_util.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Enumerations

enum  { WCHAR_T = 9999, RESTRICT, EXPLICIT }

Functions

void flatten_specifier_list (Ptree *tree, std::vector< Ptree * > *nodes)
void flatten_ptree (Ptree *tree, std::vector< Ptree * > *nodes)
bool ptree_is_name (Ptree *tree)
 True iff the given tree is a name. More...

Ptreeconvert_comma_expr_to_list (Ptree *input)
 Convert an expression [[[a , b] , c] , d] into [a , b , c , d]. More...

Ptreeconvert_node_to_name (Ptree *p)
Ptreeconvert_decl_to_expr (Ptree *lhs, Ptree *rhs)
 Convert a declaration (consisting of a type-specifier lhs and a declarator side rhs) into an expression. More...


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
WCHAR_T 
RESTRICT 
EXPLICIT 

Definition at line 19 of file ptree_util.h.


Function Documentation

Ptree* convert_comma_expr_to_list Ptree   input
 

Convert an expression [[[a , b] , c] , d] into [a , b , c , d].

This is needed for expressions: "(foo)(1, 2, 3)" is parsed as [(foo) ( [[1 , 2] , 3] )] whereas the correct parse would be [[( foo )] ( [1 , 2 , 3] )].

Definition at line 53 of file ptree_util.cc.

References Ptree::Cons(), Ptree::First(), Ptree::Second(), and Ptree::Third().

Referenced by Expr_annotator::visit_cast().

Ptree* convert_decl_to_expr Ptree   lhs,
Ptree   rhs
 

Convert a declaration (consisting of a type-specifier lhs and a declarator side rhs) into an expression.

Definition at line 102 of file ptree_util.cc.

References Ptree::Car(), Ptree::Cdr(), compile_error(), CONST, convert_node_to_name(), Ptree::Display(), do_function(), Ptree::Eq(), expect_ptree(), Ptree::IsA(), Ptree::IsLeaf(), Ptree::List(), Ptree::Second(), Ptree::Third(), and VOLATILE.

Referenced by do_function(), and Expr_annotator::visit_cast().

Ptree* convert_node_to_name Ptree   p
 

Definition at line 86 of file ptree_util.cc.

References Ptree::GetLength(), Ptree::GetPosition(), Ptree::IsLeaf(), and ntName.

Referenced by convert_decl_to_expr().

void flatten_ptree Ptree   tree,
std::vector< Ptree * > *    nodes
 

Definition at line 22 of file ptree_util.cc.

References Ptree::Car(), Ptree::Cdr(), and Ptree::IsLeaf().

void flatten_specifier_list Ptree   tree,
std::vector< Ptree * > *    nodes
 

Definition at line 14 of file ptree_util.cc.

bool ptree_is_name Ptree   tree
 

True iff the given tree is a name.

LeafName doesn't respond to "IsA(ntName)". D'ooh!

Definition at line 41 of file ptree_util.cc.

References Ptree::IsA(), and ntName.

Referenced by Expr_annotator::visit_funcall(), and Expr_annotator::visit_unary().


Generated on Mon Feb 10 17:34:29 2003 for VFiasco Semantics Compiler by doxygen1.2.15