yql_ast_annotation.h 772 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include "yql_ast.h"
  3. #include <util/generic/hash.h>
  4. namespace NYql {
  5. TAstNode* PositionAsNode(TPosition position, TMemoryPool& pool);
  6. TAstNode* AnnotatePositions(TAstNode& root, TMemoryPool& pool);
  7. // returns nullptr in case of error
  8. TAstNode* RemoveAnnotations(TAstNode& root, TMemoryPool& pool);
  9. // returns nullptr in case of error
  10. TAstNode* ApplyPositionAnnotations(TAstNode& root, ui32 annotationIndex, TMemoryPool& pool);
  11. // returns false in case of error
  12. bool ApplyPositionAnnotationsInplace(TAstNode& root, ui32 annotationIndex);
  13. typedef THashMap<const TAstNode*, TVector<const TAstNode*>> TAnnotationNodeMap;
  14. // returns nullptr in case of error
  15. TAstNode* ExtractAnnotations(TAstNode& root, TAnnotationNodeMap& annotations, TMemoryPool& pool);
  16. }