Package codeanalysis.syntax
Class AssertingEnumerator
java.lang.Object
codeanalysis.syntax.AssertingEnumerator
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a new instance of the AssertingEnumerator class with the specified syntax node. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertNode(SyntaxType type) Asserts that the next node is of the specified type.voidassertToken(SyntaxType type, String text) Asserts that the next node is of the specified type and has the specified text.voidclose()Closes the AssertingEnumerator instance.
-
Constructor Details
-
AssertingEnumerator
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:
closein interfaceAutoCloseable
-
assertNode
Asserts that the next node is of the specified type.- Parameters:
type- The syntax type of the node.
-
assertToken
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.
-