Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::kernel::KernelTokenPositionCollector Class Reference
Inheritance diagram for dart::kernel::KernelTokenPositionCollector:
dart::kernel::KernelReaderHelper

Public Member Functions

 KernelTokenPositionCollector (Zone *zone, TranslationHelper *translation_helper, const Script &script, const TypedDataView &data, intptr_t data_program_offset, intptr_t initial_script_index, intptr_t record_for_script_id, GrowableArray< intptr_t > *record_token_positions_into)
 
void CollectTokenPositions (intptr_t kernel_offset)
 
void RecordTokenPosition (TokenPosition position) override
 
void set_current_script_id (intptr_t id) override
 
- Public Member Functions inherited from dart::kernel::KernelReaderHelper
 KernelReaderHelper (Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
 
virtual ~KernelReaderHelper ()=default
 
void SetOffset (intptr_t offset)
 
intptr_t ReadListLength ()
 
NameIndex ReadCanonicalNameReference ()
 
virtual void ReportUnexpectedTag (const char *variant, Tag tag)
 
void ReadUntilFunctionNode ()
 
Tag PeekTag (uint8_t *payload=nullptr)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::kernel::KernelReaderHelper
virtual void set_current_script_id (intptr_t id)
 
virtual void RecordTokenPosition (TokenPosition position)
 
intptr_t ReaderOffset () const
 
intptr_t ReaderSize () const
 
void SkipBytes (intptr_t skip)
 
bool ReadBool ()
 
uint8_t ReadByte ()
 
uint32_t ReadUInt ()
 
uint32_t ReadUInt32 ()
 
uint32_t PeekUInt ()
 
double ReadDouble ()
 
uint32_t PeekListLength ()
 
StringIndex ReadStringReference ()
 
NameIndex ReadInterfaceMemberNameReference ()
 
StringIndex ReadNameAsStringIndex ()
 
const StringReadNameAsMethodName ()
 
const StringReadNameAsGetterName ()
 
const StringReadNameAsSetterName ()
 
const StringReadNameAsFieldName ()
 
void SkipFlags ()
 
void SkipStringReference ()
 
void SkipConstantReference ()
 
void SkipCanonicalNameReference ()
 
void SkipInterfaceMemberNameReference ()
 
void SkipDartType ()
 
void SkipOptionalDartType ()
 
void SkipInterfaceType (bool simple)
 
void SkipFunctionType (bool simple)
 
void SkipStatementList ()
 
void SkipListOfExpressions ()
 
void SkipListOfNamedExpressions ()
 
void SkipListOfDartTypes ()
 
void SkipListOfStrings ()
 
void SkipListOfVariableDeclarations ()
 
void SkipListOfCanonicalNameReferences ()
 
void SkipTypeParametersList ()
 
void SkipInitializer ()
 
void SkipExpression ()
 
void SkipStatement ()
 
void SkipFunctionNode ()
 
void SkipName ()
 
void SkipArguments ()
 
void SkipVariableDeclaration ()
 
void SkipLibraryCombinator ()
 
void SkipLibraryDependency ()
 
TokenPosition ReadPosition ()
 
Tag ReadTag (uint8_t *payload=nullptr)
 
uint8_t ReadFlags ()
 
Nullability ReadNullability ()
 
Variance ReadVariance ()
 
intptr_t SourceTableSize ()
 
intptr_t GetOffsetForSourceInfo (intptr_t index)
 
StringSourceTableUriFor (intptr_t index)
 
const StringGetSourceFor (intptr_t index)
 
TypedDataPtr GetLineStartsFor (intptr_t index)
 
StringSourceTableImportUriFor (intptr_t index)
 
TypedDataViewPtr GetConstantCoverageFor (intptr_t index)
 
- Protected Attributes inherited from dart::kernel::KernelReaderHelper
Zonezone_
 
TranslationHelpertranslation_helper_
 
Reader reader_
 
intptr_t data_program_offset_
 

Detailed Description

Definition at line 102 of file kernel.cc.

Constructor & Destructor Documentation

◆ KernelTokenPositionCollector()

dart::kernel::KernelTokenPositionCollector::KernelTokenPositionCollector ( Zone zone,
TranslationHelper translation_helper,
const Script script,
const TypedDataView data,
intptr_t  data_program_offset,
intptr_t  initial_script_index,
intptr_t  record_for_script_id,
GrowableArray< intptr_t > *  record_token_positions_into 
)
inline

Definition at line 104 of file kernel.cc.

113 : KernelReaderHelper(zone, translation_helper, data, data_program_offset),
114 current_script_id_(initial_script_index),
115 record_for_script_id_(record_for_script_id),
116 record_token_positions_into_(record_token_positions_into) {}
KernelReaderHelper(Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
static int8_t data[kExtLength]

Member Function Documentation

◆ CollectTokenPositions()

void dart::kernel::KernelTokenPositionCollector::CollectTokenPositions ( intptr_t  kernel_offset)

Definition at line 132 of file kernel.cc.

133 {
134 SetOffset(kernel_offset);
135
136 const Tag tag = PeekTag();
137 if (tag == kProcedure) {
138 ProcedureHelper procedure_helper(this);
139 procedure_helper.ReadUntilExcluding(ProcedureHelper::kEnd);
140 } else if (tag == kConstructor) {
141 ConstructorHelper constructor_helper(this);
142 constructor_helper.ReadUntilExcluding(ConstructorHelper::kEnd);
143 } else if (tag == kFunctionNode) {
144 FunctionNodeHelper function_node_helper(this);
145 function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kEnd);
146 } else if (tag == kField) {
147 FieldHelper field_helper(this);
148 field_helper.ReadUntilExcluding(FieldHelper::kEnd);
149 } else if (tag == kClass) {
150 ClassHelper class_helper(this);
151 class_helper.ReadUntilExcluding(ClassHelper::kEnd);
152 } else {
153 ReportUnexpectedTag("a class or a member", tag);
154 UNREACHABLE();
155 }
156}
#define UNREACHABLE()
Definition: assert.h:248
virtual void ReportUnexpectedTag(const char *variant, Tag tag)
Tag PeekTag(uint8_t *payload=nullptr)

◆ RecordTokenPosition()

void dart::kernel::KernelTokenPositionCollector::RecordTokenPosition ( TokenPosition  position)
overridevirtual

Reimplemented from dart::kernel::KernelReaderHelper.

Definition at line 158 of file kernel.cc.

158 {
159 if (record_for_script_id_ == current_script_id_ &&
160 record_token_positions_into_ != nullptr && position.IsReal()) {
161 record_token_positions_into_->Add(position.Serialize());
162 }
163}
void Add(const T &value)

◆ set_current_script_id()

void dart::kernel::KernelTokenPositionCollector::set_current_script_id ( intptr_t  id)
inlineoverridevirtual

Reimplemented from dart::kernel::KernelReaderHelper.

Definition at line 122 of file kernel.cc.

122{ current_script_id_ = id; }
const uintptr_t id

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