Class StringNode

All Implemented Interfaces:
MoveCheckable, TreeMember, ParseTree, SyntaxTree, TerminalNode, 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:
  • 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