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

Type_reader Class Reference

Private class encapsulating the logic of reading a type (type-specifier-seq in standard terms). More...

#include <type_rep_i.h>

Collaboration diagram for Type_reader:

Collaboration graph
[legend]
List of all members.

Public Methods

Type get_result () const
 Type_reader (Abstract_scope *scope, Ptree *tree, bool is_type_declaration, Ptree *name_for_anon)

Private Types

enum  {
  iInt = 01, iUnsigned = 010, iShort = 0100, iLong = 01000,
  iSigned = 010000, iFloat = 0100000, iDouble = 01000000, iChar = 010000000
}

Private Methods

Ptreeread_type (Ptree *const tree)
 Read one piece of a type. More...


Private Attributes

long mask
 Multi-set of keywords encountered so far. More...

Type user_type
 Scratchspace. More...

Typebuiltin
 When a "simple" one-keyword type was seen, this points to that type. More...

Type qualifiers
 Qualifiers gathered so far. More...

Ptreeuser_id
 Identifier, if seen. More...

Abstract_scopescope
 Scope to look up names in. More...

bool is_type_declaration
Ptreename_for_anon
Type result

Detailed Description

Private class encapsulating the logic of reading a type (type-specifier-seq in standard terms).

Definition at line 22 of file type_rep_i.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
iInt 
iUnsigned 
iShort 
iLong 
iSigned 
iFloat 
iDouble 
iChar 

Definition at line 28 of file type_rep_i.h.


Constructor & Destructor Documentation

Type_reader::Type_reader Abstract_scope   scope,
Ptree   tree,
bool    is_type_declaration,
Ptree   name_for_anon
 

Definition at line 708 of file type_rep.cc.

References builtin, char_type(), compile_error(), Type::copy_qualifiers(), double_type(), float_type(), Type::get_kind(), Symbol::get_kind(), Type_symbol::get_type(), iChar, iDouble, iFloat, iInt, iLong, iShort, iSigned, iUnsigned, Type::k_Reference, Symbol::k_Typedef, ldouble_type(), llong_type(), long_type(), Symbol_name::lookup_for_use(), mask, qualifiers, read_type(), result, schar_type(), short_type(), Ptree::ToString(), uchar_type(), ullong_type(), ulong_type(), Symbol_pair::untag, user_id, user_type, and ushort_type().


Member Function Documentation

Type Type_reader::get_result   const [inline]
 

Definition at line 50 of file type_rep_i.h.

Referenced by parse_type().

Ptree * Type_reader::read_type Ptree *const    tree [private]
 

Read one piece of a type.

Input is a weird heap of

  • class/enum specifiers
  • reserved words ("void" et al)
  • user-defined names This assimilates the list as far as possible, and returns a pointer to the user-defined name, if seen. That is, if the return value is null, the list consisted of reserved words and class/enum entirely.

Definition at line 822 of file type_rep.cc.

References bool_type(), BOOLEAN, builtin, Ptree::Car(), Ptree::Cdr(), CHAR, compile_error(), DOUBLE, Ptree::Eq(), FLOAT, Type_symbol::get_type(), iChar, iDouble, iFloat, iInt, iLong, INT, is_type_declaration, iShort, iSigned, Ptree::IsLeaf(), iUnsigned, LONG, mask, name_for_anon, ntClassSpec, ntEnumSpec, parse_class(), parse_enum(), parse_qualifier(), qualifiers, scope, Ptree::Second(), SHORT, SIGNED, Ptree::ToString(), UNSIGNED, user_type, VOID, void_type(), WCHAR_T, wchar_type(), and Ptree::What().

Referenced by Type_reader().


Member Data Documentation

Type* Type_reader::builtin [private]
 

When a "simple" one-keyword type was seen, this points to that type.

Definition at line 40 of file type_rep_i.h.

Referenced by read_type(), and Type_reader().

bool Type_reader::is_type_declaration [private]
 

Definition at line 45 of file type_rep_i.h.

Referenced by read_type().

long Type_reader::mask [private]
 

Multi-set of keywords encountered so far.

Definition at line 38 of file type_rep_i.h.

Referenced by read_type(), and Type_reader().

Ptree* Type_reader::name_for_anon [private]
 

Definition at line 46 of file type_rep_i.h.

Referenced by read_type().

Type Type_reader::qualifiers [private]
 

Qualifiers gathered so far.

Definition at line 41 of file type_rep_i.h.

Referenced by read_type(), and Type_reader().

Type Type_reader::result [private]
 

Definition at line 48 of file type_rep_i.h.

Referenced by Type_reader().

Abstract_scope* Type_reader::scope [private]
 

Scope to look up names in.

Definition at line 43 of file type_rep_i.h.

Referenced by read_type().

Ptree* Type_reader::user_id [private]
 

Identifier, if seen.

Definition at line 42 of file type_rep_i.h.

Referenced by Type_reader().

Type Type_reader::user_type [private]
 

Scratchspace.

Definition at line 39 of file type_rep_i.h.

Referenced by read_type(), and Type_reader().


The documentation for this class was generated from the following files:
Generated on Mon Feb 10 17:36:48 2003 for VFiasco Semantics Compiler by doxygen1.2.15