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

annotation.cc File Reference

#include "annotation.h"
#include "annotation_i.h"

Include dependency graph for annotation.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define COLOR_(c)   #c
#define COLOR(c)   (colors ? "\033[" COLOR_(c) "m" : "")
#define cBlack   30
#define cRed   31
#define cGreen   32
#define cYellow   33
#define cBlue   34
#define cMagenta   35
#define cCyan   36
#define cWhite   37

Functions

const char * unmangle (const char *name)
Ptreemake_static_leaf (const char *txt)
Ptreemake_dup_leaf (const char *txt)
Ptreemake_dup_leaf (std::string txt)
Annotated< LeafThis > * make_this (Type type)
Annotated< LeafName > * make_name (const char *txt, Type type, Symbol *sym)
Annotated< LeafName > * make_name (std::string str, Type type, Symbol *sym)
Annotated< LeafName > * make_name (Function_signature *fsig)
Annotated< LeafName > * make_name (Variable_symbol *vsym)
Annotated< PtreeFstyleCastExpr > * make_cast_expr_unchecked (Ptree *expr, const Type &target_type)
Annotated< PtreeFstyleCastExpr > * make_cast_expr (Ptree *expr, Type target_type)
 Create a function-style cast. More...

Annotated< PtreeFstyleCastExpr > * make_derived_to_base_cast (Ptree *expr, Type target_type)
 Create a derived-to-base cast. More...

Annotated< PtreeCommaExpr > * make_comma_expr (Ptree *lhs, Ptree *rhs)
 Create a comma expression. More...

Annotated< PtreeDeclaration > * make_declaration (Variable_symbol *vsym)
void fill_in_overload_annotation (Ptree *tree, Symbol *sym, Type t)
 Fill in result of overload resolution. More...

Ptreemake_unary_funcall (Ptree *function, Type result, Ptree *arg)
void print_annotated_tree (std::ostream &out, std::string indent, Ptree *tree, bool colors)


Define Documentation

#define cBlack   30
 

Definition at line 312 of file annotation.cc.

#define cBlue   34
 

Definition at line 320 of file annotation.cc.

Referenced by print_annotated_tree().

#define cCyan   36
 

Definition at line 324 of file annotation.cc.

#define cGreen   32
 

Definition at line 316 of file annotation.cc.

Referenced by print_annotated_tree().

#define cMagenta   35
 

Definition at line 322 of file annotation.cc.

#define COLOR      (colors ? "\033[" COLOR_(c) "m" : "")
 

Definition at line 310 of file annotation.cc.

Referenced by print_annotated_tree().

#define COLOR_      #c
 

Definition at line 308 of file annotation.cc.

#define cRed   31
 

Definition at line 314 of file annotation.cc.

Referenced by print_annotated_tree().

#define cWhite   37
 

Definition at line 326 of file annotation.cc.

#define cYellow   33
 

Definition at line 318 of file annotation.cc.


Function Documentation

void fill_in_overload_annotation Ptree   tree,
Symbol   sym,
Type    t
 

Fill in result of overload resolution.

Comma expressions must be handled specially.

Definition at line 209 of file annotation.cc.

References Annotation::set_symbol(), Annotation::set_type(), and Ptree::Third().

Referenced by Expr_annotator::do_funcall(), and Implicit_conversion::make_tree().

Annotated<PtreeFstyleCastExpr>* make_cast_expr Ptree   expr,
Type    target_type
 

Create a function-style cast.

This one's used for built-in types.

Definition at line 131 of file annotation.cc.

References Type::is_class_type(), Type::is_valid(), and make_cast_expr_unchecked().

Referenced by Expr_result::convert_to().

Annotated<PtreeFstyleCastExpr>* make_cast_expr_unchecked Ptree   expr,
const Type   target_type
 

Definition at line 113 of file annotation.cc.

References Ptree::List(), make_name(), and make_static_leaf().

Referenced by Expr_result::convert_to_qual(), make_cast_expr(), make_derived_to_base_cast(), and Implicit_conversion::make_tree().

Annotated<PtreeCommaExpr>* make_comma_expr Ptree   lhs,
Ptree   rhs
 

Create a comma expression.

These are handled specially: (a, (b, c)) is converted into ((a, b), c) so that the RHS of a comma expression never is a comma expression itself.

Definition at line 156 of file annotation.cc.

References Ptree::First(), Annotation::get_type(), Ptree::List(), make_static_leaf(), and Ptree::Third().

Referenced by Expr_annotator::do_funcall(), Annotated_funcall_maker::make_funcall(), Expr_annotator::process_member_access(), and Expr_annotator::visit_comma().

Annotated<PtreeDeclaration>* make_declaration Variable_symbol   vsym
 

Definition at line 180 of file annotation.cc.

References Type::get_encoded_type(), Symbol::get_name(), Variable_symbol::get_type(), Ptree::List(), make_dup_leaf(), and make_static_leaf().

Referenced by Simple_declaration_reader::declare_variable().

Annotated<PtreeFstyleCastExpr>* make_derived_to_base_cast Ptree   expr,
Type    target_type
 

Create a derived-to-base cast.

Right now, this generates the same tree as make_cast_expr.

Definition at line 143 of file annotation.cc.

References Type::is_class_type(), Type::is_valid(), and make_cast_expr_unchecked().

Referenced by Expr_annotator::process_member_access(), and Expr_annotator::process_pm_expr().

Ptree* make_dup_leaf std::string    txt
 

Definition at line 48 of file annotation.cc.

Referenced by make_declaration().

Ptree* make_dup_leaf const char *    txt
 

Definition at line 37 of file annotation.cc.

References ntName.

Annotated<LeafName>* make_name Variable_symbol   vsym
 

Definition at line 103 of file annotation.cc.

References Symbol::get_name(), and Variable_symbol::get_type().

Referenced by Expr_annotator::do_funcall(), Init_handler::get_default_initializer_for_type(), make_cast_expr_unchecked(), Init_handler::make_constructor_call(), make_name(), make_sizeof_expr(), Implicit_conversion::make_tree(), process_initializers(), Expr_annotator::process_member_access(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_name(), Expr_annotator::visit_new(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary().

Annotated<LeafName>* make_name Function_signature   fsig
 

Definition at line 89 of file annotation.cc.

References Function_signature::get_call_type(), Function_signature::get_function(), Symbol::get_name(), and make_name().

Annotated<LeafName>* make_name std::string    str,
Type    type,
Symbol   sym
 

Definition at line 81 of file annotation.cc.

References make_name().

Annotated<LeafName>* make_name const char *    txt,
Type    type,
Symbol   sym
 

Definition at line 68 of file annotation.cc.

References ntName.

Ptree* make_static_leaf const char *    txt
 

Definition at line 29 of file annotation.cc.

Referenced by Init_maker::add(), Annotated_funcall_maker::add_arg(), Annotator::get_output_as_block(), make_cast_expr_unchecked(), make_comma_expr(), make_cond_expr(), Init_handler::make_constructor_call(), make_declaration(), Annotated_funcall_maker::make_funcall(), Init_maker::make_init(), make_null_statement(), make_sizeof_expr(), make_this_star(), process_initializers(), Expr_annotator::process_member_access(), Expr_annotator::process_pm_expr(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_name(), Expr_annotator::visit_new(), Expr_annotator::visit_pm(), and Annotator::visit_return().

Annotated<LeafThis>* make_this Type    type
 

Definition at line 56 of file annotation.cc.

References Type::make_pointer_type(), Type::q_Const, THIS, and Type::with_qualifier().

Referenced by make_this_star(), and Expr_annotator::visit_this().

Ptree* make_unary_funcall Ptree   function,
Type    result,
Ptree   arg
 

Definition at line 281 of file annotation.cc.

References Annotated_funcall_maker::add_arg(), and Annotated_funcall_maker::make_funcall().

Referenced by Implicit_conversion::make_tree(), Expr_annotator::visit_arrowmember(), and Expr_annotator::visit_unary().

void print_annotated_tree std::ostream &    out,
std::string    indent,
Ptree   tree,
bool    colors
 

Definition at line 335 of file annotation.cc.

References Annotation::af_DirectCall, Ptree::Car(), cBlue, Ptree::Cdr(), cGreen, COLOR, cRed, Type::get_encoded_type(), Symbol::get_name(), Annotation::get_symbol(), Annotation::get_type(), Symbol_table::has_dump_flag(), Annotation::has_flag(), Type::is_valid(), Ptree::IsLeaf(), Type::make_pointer_type(), Ptree::ToString(), and unmangle().

Referenced by Function_signature::dump(), Variable_symbol::dump(), and main().

const char * unmangle const char *    name [static]
 

Definition at line 291 of file annotation.cc.

Referenced by print_annotated_tree().


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