Class ParsableASTNode

All Implemented Interfaces:
MoveCheckable, TreeMember, ParseTree, SyntaxTree, TerminalNode, Tree
Direct Known Subclasses:
Tensor

public abstract class ParsableASTNode extends ASTNode
The parsable a AST node defines how AST nodes that can be converted back into parse tree nodes are handled. The construction of AST nodes can vary a lot and is not defined here.
  • Constructor Details

    • ParsableASTNode

      public ParsableASTNode()
  • Method Details

    • getOutputParseMethod

      protected abstract Function<io.github.douira.glsl_transformer.GLSLParser,ExtendedContext> getOutputParseMethod()
      This method is overwritten by the implementing class to specify with which parser method the generated string should be parsed.
      Returns:
      A method reference from GLSLParser
    • getParsed

      public ExtendedContext getParsed()
      Parses this AST node's generated code into a parse tree node without attaching a parent node.
      Returns:
      The AST node's code parsed into a node
      See Also:
    • getParsed

      public ExtendedContext getParsed(ExtendedContext parent)
      Parses the code generated by this AST node with the parser method supplied by getOutputParseMethod() into a parse tree node..
      Parameters:
      parent - The parent node to attach to the parsed node
      Returns:
      The AST node's code parsed into a node