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

type_rep.cc File Reference

#include "type_rep.h"
#include "type_rep_i.h"

Include dependency graph for type_rep.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define DECLARE_FUNDAMENTAL(name, type, encoding)   Type name(encoding)

Functions

Type int_type ("i")
Type uint_type ("ui")
Type short_type ("h")
Type ushort_type ("uh")
Type long_type ("l")
Type ulong_type ("ul")
Type llong_type ("j")
Type ullong_type ("uj")
Type char_type ("c")
Type schar_type ("sc")
Type uchar_type ("uc")
Type float_type ("f")
Type double_type ("d")
Type ldouble_type ("e")
Type bool_type ("b")
Type wchar_type ("w")
Type void_type ("v")
Type ctor_type ("O")
bool parse_qualifier (Ptree *tree, Type &type)
 Attempt to parse /tree/ as a type-qualifier. More...

Type parse_type (Ptree *tree, Abstract_scope *scope, Ptree *name_for_anon, bool is_type_declaration)
 Parse a type. More...

bool parse_specifier (Ptree *tree, Storage_class_specifier *scs, Function_specifier_set *fs)
 Parse a type-specifier. More...

void parse_specifiers (Ptree *tree, Storage_class_specifier *scs, Function_specifier_set *fs)
 Parse a list of storage class/function specifiers into their representation. More...

const char * get_storage_specifier_name (Storage_class_specifier x)
 Get name of a Storage_class_specifier. More...

std::string get_function_specifier_name (Function_specifier_set s)
 Convert Function_specifier_set to string. More...

Type make_unary_function_type (Type arg, Type ret)
 Handy helper: make an unary function type (function-taking-ARG-and-returning-RET). More...

Type make_binary_function_type (Type arg, Type brg, Type ret)

Variables

Type size_type = uint_type
Type ptrdiff_type = int_type


Define Documentation

#define DECLARE_FUNDAMENTAL (  name,
type,
encoding    )     Type name(encoding)
 

Definition at line 635 of file type_rep.cc.


Function Documentation

Type bool_type (  "b"    ) 
 

Referenced by Type_reader::read_type().

Type char_type (  "c"    ) 
 

Referenced by Type_reader::Type_reader().

Type ctor_type (  "O"    ) 
 

Referenced by parse_type().

Type double_type (  "d"    ) 
 

Referenced by Type_reader::Type_reader().

Type float_type (  "f"    ) 
 

Referenced by Type_reader::Type_reader().

std::string get_function_specifier_name (  Function_specifier_set    s ) 
 

Convert Function_specifier_set to string.

Definition at line 1101 of file type_rep.cc.

References f_Abstract, f_Explicit, f_Inline, f_Virtual, and Function_specifier_set.

Referenced by Function_signature::dump().

const char* get_storage_specifier_name (  Storage_class_specifier    x ) 
 

Get name of a Storage_class_specifier.

Definition at line 1082 of file type_rep.cc.

References Storage_class_specifier.

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

Type int_type (  "i"    ) 
 

Referenced by Type::get_promoted_integer().

Type ldouble_type (  "e"    ) 
 

Referenced by Type_reader::Type_reader().

Type llong_type (  "j"    ) 
 

Referenced by Type_reader::Type_reader().

Type long_type (  "l"    ) 
 

Referenced by Type_reader::Type_reader().

Type make_binary_function_type (  Type    arg,
Type    brg,
Type    ret
) 
 

Definition at line 1133 of file type_rep.cc.

References Function_type_maker::add_parameter(), and Function_type_maker::make_function_type().

Referenced by binary_addeq_predicate(), binary_inteq_predicate(), binary_multeq_predicate(), and index_predicate().

Type make_unary_function_type (  Type    arg,
Type    ret
) 
 

Handy helper: make an unary function type (function-taking-ARG-and-returning-RET).

Definition at line 1123 of file type_rep.cc.

References Function_type_maker::add_parameter(), and Function_type_maker::make_function_type().

Referenced by Function_symbol::add_signature(), Class_symbol::finish_definition(), init_default_symbols(), unary_bitnot_predicate(), unary_delete_or_arrow_predicate(), unary_deref_predicate(), unary_minus_predicate(), unary_plus_predicate(), and Expr_annotator::visit_unary().

bool parse_qualifier (  Ptree *    tree,
Type &    type
) 
 

Attempt to parse /tree/ as a type-qualifier.

Modifies /type/ accordingly. Returns true iff it actually was a type-qualifier.

Definition at line 683 of file type_rep.cc.

References Type::add_qualifier(), compile_error(), CONST, Type::is_qualified(), Type::q_Const, Type::q_Restrict, Type::q_Volatile, RESTRICT, VOLATILE, and Ptree::What().

Referenced by Declaration_reader::parse_declarator_get_name(), Declaration_reader::parse_declarator_internal(), and Type_reader::read_type().

bool parse_specifier (  Ptree *    tree,
Storage_class_specifier *    scs,
Function_specifier_set *    fs
) 
 

Parse a type-specifier.

Parameters:
tree  one keyword
scs  [in/out] storage class specifier
fs  [in/out] function specifier
Returns:
true iff this was a valid specifier; parameters modified accordingly.

Definition at line 1003 of file type_rep.cc.

References AUTO, compile_error(), Ptree::Eq(), EXPLICIT, EXTERN, f_Explicit, f_Inline, f_None, f_Virtual, Function_specifier, Function_specifier_set, INLINE, MUTABLE, REGISTER, s_Auto, s_Extern, s_Mutable, s_None, s_Register, s_Static, STATIC, Storage_class_specifier, VIRTUAL, and Ptree::What().

Referenced by parse_specifiers().

void parse_specifiers (  Ptree *    tree,
Storage_class_specifier *    scs,
Function_specifier_set *    fs
) 
 

Parse a list of storage class/function specifiers into their representation.

Parameters:
tree  parse tree
scs  [in/out] storage class specifier so far
fs  [in/out] function specifier set so far

Definition at line 1063 of file type_rep.cc.

References Ptree::Car(), Ptree::Cdr(), compile_error(), Function_specifier_set, Ptree::IsLeaf(), parse_specifier(), Storage_class_specifier, and Ptree::ToString().

Type parse_type (  Ptree *    tree,
Abstract_scope *    scope,
Ptree *    name_for_anon,
bool    is_type_declaration
) 
 

Parse a type.

Parameters:
tree  a parse tree
scope  active scope
name_for_anon  if the type is an anonymous class, this will be its name
is_type_declaration  if this is a type declaration (i.e. "struct x;"). These have different scoping rules for C combatability.
This function should not assert-fail on types it doesn't understand. OpenC++ often needs us to parse into the blue, so maybe what we get isn't actually a type.

type-specifier ::= simple-type-specifier | class-specifier | enum-specifier | elaborated-type-specifier | cv-qualifier

Definition at line 927 of file type_rep.cc.

References ctor_type(), and Type_reader::get_result().

Referenced by Expr_annotator::get_cast_type(), Symbol_name::init_name(), Declaration_reader::parse_declarator_internal(), parse_template_arg_list(), Expr_annotator::visit_cast(), Expr_annotator::visit_fstylecastexpr(), Annotator::visit_function(), Annotator::visit_name_declaration(), Expr_annotator::visit_new(), Expr_annotator::visit_sizeof(), Annotator::visit_type_declaration(), and Annotator::visit_typedef().

Type schar_type (  "sc"    ) 
 

Referenced by Type_reader::Type_reader().

Type short_type (  "h"    ) 
 

Referenced by Type_reader::Type_reader().

Type uchar_type (  "uc"    ) 
 

Referenced by Type_reader::Type_reader().

Type uint_type (  "ui"    ) 
 

Referenced by Type::get_promoted_integer().

Type ullong_type (  "uj"    ) 
 

Referenced by Type_reader::Type_reader().

Type ulong_type (  "ul"    ) 
 

Referenced by Type_reader::Type_reader().

Type ushort_type (  "uh"    ) 
 

Referenced by Type_reader::Type_reader().

Type void_type (  "v"    ) 
 

Referenced by Type_reader::read_type().

Type wchar_type (  "w"    ) 
 

Referenced by Type_reader::read_type().


Variable Documentation

Type ptrdiff_type = int_type
 

Definition at line 676 of file type_rep.cc.

Type size_type = uint_type
 

Definition at line 676 of file type_rep.cc.


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