Skip to content

PreprocessingInfo

For preprocessing information including source comments, include , if, define, etc

Synopsis

Declared in <SageIII/rose_attributes_list.h>

Enums

Name

Description

DirectiveType

OutputPlacementType

RelativePositionType

MK: Enum type to store if the directive goes before or after the corresponding line of source code

Static Member Functions

Friends

Name

Description

SgLocatedNode

This class represents the notion of an expression or statement which

Non-Member Functions

Name

Description

ASTtools::isIfDirectiveBegin

Returns true if the info is an '#if', '#ifdef', or '#ifndef'.

ASTtools::isIfDirectiveMiddle

Returns true if the info is an '#elif' or '#else'.

ASTtools::isPositionAfter

Returns true if info is positioned after its statement.

ASTtools::isPositionBefore

Returns true if info is positioned before its statement.

ASTtools::isPositionInside

Returns true if info is positioned inside its statement.

SageBuilder::buildComment

Build and attach a comment with an explicit lexical comment style. It is a wrapper of SageInterface::attachComment().

SageBuilder::buildCpreprocessorDefineDeclaration

Build and attach #define XX directives, pass "#define xxx xxx" as content.

SageInterface::attachComment

Build and attach a comment with an explicit lexical comment style.

SageInterface::collectCppDirectiveSnapshot

Capture the primary source file's preprocessing directives in physical source order. The returned values are independent of later AST mutations.

SageInterface::insertHeader

Insert #include "filename" or #include <filename> (system header) into the global scope containing the current scope, right after other #include XXX.

SageInterface::insertHeader

Insert #include "filename" or #include <filename> (system header) onto the global scope of a source file

SageInterface::insertHeader

Insert #include "filename" or #include <filename> (system header) onto the global scope of a source file, add to be the last #include .. by default among existing headers, Or as the first header. Recommended for use.

SageInterface::publishGeneratedPreprocessingInfo

Publish a generated preprocessing record with one exact physical output owner. The record remains typed as a transformation; its Sg_File_Info keeps logical spelling provenance and stores physical output identity separately.

SageInterface::publishGeneratedTrailingComment

Publish a generated trailing comment whose explicit attachment is after the owner's syntax on the owner's current output line.

SageInterface::publishPreprocessingInfoPhysicalOutputOwner

Publish an existing preprocessing record at a new exact physical output owner. Source‐spelled records retain their logical spelling and semantic classification while their physical output identity changes; generated records are validated by publishGeneratedPreprocessingInfo().

SageInterface::relocateAttachedPreprocessingInfoPhysicalOutputOwner

Relocate an already‐published preprocessing record whose typed output placement is the attached AST boundary. The record must identify priorOwner exactly; detached, shared, source‐position‐owned, or differently owned records are hard errors. Source/generated spelling provenance is immutable.

Created with MrDocs