Class SyntaxNode

java.lang.Object
codeanalysis.syntax.SyntaxNode
Direct Known Subclasses:
ExpressionSyntax, SyntaxToken

public abstract class SyntaxNode extends Object
The base class for syntax nodes in a code analysis system.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Field Details

  • Constructor Details

    • SyntaxNode

      public SyntaxNode()
  • Method Details

    • getType

      public abstract SyntaxType getType()
      Gets the type of the syntax node.
      Returns:
      The syntax type of the node.
    • getChildren

      public abstract Iterator<SyntaxNode> getChildren()
      Gets an iterator over the child nodes of the syntax node.
      Returns:
      An iterator over the child nodes.
    • getSpan

      public TextSpan getSpan()
      Gets the span of the syntax node.
      Returns:
      The span of the syntax node.
    • writeTo

      public void writeTo(Writer writer) throws IOException
      Writes the syntax tree to the specified writer.
      Parameters:
      writer - The writer to write the tree to.
      Throws:
      IOException - If an I/O error occurs.
    • toString

      public String toString()
      Gets the value associated with the syntax node.
      Overrides:
      toString in class Object
      Returns:
      The value associated with the syntax node.