Class StringNode

All Implemented Interfaces:
TreeMember, org.antlr.v4.runtime.tree.ParseTree, org.antlr.v4.runtime.tree.SyntaxTree, org.antlr.v4.runtime.tree.TerminalNode, org.antlr.v4.runtime.tree.Tree
Direct Known Subclasses:
Directive

public class StringNode extends UnparsableASTNode
String node provides a terminal node with arbitrary contents. This is useful for inserting strings into the printed code such as comments. Only use this terminal node for non-parsed tokens like comments, whitespace or preprocessor directives. For all other syntax features, use the local roots system. Parse tree search doesn't work inside string nodes as they are not parsed.
See Also:
  • Field Summary

    Fields inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl

    parent, symbol
  • Constructor Summary

    Constructors
    Constructor
    Description
    StringNode(String content)
    Creates a new string node with the given string content.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Returns the string node's content.
    protected String
    Generates the string representation of this AST object as it would be in the generated code.

    Methods inherited from class io.github.douira.glsl_transformer.ast.UnparsableASTNode

    getText

    Methods inherited from class io.github.douira.glsl_transformer.generic.ExtendedTerminalNode

    getParent, omitTokens

    Methods inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl

    accept, getChild, getChildCount, getPayload, getSourceInterval, getSymbol, setParent, toString, toStringTree, toStringTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.antlr.v4.runtime.tree.ParseTree

    accept, getChild, setParent, toStringTree

    Methods inherited from interface org.antlr.v4.runtime.tree.SyntaxTree

    getSourceInterval

    Methods inherited from interface org.antlr.v4.runtime.tree.Tree

    getChildCount, getPayload, toStringTree
  • Constructor Details

    • StringNode

      public StringNode(String content)
      Creates a new string node with the given string content.
      Parameters:
      content - The string to create a token for
  • Method Details

    • getPrinted

      protected String getPrinted()
      Description copied from class: ASTNode
      Generates the string representation of this AST object as it would be in the generated code.
      Specified by:
      getPrinted in class ASTNode
      Returns:
      The printed string for this AST object
    • getContent

      protected String getContent()
      Returns the string node's content.
      Returns:
      The content