Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Public Attributes | List of all members
dart::kernel::TypeParameterHelper Class Reference

#include <kernel_translation_helper.h>

Public Types

enum  Field {
  kStart , kFlags , kAnnotations , kVariance ,
  kName , kBound , kDefaultType , kEnd
}
 
enum  Flag { kIsGenericCovariantImpl = 1 << 0 }
 

Public Member Functions

 TypeParameterHelper (KernelReaderHelper *helper)
 
void ReadUntilIncluding (Field field)
 
void ReadUntilExcluding (Field field)
 
void SetNext (Field field)
 
void SetJustRead (Field field)
 
void ReadUntilExcludingAndSetJustRead (Field field)
 
void Finish ()
 
bool IsGenericCovariantImpl ()
 

Public Attributes

TokenPosition position_ = TokenPosition::kNoSource
 
uint8_t flags_ = 0
 
StringIndex name_index_
 

Detailed Description

Definition at line 338 of file kernel_translation_helper.h.

Member Enumeration Documentation

◆ Field

◆ Flag

Enumerator
kIsGenericCovariantImpl 

Definition at line 351 of file kernel_translation_helper.h.

Constructor & Destructor Documentation

◆ TypeParameterHelper()

dart::kernel::TypeParameterHelper::TypeParameterHelper ( KernelReaderHelper helper)
inlineexplicit

Definition at line 355 of file kernel_translation_helper.h.

355 {
356 helper_ = helper;
357 next_read_ = kStart;
358 }

Member Function Documentation

◆ Finish()

void dart::kernel::TypeParameterHelper::Finish ( )
inline

◆ IsGenericCovariantImpl()

bool dart::kernel::TypeParameterHelper::IsGenericCovariantImpl ( )
inline

Definition at line 376 of file kernel_translation_helper.h.

◆ ReadUntilExcluding()

void dart::kernel::TypeParameterHelper::ReadUntilExcluding ( Field  field)

Definition at line 1025 of file kernel_translation_helper.cc.

1025 {
1026 for (; next_read_ < field; ++next_read_) {
1027 switch (next_read_) {
1028 case kFlags:
1029 flags_ = helper_->ReadFlags();
1030 break;
1031 case kAnnotations:
1032 helper_->SkipListOfExpressions(); // read annotations.
1033 break;
1034 case kVariance:
1035 helper_->ReadVariance();
1036 break;
1037 case kName:
1038 name_index_ = helper_->ReadStringReference(); // read name index.
1039 break;
1040 case kBound:
1041 helper_->SkipDartType();
1042 break;
1043 case kDefaultType:
1044 helper_->SkipDartType();
1045 break;
1046 case kEnd:
1047 return;
1048 }
1049 }
1050}

◆ ReadUntilExcludingAndSetJustRead()

void dart::kernel::TypeParameterHelper::ReadUntilExcludingAndSetJustRead ( Field  field)
inline

Definition at line 369 of file kernel_translation_helper.h.

369 {
370 ReadUntilExcluding(field);
371 SetJustRead(field);
372 }

◆ ReadUntilIncluding()

void dart::kernel::TypeParameterHelper::ReadUntilIncluding ( Field  field)
inline

Definition at line 360 of file kernel_translation_helper.h.

360 {
361 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
362 }

◆ SetJustRead()

void dart::kernel::TypeParameterHelper::SetJustRead ( Field  field)
inline

Definition at line 367 of file kernel_translation_helper.h.

367{ next_read_ = field + 1; }

◆ SetNext()

void dart::kernel::TypeParameterHelper::SetNext ( Field  field)
inline

Definition at line 366 of file kernel_translation_helper.h.

366{ next_read_ = field; }

Member Data Documentation

◆ flags_

uint8_t dart::kernel::TypeParameterHelper::flags_ = 0

Definition at line 381 of file kernel_translation_helper.h.

◆ name_index_

StringIndex dart::kernel::TypeParameterHelper::name_index_

Definition at line 382 of file kernel_translation_helper.h.

◆ position_

TokenPosition dart::kernel::TypeParameterHelper::position_ = TokenPosition::kNoSource

Definition at line 380 of file kernel_translation_helper.h.


The documentation for this class was generated from the following files: