Top Description Constructors Methods
org.codehaus.groovy.syntax

public Class TokenUtil

extends Object
Class Inheritance
Imports
java.util.Optional

Utility methods for working with Tokens.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Optional<Token>
asAssignment(int op)

public static int

Returns:

token without assignment, or the original token if it was not an assignment operator
removeAssignment
(int
token for which to remove assignment
op
)

Removes the assignment portion of a given token.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TokenUtilback to summary
private TokenUtil()

Method Detail

asAssignmentback to summary
public static Optional<Token> asAssignment(int op)
removeAssignmentback to summary
public static int removeAssignment(int op)

Removes the assignment portion of a given token. If the given token is not an operator with assignment, the given token is returned.

Parameters
op:int

token for which to remove assignment

Returns:int

token without assignment, or the original token if it was not an assignment operator