Trait glsl::visitor::Host [−][src]
Part of the AST that can be visited.
You shouldn’t have to worry about this type nor how to implement it – it’s completely
implemented for you. However, it works in a pretty simple way: any implementor of Host
can
be used with a Visitor
.
The idea is that visiting an AST node is a two-step process:
- First, you can get your visitor called once as soon as an interesting node gets visited. For instance, if your visitor has an implementation for visiting expressions, everytime an expression gets visited, your visitor will run.
- If your implementation of visiting an AST node returns
Visit::Children
and if the given node has children, the visitor will go deeper, invoking other calls if you have defined any. A typical pattern you might want to do is to implement your visitor to gets run on all typenames. Since expressions contains variables, you will get your visitor called once again there. - Notice that since visitors are mutable, you can accumulate a state as you go deeper in the AST to implement various checks and validations.
Required methods
Loading content...Implementations on Foreign Types
impl<T> Host for Option<T> where
T: Host,
[src]
impl<T> Host for Option<T> where
T: Host,
[src]impl<T> Host for Box<T> where
T: Host,
[src]
impl<T> Host for Box<T> where
T: Host,
[src]Implementors
impl Host for ExternalDeclaration
[src]
impl Host for ExternalDeclaration
[src]impl Host for FunctionParameterDeclaration
[src]
impl Host for FunctionParameterDeclaration
[src]impl Host for InterpolationQualifier
[src]
impl Host for InterpolationQualifier
[src]impl Host for IterationStatement
[src]
impl Host for IterationStatement
[src]impl Host for LayoutQualifierSpec
[src]
impl Host for LayoutQualifierSpec
[src]impl Host for PrecisionQualifier
[src]
impl Host for PrecisionQualifier
[src]impl Host for PreprocessorDefine
[src]
impl Host for PreprocessorDefine
[src]impl Host for PreprocessorExtensionBehavior
[src]
impl Host for PreprocessorExtensionBehavior
[src]impl Host for PreprocessorExtensionName
[src]
impl Host for PreprocessorExtensionName
[src]impl Host for PreprocessorVersionProfile
[src]
impl Host for PreprocessorVersionProfile
[src]impl Host for SelectionRestStatement
[src]
impl Host for SelectionRestStatement
[src]impl Host for TypeSpecifierNonArray
[src]
impl Host for TypeSpecifierNonArray
[src]impl Host for FullySpecifiedType
[src]
impl Host for FullySpecifiedType
[src]impl Host for FunctionDefinition
[src]
impl Host for FunctionDefinition
[src]impl Host for FunctionParameterDeclarator
[src]
impl Host for FunctionParameterDeclarator
[src]impl Host for InitDeclaratorList
[src]
impl Host for InitDeclaratorList
[src]impl Host for PreprocessorElseIf
[src]
impl Host for PreprocessorElseIf
[src]impl Host for PreprocessorExtension
[src]
impl Host for PreprocessorExtension
[src]impl Host for PreprocessorIfNDef
[src]
impl Host for PreprocessorIfNDef
[src]impl Host for PreprocessorInclude
[src]
impl Host for PreprocessorInclude
[src]impl Host for PreprocessorPragma
[src]
impl Host for PreprocessorPragma
[src]impl Host for PreprocessorVersion
[src]
impl Host for PreprocessorVersion
[src]impl Host for SelectionStatement
[src]
impl Host for SelectionStatement
[src]impl Host for SingleDeclarationNoType
[src]
impl Host for SingleDeclarationNoType
[src]impl Host for StructFieldSpecifier
[src]
impl Host for StructFieldSpecifier
[src]