Class ThrowTarget<T extends JobParameters>
java.lang.Object
io.github.douira.glsl_transformer.GLSLParserBaseListener
io.github.douira.glsl_transformer.transform.TransformationPhase<T>
io.github.douira.glsl_transformer.core.target.HandlerTarget<T>
io.github.douira.glsl_transformer.core.target.HandlerTargetImpl<T>
io.github.douira.glsl_transformer.core.target.ThrowTarget<T>
- All Implemented Interfaces:
io.github.douira.glsl_transformer.GLSLParserListener,LifecycleUser<T>,PartialParseTreeListener,ParseTreeListener
- Direct Known Subclasses:
ThrowTargetImpl,WrapThrowTarget
A target that searches for a search string in and upon finding a match uses a
method to generate a string for a semantic exception which is then thrown.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.douira.glsl_transformer.transform.TransformationPhase
TransformationPhase.InjectionPoint -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new throw target with no search string.ThrowTarget(String needle) Creates a new throw target with a given search string -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringgetMessage(TreeMember node, String match) Generates the exception when this target is found.voidhandleResult(TreeMember node, String match) Handles the containing node and token that the string was found in.Methods inherited from class io.github.douira.glsl_transformer.core.target.HandlerTargetImpl
getNeedleMethods inherited from class io.github.douira.glsl_transformer.core.target.HandlerTarget
canWalk, setPlannerMethods inherited from class io.github.douira.glsl_transformer.transform.TransformationPhase
checkBeforeWalk, compilePath, compilePattern, createLocalRoot, findAndMatch, getPlanner, getSiblings, injectDefine, injectExternalDeclaration, injectExternalDeclarations, injectNode, injectNodes, injectNodes, isActive, isInitialized, removeNode, replaceNode, replaceNode, runAfterWalk, setInitialized, walkFinishedMethods inherited from class io.github.douira.glsl_transformer.GLSLParserBaseListener
enterAdditiveExpression, enterArrayAccessExpression, enterArraySpecifier, enterArraySpecifierSegment, enterAssignmentExpression, enterAtomicUnitType, enterAttribute, enterBitwiseAndExpression, enterBitwiseExclusiveOrExpression, enterBitwiseInclusiveOrExpression, enterBooleanType, enterBooleanVectorType, enterBreakStatement, enterBuiltinType, enterCallParameterList, enterCompoundStatement, enterConditionalExpression, enterContinueStatement, enterDeclarationMember, enterDeclarationStatement, enterDefaultCaseLabel, enterDemoteStatement, enterDiscardStatement, enterDoWhileStatement, enterEmptyDeclaration, enterEmptyStatement, enterEqualityExpression, enterEveryRule, enterExpressionStatement, enterExtensionStatement, enterExternalDeclaration, enterFloatMatrixType, enterFloatType, enterFloatVectorType, enterForStatement, enterFullySpecifiedType, enterFunctionCall, enterFunctionCallExpression, enterFunctionDeclaration, enterFunctionDefinition, enterFunctionHeader, enterFunctionIdentifier, enterFunctionParameterList, enterFunctionPrototype, enterGroupingExpression, enterImageType, enterInitDeclaratorList, enterInitializer, enterIntegerType, enterIntegerVectorType, enterInterfaceBlockDeclaration, enterInterpolationQualifier, enterInvariantQualifier, enterIterationCondition, enterLayoutDefaults, enterLayoutQualifier, enterLiteralExpression, enterLogicalAndExpression, enterLogicalExclusiveOrExpression, enterLogicalInclusiveOrExpression, enterMemberAccessExpression, enterMethodCall, enterMethodCallExpression, enterMultiplicativeExpression, enterNamedLayoutQualifier, enterParameterDeclaration, enterParameterDeclarator, enterPostfixExpression, enterPragmaStatement, enterPreciseQualifier, enterPrecisionDeclaration, enterPrecisionQualifier, enterPrefixExpression, enterReferencedType, enterReferenceExpression, enterRelationalExpression, enterReturnStatement, enterSamplerType, enterSelectionStatement, enterSequenceExpression, enterSharedLayoutQualifier, enterShiftExpression, enterSingleAttribute, enterStatement, enterStorageQualifier, enterStructBody, enterStructDeclarator, enterStructMember, enterStructSpecifier, enterStructSpecifierType, enterSwitchStatement, enterTranslationUnit, enterTypeAndInitDeclaration, enterTypeNameList, enterTypeQualifier, enterTypeSpecifier, enterValuedCaseLabel, enterVariableDeclaration, enterVariableIdentifier, enterVersionStatement, enterVoidType, enterWhileStatement, exitAdditiveExpression, exitArrayAccessExpression, exitArraySpecifier, exitArraySpecifierSegment, exitAssignmentExpression, exitAtomicUnitType, exitAttribute, exitBitwiseAndExpression, exitBitwiseExclusiveOrExpression, exitBitwiseInclusiveOrExpression, exitBooleanType, exitBooleanVectorType, exitBreakStatement, exitBuiltinType, exitCallParameterList, exitCompoundStatement, exitConditionalExpression, exitContinueStatement, exitDeclarationMember, exitDeclarationStatement, exitDefaultCaseLabel, exitDemoteStatement, exitDiscardStatement, exitDoWhileStatement, exitEmptyDeclaration, exitEmptyStatement, exitEqualityExpression, exitEveryRule, exitExpressionStatement, exitExtensionStatement, exitExternalDeclaration, exitFloatMatrixType, exitFloatType, exitFloatVectorType, exitForStatement, exitFullySpecifiedType, exitFunctionCall, exitFunctionCallExpression, exitFunctionDeclaration, exitFunctionDefinition, exitFunctionHeader, exitFunctionIdentifier, exitFunctionParameterList, exitFunctionPrototype, exitGroupingExpression, exitImageType, exitInitDeclaratorList, exitInitializer, exitIntegerType, exitIntegerVectorType, exitInterfaceBlockDeclaration, exitInterpolationQualifier, exitInvariantQualifier, exitIterationCondition, exitLayoutDefaults, exitLayoutQualifier, exitLiteralExpression, exitLogicalAndExpression, exitLogicalExclusiveOrExpression, exitLogicalInclusiveOrExpression, exitMemberAccessExpression, exitMethodCall, exitMethodCallExpression, exitMultiplicativeExpression, exitNamedLayoutQualifier, exitParameterDeclaration, exitParameterDeclarator, exitPostfixExpression, exitPragmaStatement, exitPreciseQualifier, exitPrecisionDeclaration, exitPrecisionQualifier, exitPrefixExpression, exitReferencedType, exitReferenceExpression, exitRelationalExpression, exitReturnStatement, exitSamplerType, exitSelectionStatement, exitSequenceExpression, exitSharedLayoutQualifier, exitShiftExpression, exitSingleAttribute, exitStatement, exitStorageQualifier, exitStructBody, exitStructDeclarator, exitStructMember, exitStructSpecifier, exitStructSpecifierType, exitSwitchStatement, exitTranslationUnit, exitTypeAndInitDeclaration, exitTypeNameList, exitTypeQualifier, exitTypeSpecifier, exitValuedCaseLabel, exitVariableDeclaration, exitVariableIdentifier, exitVersionStatement, exitVoidType, exitWhileStatement, visitErrorNode, visitTerminalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.douira.glsl_transformer.transform.LifecycleUser
getJobParameters, getLexer, getParser, getRootNode, init, initOnce, resetStateMethods inherited from interface org.antlr.v4.runtime.tree.ParseTreeListener
enterEveryRule, exitEveryRule, visitErrorNode, visitTerminalMethods inherited from interface io.github.douira.glsl_transformer.traversal.PartialParseTreeListener
isDeepEnough, isFinished
-
Constructor Details
-
ThrowTarget
Creates a new throw target with a given search string- Parameters:
needle- The search string
-
ThrowTarget
protected ThrowTarget()Creates a new throw target with no search string. TheHandlerTargetImpl.getNeedle()method should be overwritten if this constructor is used.- See Also:
-
-
Method Details
-
getMessage
Generates the exception when this target is found.- Parameters:
node- The node that contains the tokenmatch- The token text that contains the needle- Returns:
- The semantic exception to throw
-
handleResult
Description copied from class:HandlerTargetHandles the containing node and token that the string was found in.- Specified by:
handleResultin classHandlerTarget<T extends JobParameters>- Parameters:
node- The node that contains the tokenmatch- The token text that contains the needle
-