Class AssertingEnumerator

java.lang.Object
codeanalysis.syntax.AssertingEnumerator
All Implemented Interfaces:
AutoCloseable

public class AssertingEnumerator extends Object implements AutoCloseable
The AssertingEnumerator class contains methods for asserting the syntax tree. It ensures that the syntax tree is correctly implemented.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Constructor Details

    • AssertingEnumerator

      public AssertingEnumerator(SyntaxNode node)
      Creates a new instance of the AssertingEnumerator class with the specified syntax node.
      Parameters:
      node - The syntax node.
  • Method Details

    • close

      public void close()
      Closes the AssertingEnumerator instance.
      Specified by:
      close in interface AutoCloseable
    • assertNode

      public void assertNode(SyntaxType type)
      Asserts that the next node is of the specified type.
      Parameters:
      type - The syntax type of the node.
    • assertToken

      public void assertToken(SyntaxType type, String text)
      Asserts that the next node is of the specified type and has the specified text.
      Parameters:
      type - The syntax type of the node.
      text - The text of the node.