Interface GlslNode

All Known Subinterfaces:
GlslConstantNode, GlslRootNode
All Known Implementing Classes:
GlslAssignmentNode, GlslBitwiseNode, GlslBoolConstantNode, GlslCaseLabelNode, GlslCompareNode, GlslCompoundNode, GlslConditionalNode, GlslDoubleConstantNode, GlslEmptyNode, GlslFloatConstantNode, GlslForLoopNode, GlslFunctionNode, GlslGetArrayNode, GlslGetFieldNode, GlslIfNode, GlslIntConstantNode, GlslInvokeFunctionNode, GlslJumpNode, GlslNewFieldNode, GlslOperationNode, GlslPrecisionNode, GlslPrimitiveConstructorNode, GlslReturnNode, GlslStructDeclarationNode, GlslSwitchNode, GlslUnaryNode, GlslVariableDeclarationNode, GlslVariableNode, GlslWhileLoopNode

@NonExtendable public interface GlslNode
Represents a single operation in a GlslTree.
Since:
1.0.0
  • Method Details

    • toSourceString

      default String toSourceString()
      Returns:
      This node represented as a string
      See Also:
    • visit

      void visit(GlslNodeVisitor visitor)
      Visits this node.
      Parameters:
      visitor - The visitor visiting this node
    • getNodeType

      GlslNodeType getNodeType()
      Returns:
      The type of node this class represents
    • getType

      @Nullable default @Nullable GlslSpecifiedType getType()
      Returns:
      The type of this node if it is a field
    • toList

      default List<GlslNode> toList()
      Returns:
      A new list with the child contents of this node
    • getBody

      @Nullable default @Nullable GlslNodeList getBody()
      Returns:
      The body of this node or null if there is no sub-body in this node
    • setBody

      default boolean setBody(Collection<GlslNode> body)
      Sets the body of this node.
      Parameters:
      body - The new body
      Returns:
      Whether the action was successful
    • setBody

      default boolean setBody(GlslNode... body)
      Sets the body of this node.
      Parameters:
      body - The new body
      Returns:
      Whether the action was successful
    • stream

      Stream<GlslNode> stream()
    • intConstant

      static GlslIntConstantNode intConstant(int value)
    • unsignedIntConstant

      static GlslIntConstantNode unsignedIntConstant(int value)
    • floatConstant

      static GlslFloatConstantNode floatConstant(float value)
    • doubleConstant

      static GlslDoubleConstantNode doubleConstant(double value)
    • booleanConstant

      static GlslBoolConstantNode booleanConstant(boolean value)
    • compound

      static GlslNode compound(Collection<GlslNode> nodes)
    • compound

      static GlslNode compound(GlslNode... nodes)