aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/library/yql/ast/yql_ast_annotation.h
blob: 5b0b96e508d86ceae79d9be4f91eda76f2ae9254 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "yql_ast.h"
#include <util/generic/hash.h>

namespace NYql {

TAstNode* PositionAsNode(TPosition position, TMemoryPool& pool);

TAstNode* AnnotatePositions(TAstNode& root, TMemoryPool& pool);
// returns nullptr in case of error
TAstNode* RemoveAnnotations(TAstNode& root, TMemoryPool& pool);
// returns nullptr in case of error
TAstNode* ApplyPositionAnnotations(TAstNode& root, ui32 annotationIndex, TMemoryPool& pool);
// returns false in case of error
bool ApplyPositionAnnotationsInplace(TAstNode& root, ui32 annotationIndex);

typedef THashMap<const TAstNode*, TVector<const TAstNode*>> TAnnotationNodeMap; 

// returns nullptr in case of error
TAstNode* ExtractAnnotations(TAstNode& root, TAnnotationNodeMap& annotations, TMemoryPool& pool);

}