61#define AST_INTERFACE(CLASS_NAME) \
62 static const Types classType = Types::CLASS_NAME; \
63 explicit CLASS_NAME(const SourcePosition& astPos) { area = SourceArea(astPos, 1); } \
64 explicit CLASS_NAME(const SourceArea& astArea) { area = astArea; } \
65 Types getType() const override { return Types::CLASS_NAME; } \
66 void visit(Visitor* visitor, void* args = nullptr) override { visitor->visit##CLASS_NAME(this, args); }
68#define DECLARATION_AST_ALIAS(ALIAS, BASE) \
70 using ALIAS##Ptr = BASE##Ptr
72#define FLAG_ENUM enum : UInt32
74#define FLAG(IDENT, INDEX) IDENT = (1u << (INDEX))
185 return (
ast !=
nullptr &&
ast->getType() == T::classType ?
static_cast<T*
>(
ast) :
nullptr);
190 return (
ast !=
nullptr &&
ast->getType() == T::classType ?
static_cast<const T*
>(
ast) :
nullptr);
194 template<
typename T> [[
nodiscard]]
T*
as() {
return (
getType() == T::classType ?
static_cast<T*
>(
this) :
nullptr); }
197 template<
typename T> [[
nodiscard]]
const T*
as()
const {
return (
getType() == T::classType ?
static_cast<const T*
>(
this) :
nullptr); }
1357#undef DECLARATION_AST_ALIAS
#define FLAG_ENUM
Definition AST.hpp:72
#define FLAG(IDENT, INDEX)
Definition AST.hpp:74
#define AST_INTERFACE(CLASS_NAME)
Definition AST.hpp:61
Class to manage identifiers that can be renamed (maybe several times), to keep track of the original ...
Definition Identifier.hpp:18
Definition ASTEnums.hpp:1557
Definition SourceArea.hpp:20
Definition Variant.hpp:20
Definition Visitor.hpp:92
SPtr< TypeSpecifier > TypeSpecifierPtr
Definition Visitor.hpp:37
UniqueFunction< void(VarDeclarationPtr &varDeclaration) const > VarDeclarationIteratorFunctor
Definition AST.hpp:47
TypeModifier
Definition ASTEnums.hpp:471
SPtr< Expression > ExpressionPtr
Definition Visitor.hpp:26
SPtr< ObjectExpression > ObjectExpressionPtr
Definition Visitor.hpp:76
SPtr< PackOffset > PackOffsetPtr
Definition Visitor.hpp:35
AttributeValue
Definition ASTEnums.hpp:948
UniqueFunction< ExpressionPtr(const ExpressionPtr &expression0, const ExpressionPtr &expression1) const > MergeExpressionFunctor
Definition AST.hpp:59
bool isExpressionAST(const AST::Types t)
ShaderTarget
Shader target enumeration.
Definition Targets.hpp:16
@ Undefined
Undefined shader target.
bool isDeclarationAST(const AST::Types t)
UnaryOp
Definition ASTEnums.hpp:119
SPtr< SourceCode > SourceCodePtr
Definition SourceCode.hpp:66
SPtr< BaseTypeDenoter > BaseTypeDenoterPtr
Definition TypeDenoter.hpp:32
SPtr< StructDeclaration > StructDeclarationPtr
Definition Visitor.hpp:42
BinaryOp
Definition ASTEnums.hpp:58
SPtr< VarDeclaration > VarDeclarationPtr
Definition Visitor.hpp:39
RegisterType
Definition ASTEnums.hpp:741
SPtr< BufferTypeDenoter > BufferTypeDenoterPtr
Definition TypeDenoter.hpp:33
UniqueFunction< bool(const Expression &expression) const > FindPredicateConstFunctor
Definition AST.hpp:56
SPtr< CodeBlock > CodeBlockPtr
Definition Visitor.hpp:30
CtrlTransfer
Definition ASTEnums.hpp:147
UniqueFunction< void(ExpressionPtr &expression, VarDeclaration *param) const > ExpressionIteratorFunctor
Definition AST.hpp:50
SPtr< Statement > StatementPtr
Definition Visitor.hpp:25
Intrinsic
Intrinsics function enumeration (currently only HLSL intrinsics).
Definition ASTEnums.hpp:980
SPtr< TypeDenoter > TypeDenoterPtr
Definition TypeDenoter.hpp:29
UniformBufferType
Definition ASTEnums.hpp:482
DataType
Definition ASTEnums.hpp:159
SPtr< SamplerTypeDenoter > SamplerTypeDenoterPtr
Definition TypeDenoter.hpp:34
bool isStatementAST(const AST::Types t)
bool isDeclarationStatementAST(const AST::Types t)
UniqueFunction< void(ExpressionPtr &argument, const TypeDenoter ¶mTypeDen) const > ArgumentParameterTypeFunctor
Definition AST.hpp:53
BufferType
Definition ASTEnums.hpp:492
SPtr< ElseStatement > ElseStatementPtr
Definition Visitor.hpp:59
SPtr< Declaration > DeclarationPtr
Definition Visitor.hpp:27
SearchFlags
Definition AST.hpp:40
@ SearchRValue
Definition AST.hpp:42
@ SearchAll
Definition AST.hpp:43
@ SearchLValue
Definition AST.hpp:41
SPtr< Attribute > AttributePtr
Definition Visitor.hpp:31
PrimitiveType
Definition ASTEnums.hpp:425
AssignOp
Definition ASTEnums.hpp:24
SamplerType
Definition ASTEnums.hpp:571
AttributeType
Definition ASTEnums.hpp:766
std::initializer_list< T > InitializerList
An object of type InitializerList<T> is a lightweight proxy object that provides access to an array o...
Definition InitializerList.hpp:40
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
std::int32_t Int32
Definition DataTypes.hpp:21
FunctionBase< false, true, fu2::capacity_default, true, false, Signatures... > FunctionView
A non owning copyable function wrapper for arbitrary callable types.
Definition Function.hpp:64
constexpr auto predicate(Callable &&callable) noexcept
Helper function to create a new predicate from a lambda.
Definition Predicate.hpp:390
std::uint32_t UInt32
Definition DataTypes.hpp:23
FunctionBase< true, false, fu2::capacity_default, true, false, Signatures... > UniqueFunction
An owning non copyable function wrapper for arbitrary callable types.
Definition Function.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::set< Key, Compare, ScopedAllocatorAdaptor< StdAllocator< Key, RawAllocator > > > Set
Set is an associative container that contains a sorted set of unique objects of type Key.
Definition Set.hpp:21
std::map< Key, T, Compare, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > Map
Map is a sorted associative container that contains key-value pairs with unique keys.
Definition Map.hpp:24
virtual void visit(Visitor *visitor, void *args=nullptr)=0
Types
Definition AST.hpp:79
@ VarDeclarationStatement
@ SamplerDeclarationStatement
@ BufferDeclarationStatement
@ UniformBufferDeclaration
@ TypeSpecifierExpression
@ BasicDeclarationStatement
@ AliasDeclarationStatement
@ isDeadCode
Definition AST.hpp:166
@ isReachable
Definition AST.hpp:164
@ isBuiltin
Definition AST.hpp:168
SourceArea area
Definition AST.hpp:172
static const T * getAs(const AST *ast)
Definition AST.hpp:189
const T * as() const
Definition AST.hpp:197
T * as()
Definition AST.hpp:194
RawFlags flags
Definition AST.hpp:173
static T * getAs(AST *ast)
Definition AST.hpp:184
virtual Types getType() const =0
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
AliasDeclarationStatement * declarationStatementRef
Definition AST.hpp:739
TypeDenoterPtr typeDenoter
Definition AST.hpp:738
StructDeclarationPtr structDeclaration
Definition AST.hpp:961
Vector< AliasDeclarationPtr > aliasDeclarations
Definition AST.hpp:962
void validateIndexBoundary(int idx) const
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
Int32 size
Definition AST.hpp:457
ExpressionPtr expression
Definition AST.hpp:456
bool hasDynamicSize() const
Vector< ExpressionPtr > arrayIndices
Definition AST.hpp:1306
std::size_t numIndices() const
const ObjectExpression * fetchLValueExpression() const override
Returns the first node in the expression tree that is an l-value (may also be constant!...
ExpressionPtr prefixExpression
Definition AST.hpp:1305
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
ExpressionPtr lvalueExpression
Definition AST.hpp:1247
ExpressionPtr rvalueExpression
Definition AST.hpp:1249
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
const ObjectExpression * fetchLValueExpression() const override
Returns the first node in the expression tree that is an l-value (may also be constant!...
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
AssignOp op
Definition AST.hpp:1248
Vector< ExpressionPtr > arguments
Definition AST.hpp:408
AttributeType attributeType
Definition AST.hpp:407
static AttributePtr findAttribute(const Vector< AttributePtr > &attributes, AttributeType type)
Definition TypeDenoter.hpp:238
DeclarationPtr declarationObject
Definition AST.hpp:889
BinaryOp op
Definition AST.hpp:1139
ExpressionPtr rhsExpression
Definition AST.hpp:1140
ExpressionPtr lhsExpression
Definition AST.hpp:1138
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
const ObjectExpression * fetchLValueExpression() const override
Returns the first node in the expression tree that is an l-value (may also be constant!...
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
IndexedSemantic fetchSemantic() const override
ExpressionPtr expression
Definition AST.hpp:1235
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
Vector< VarDeclarationStatementPtr > annotations
Definition AST.hpp:607
Vector< ArrayDimensionPtr > arrayDimensions
Definition AST.hpp:605
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
BufferType getBufferType() const
Vector< RegisterPtr > slotRegisters
Definition AST.hpp:606
@ isUsedForCompare
Definition AST.hpp:599
@ isUsedForImageRead
Definition AST.hpp:601
BufferDeclarationStatement * declarationStatementRef
Definition AST.hpp:609
BufferTypeDenoterPtr typeDenoter
Definition AST.hpp:867
Vector< BufferDeclarationPtr > bufferDeclarations
Definition AST.hpp:868
void collectDeclarationIdents(Map< const AST *, String > &declarationASTIdents) const override
IndexedSemantic fetchSemantic() const override
void forEachOutputArgument(const ExpressionIteratorFunctor &iterator)
void forEachArgumentWithParameterType(const ArgumentParameterTypeFunctor &iterator)
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
bool pushPrefixToArguments()
TypeDenoterPtr typeDenoter
Definition AST.hpp:1185
Vector< VarDeclaration * > defaultParamRefs
Definition AST.hpp:1190
Intrinsic intrinsic
Definition AST.hpp:1189
@ canInlineIntrinsicWrapper
Definition AST.hpp:1176
@ isWrapperCall
Definition AST.hpp:1179
FunctionDeclaration * funcDeclarationRef
Definition AST.hpp:1188
Vector< ExpressionPtr > arguments
Definition AST.hpp:1186
bool mergeArguments(std::size_t firstArgIndex, const MergeExpressionFunctor &mergeFunctor)
FunctionDeclaration * getFunctionImpl() const
bool popPrefixFromArguments()
Expression * getMemberFuncObjectExpression() const
String ident
Definition AST.hpp:1184
FunctionDeclaration * getFunctionDeclaration() const
ExpressionPtr prefixExpression
Definition AST.hpp:1182
void pushArgumentFront(const ExpressionPtr &expression)
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
bool isStatic
Definition AST.hpp:1183
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeSpecifierPtr typeSpecifier
Definition AST.hpp:1322
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
ExpressionPtr expression
Definition AST.hpp:1323
Vector< StatementPtr > statements
Definition AST.hpp:391
CodeBlockPtr codeBlock
Definition AST.hpp:976
CtrlTransfer transfer
Definition AST.hpp:1052
@ isWrittenTo
Definition AST.hpp:283
@ isReadFrom
Definition AST.hpp:285
Identifier ident
Definition AST.hpp:290
virtual String toString() const
virtual TypeSpecifier * fetchTypeSpecifier() const
ExpressionPtr condition
Definition AST.hpp:1002
StatementPtr bodyStatement
Definition AST.hpp:1001
StatementPtr bodyStatement
Definition AST.hpp:1018
virtual const ObjectExpression * fetchLValueExpression() const
Returns the first node in the expression tree that is an l-value (may also be constant!...
Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll)
const Expression * findFirstOf(const Types expressionType, UInt32 flags=SearchAll) const
virtual bool isTrivialCopyable(UInt32 maxTreeDepth=3) const
virtual const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const
Expression * findFirstOf(const Types expressionType, UInt32 flags=SearchAll)
ObjectExpression * fetchLValueExpression()
@ wasConverted
Definition AST.hpp:243
Expression * findFirstNotOf(const Types expressionType, UInt32 flags=SearchAll)
const Expression * findFirstNotOf(const Types expressionType, UInt32 flags=SearchAll) const
VarDeclaration * fetchVarDeclaration() const
virtual IndexedSemantic fetchSemantic() const
ExpressionPtr expression
Definition AST.hpp:1033
ExpressionPtr condition
Definition AST.hpp:984
StatementPtr initStatement
Definition AST.hpp:983
StatementPtr bodyStatement
Definition AST.hpp:986
ExpressionPtr iteration
Definition AST.hpp:985
Vector< VarDeclaration * > varDeclarationRefs
Definition AST.hpp:751
bool contains(const VarDeclaration *varDeclaration) const
Vector< VarDeclaration * > varDeclarationRefsSV
Definition AST.hpp:752
FunctionView< void(VarDeclaration *varDeclaration) const > IteratorFunc
Definition AST.hpp:749
void forEach(const IteratorFunc &iterator)
void updateDistribution()
void add(VarDeclaration *varDeclaration)
Expression * expression
Definition AST.hpp:766
VarDeclaration * varDeclaration
Definition AST.hpp:767
StructDeclaration * structDeclaration
Definition AST.hpp:768
bool matchParameterWithTypeDenoter(std::size_t paramIndex, const TypeDenoter &argType, bool implicitConversion) const
void setFuncImplRef(FunctionDeclaration *funcDeclaration)
static FunctionDeclaration * fetchFunctionDeclarationFromList(const Vector< FunctionDeclaration * > &funcDeclarationList, const String &ident, const Vector< TypeDenoterPtr > &argTypeDenoters, bool throwErrorIfNoMatch=true)
String toString() const override
bool hasVoidReturnType() const
Vector< VarDeclarationStatementPtr > annotations
Definition AST.hpp:783
bool isMemberFunction() const
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
@ isSecondaryEntryPoint
Definition AST.hpp:774
@ isEntryPoint
Definition AST.hpp:772
@ hasNonReturnControlPath
Definition AST.hpp:776
String toString(bool useParamNames) const
FunctionDeclaration * funcImplRef
Definition AST.hpp:790
IndexedSemantic semantic
Definition AST.hpp:782
ParameterSemantics inputSemantics
Definition AST.hpp:786
Vector< ParameterStructure > paramStructs
Definition AST.hpp:794
String toTypeDenoterString() const
TypeSpecifierPtr returnType
Definition AST.hpp:780
std::size_t numMinArgs() const
std::size_t numMaxArgs() const
BasicDeclarationStatement * declarationStatementRef
Definition AST.hpp:789
Vector< FunctionDeclaration * > funcForwardDeclarationRefs
Definition AST.hpp:791
Vector< VarDeclarationStatementPtr > parameters
Definition AST.hpp:781
ParameterSemantics outputSemantics
Definition AST.hpp:787
bool equalsSignature(const FunctionDeclaration &rhs, const RawFlags &compareFlags=0) const
bool isForwardDeclaration() const
CodeBlockPtr codeBlock
Definition AST.hpp:784
StructDeclaration * structDeclarationRef
Definition AST.hpp:792
StatementPtr bodyStatement
Definition AST.hpp:1010
ExpressionPtr condition
Definition AST.hpp:1009
ElseStatementPtr elseStatement
Definition AST.hpp:1011
Vector< ExpressionPtr > expressions
Definition AST.hpp:1334
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
void collectElements(Vector< ExpressionPtr > &elements) const
std::size_t numElementsUnrolled() const
ExpressionPtr fetchSubExpression(const Vector< int > &arrayIndices) const
bool nextArrayIndices(Vector< int > &arrayIndices) const
Definition ASTEnums.hpp:1432
bool isOutput
Definition AST.hpp:1059
bool isInput
Definition AST.hpp:1058
bool isSpaceRequiredForSubscript() const
void convertDataType(const DataType type)
String value
Definition AST.hpp:1089
String getLiteralValue(bool enableSuffix=true) const
String getStringValue() const
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
DataType dataType
Definition AST.hpp:1090
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
T * fetchSymbol() const
Definition AST.hpp:1288
Declaration * symbolRef
Definition AST.hpp:1270
bool isStatic
Definition AST.hpp:1268
void replaceSymbol(Declaration *symbol)
bool isTrivialCopyable(UInt32 maxTreeDepth=3) const override
String ident
Definition AST.hpp:1269
BaseTypeDenoterPtr getTypeDenoterFromSubscript() const
VarDeclaration * fetchVarDeclaration() const
IndexedSemantic fetchSemantic() const override
@ isBaseStructNamespace
Definition AST.hpp:1263
@ isImmutable
Definition AST.hpp:1261
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
String toStringAsNamespace() const
const ObjectExpression * fetchLValueExpression() const override
Returns the first node in the expression tree that is an l-value (may also be constant!...
ExpressionPtr prefixExpression
Definition AST.hpp:1267
String vectorComponent
Definition AST.hpp:447
String registerName
Definition AST.hpp:446
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
UnaryOp op
Definition AST.hpp:1163
ExpressionPtr expression
Definition AST.hpp:1162
UInt32 numThreads[3]
Definition AST.hpp:341
bool fragCoordUsed
Definition AST.hpp:330
bool earlyDepthStencil
Definition AST.hpp:336
bool pixelCenterInteger
Definition AST.hpp:333
UInt32 maxVertices
Definition AST.hpp:324
BufferType outputPrimitive
Definition AST.hpp:323
PrimitiveType inputPrimitive
Definition AST.hpp:322
UInt32 outputControlPoints
Definition AST.hpp:308
float maxTessFactor
Definition AST.hpp:309
FunctionDeclaration * patchConstFunctionRef
Definition AST.hpp:310
AttributeValue domainType
Definition AST.hpp:315
AttributeValue outputTopology
Definition AST.hpp:317
AttributeValue partitioning
Definition AST.hpp:316
LayoutTessControlShader layoutTessControl
Global program layout attributes for a tessellation-control shader.
Definition AST.hpp:363
const IntrinsicUsage * fetchIntrinsicUsage(const Intrinsic intrinsic) const
LayoutFragmentShader layoutFragment
Global program layout attributes for a fragment shader.
Definition AST.hpp:372
LayoutGeometryShader layoutGeometry
Global program layout attributes for a geometry shader.
Definition AST.hpp:369
void registerIntrinsicUsage(const Intrinsic intrinsic, const Vector< DataType > &argumentDataTypes)
FunctionDeclaration * entryPointRef
Reference to the entry point function declaration.
Definition AST.hpp:354
Set< MatrixSubscriptUsage > usedMatrixSubscripts
Set of all used matrix subscripts (filled by the reference analyzer).
Definition AST.hpp:360
SourceCodePtr sourceCode
Preprocessed source code.
Definition AST.hpp:351
LayoutComputeShader layoutCompute
Global program layout attributes for a compute shader.
Definition AST.hpp:375
LayoutTessEvaluationShader layoutTessEvaluation
Global program layout attributes for a tessellation-evaluation shader.
Definition AST.hpp:366
Map< Intrinsic, IntrinsicUsage > usedIntrinsics
Set of all used intrinsic (filled by the reference analyzer).
Definition AST.hpp:357
void registerIntrinsicUsage(const Intrinsic intrinsic, const Vector< ExpressionPtr > &arguments)
Vector< StatementPtr > globalStatements
Global declaration statements.
Definition AST.hpp:345
Vector< ASTPtr > disabledAST
AST nodes that have been disabled for code generation (not part of the default visitor).
Definition AST.hpp:348
Int32 set
Definition AST.hpp:432
ShaderTarget shaderTarget
Definition AST.hpp:430
static Register * getForTarget(const Vector< RegisterPtr > ®isters, const ShaderTarget shaderTarget)
Int32 slot
Definition AST.hpp:433
RegisterType registerType
Definition AST.hpp:431
ExpressionPtr expression
Definition AST.hpp:1045
@ isEndOfFunction
Definition AST.hpp:1041
SamplerType getSamplerType() const
Vector< RegisterPtr > slotRegisters
Definition AST.hpp:622
SamplerDeclarationStatement * declarationStatementRef
Definition AST.hpp:626
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
Vector< ArrayDimensionPtr > arrayDimensions
Definition AST.hpp:621
String textureIdent
Definition AST.hpp:623
Vector< SamplerValuePtr > samplerValues
Definition AST.hpp:624
SamplerTypeDenoterPtr typeDenoter
Definition AST.hpp:878
Vector< SamplerDeclarationPtr > samplerDeclarations
Definition AST.hpp:879
void collectDeclarationIdents(Map< const AST *, String > &declarationASTIdents) const override
String name
Definition AST.hpp:399
ExpressionPtr value
Definition AST.hpp:400
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
Vector< ExpressionPtr > expressions
Definition AST.hpp:1075
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
void append(const ExpressionPtr &expression)
String comment
Definition AST.hpp:216
virtual void collectDeclarationIdents(Map< const AST *, String > &declarationASTIdents) const
Vector< AttributePtr > attributes
Definition AST.hpp:217
void forEachVarDeclaration(const VarDeclarationIteratorFunctor &iterator, bool includeBaseStructs=true)
StructDeclaration * compatibleStructRef
Definition AST.hpp:661
bool isCastableTo(const BaseTypeDenoter &rhs) const
Vector< FunctionDeclarationPtr > funcMembers
Definition AST.hpp:657
Set< StructDeclaration * > parentStructDeclarationRefs
Definition AST.hpp:663
StructDeclaration * baseStructRef
Definition AST.hpp:660
String baseStructName
Definition AST.hpp:652
StructDeclaration * fetchBaseStructDeclaration(const String &ident)
VarDeclaration * fetchVarDeclaration(const String &ident, const StructDeclaration **owner=nullptr) const
Vector< VarDeclarationStatementPtr > varMembers
Definition AST.hpp:656
void addFlagsRecursiveParents(UInt32 structFlags)
Map< String, VarDeclaration * > systemValuesRef
Definition AST.hpp:662
@ isShaderOutput
Definition AST.hpp:641
@ isNestedStruct
Definition AST.hpp:643
@ isNonEntryPointParam
Definition AST.hpp:647
@ isShaderInput
Definition AST.hpp:639
Set< VarDeclaration * > shaderOutputVarDeclarationRefs
Definition AST.hpp:664
String fetchSimilar(const String &ident)
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
bool equalsMemberTypes(const StructDeclaration &rhs, const RawFlags &compareFlags=0) const
bool hasMultipleShaderOutputInstances() const
void collectMemberTypeDenoters(Vector< TypeDenoterPtr > &memberTypeDens, bool includeBaseStructs=true) const
bool isClass
Definition AST.hpp:651
Vector< StatementPtr > localStatements
Definition AST.hpp:653
VarDeclaration * indexToMemberVar(std::size_t idx, bool includeBaseStructs=true) const
bool hasNonSystemValueMembers() const
BasicDeclarationStatement * declarationStatementRef
Definition AST.hpp:659
String toString() const override
std::size_t memberVarToIndex(const VarDeclaration *varDeclaration, bool includeBaseStructs=true) const
VarDeclaration * fetchBaseMember() const
bool accumulateAlignedVectorSize(UInt32 &size, UInt32 &padding, UInt32 *offset=nullptr)
bool isBaseOf(const StructDeclaration *subStructDeclaration, bool includeSelf=false) const
void addFlagsRecursive(UInt32 structFlags)
std::size_t numMemberVariables(bool onlyNonStaticMembers=false) const
FunctionDeclaration * fetchFunctionDeclaration(const String &ident, const Vector< TypeDenoterPtr > &argTypeDenoters, const StructDeclaration **owner=nullptr, bool throwErrorIfNoMatch=false) const
std::size_t numMemberFunctions(bool onlyNonStaticMembers=false) const
void addShaderOutputInstance(VarDeclaration *varDeclaration)
ExpressionPtr expression
Definition AST.hpp:419
Vector< StatementPtr > statements
Definition AST.hpp:420
bool isDefaultCase() const
ExpressionPtr selector
Definition AST.hpp:1025
Vector< SwitchCasePtr > cases
Definition AST.hpp:1026
ExpressionPtr condExpression
Definition AST.hpp:1123
ExpressionPtr thenExpression
Definition AST.hpp:1124
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
bool isVectorCondition() const
ExpressionPtr elseExpression
Definition AST.hpp:1125
Definition TypeDenoter.hpp:82
TypeSpecifierPtr typeSpecifier
Definition AST.hpp:1114
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
void swapMatrixStorageLayout(const TypeModifier defaultStorgeLayout)
bool hasAnyStorageClassOf(const InitializerList< StorageClass > &modifiers) const
Set< StorageClass > storageClasses
Definition AST.hpp:483
StructDeclarationPtr structDeclaration
Definition AST.hpp:487
bool hasAnyTypeModifierOf(const InitializerList< TypeModifier > &modifiers) const
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
bool isUniform
Definition AST.hpp:481
Set< TypeModifier > typeModifiers
Definition AST.hpp:485
TypeDenoterPtr typeDenoter
Definition AST.hpp:489
StructDeclaration * getStructDeclarationRef()
bool isOutput
Definition AST.hpp:480
bool isConstOrUniform() const
PrimitiveType primitiveType
Definition AST.hpp:486
void setTypeModifier(const TypeModifier modifier)
bool isInput
Definition AST.hpp:479
Set< InterpModifier > interpModifiers
Definition AST.hpp:484
TypeDenoterPtr mBufferedTypeDenoter
Definition AST.hpp:237
virtual TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter)=0
const TypeDenoterPtr & getTypeDenoter(const TypeDenoter *expectedTypeDenoter=nullptr)
UnaryOp op
Definition AST.hpp:1150
const ObjectExpression * fetchLValueExpression() const override
Returns the first node in the expression tree that is an l-value (may also be constant!...
ExpressionPtr expression
Definition AST.hpp:1151
const Expression * find(const FindPredicateConstFunctor &predicate, UInt32 flags=SearchAll) const override
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
Vector< RegisterPtr > slotRegisters
Definition AST.hpp:546
Vector< VarDeclarationStatementPtr > annotations
Definition AST.hpp:549
void addFlagsRecursive(UInt32 varFlags)
TypeDenoterPtr deriveTypeDenoter(const TypeDenoter *expectedTypeDenoter) override
TypeSpecifier * fetchTypeSpecifier() const override
ExpressionPtr initializer
Definition AST.hpp:550
PackOffsetPtr packOffset
Definition AST.hpp:548
ObjectExpressionPtr namespaceExpression
Definition AST.hpp:544
bool hasStaticConstInitializer() const
String toString() const override
bool accumulateAlignedVectorSize(UInt32 &size, UInt32 &padding, UInt32 *offset=nullptr)
@ isDynamicArray
Definition AST.hpp:531
@ isShaderInput
Definition AST.hpp:525
@ IsShaderInputSv
Definition AST.hpp:538
@ IsShaderOutputSv
Definition AST.hpp:540
@ isEntryPointOutput
Definition AST.hpp:533
@ isShaderOutput
Definition AST.hpp:527
@ isEntryPointLocal
Definition AST.hpp:535
@ isSystemValue
Definition AST.hpp:529
Vector< ArrayDimensionPtr > arrayDimensions
Definition AST.hpp:545
VarDeclaration * fetchStaticVarDefRef() const
UniformBufferDeclaration * bufferDeclarationRef
Definition AST.hpp:556
VarDeclaration * fetchStaticVarDeclarationRef() const
StructDeclaration * structDeclarationRef
Definition AST.hpp:557
Variant initializerValue
Definition AST.hpp:553
VarDeclaration * staticMemberVarRef
Definition AST.hpp:558
TypeDenoterPtr customTypeDenoter
Definition AST.hpp:552
VarDeclarationStatement * declarationStatementRef
Definition AST.hpp:555
void setCustomTypeDenoter(const TypeDenoterPtr &typeDenoter)
IndexedSemantic semantic
Definition AST.hpp:547
bool hasAnyTypeModifierOf(const InitializerList< TypeModifier > &modifiers) const
void forEachVarDeclaration(const VarDeclarationIteratorFunctor &iterator)
void collectDeclarationIdents(Map< const AST *, String > &declarationASTIdents) const override
VarDeclaration * fetchVarDeclaration(const String &ident) const
StructDeclaration * fetchStructDeclarationRef() const
String toString(bool useVarNames=true) const
bool accumulateAlignedVectorSize(UInt32 &size, UInt32 &padding, UInt32 *offset=nullptr)
void setTypeModifier(const TypeModifier modifier)
TypeSpecifierPtr typeSpecifier
Definition AST.hpp:911
@ isSelfParameter
Definition AST.hpp:903
@ isShaderOutput
Definition AST.hpp:899
@ isBaseMember
Definition AST.hpp:905
@ isImplicitConst
Definition AST.hpp:907
@ isParameter
Definition AST.hpp:901
@ isShaderInput
Definition AST.hpp:897
Vector< VarDeclarationPtr > varDeclarations
Definition AST.hpp:912
bool isConstOrUniform() const
VarDeclaration * fetchUniqueVarDeclaration() const
ExpressionPtr condition
Definition AST.hpp:993
StatementPtr bodyStatement
Definition AST.hpp:994