MCPcopy Index your code
hub / github.com/apache/groovy / GeneralUtils

Class GeneralUtils

src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java:128–2463  ·  view source on GitHub ↗

Handy methods when working with the Groovy AST. Provides factory methods for creating common AST nodes and utility methods for expression and statement construction. This utility class offers shorthand methods (often with abbreviated names) for building AST structures: Statement const

Source from the content-addressed store, hash-verified

126 * @see GenericsUtils for generic type utilities
127 */
128public class GeneralUtils {
129 /**
130 * AST assignment operator token ("=").
131 */
132 public static final Token ASSIGN = Token.newSymbol(Types.ASSIGN , -1, -1);
133 /**
134 * AST compare-to operator token ("<=>").
135 */
136 public static final Token CMP = Token.newSymbol(Types.COMPARE_TO , -1, -1);
137 /**
138 * AST equality operator token ("==").
139 */
140 public static final Token EQ = Token.newSymbol(Types.COMPARE_EQUAL , -1, -1);
141 /**
142 * AST inequality operator token ("!=").
143 */
144 public static final Token NE = Token.newSymbol(Types.COMPARE_NOT_EQUAL , -1, -1);
145 /**
146 * AST non-identity operator token ("!==").
147 */
148 public static final Token NOT_IDENTICAL = Token.newSymbol(Types.COMPARE_NOT_IDENTICAL , -1, -1);
149 /**
150 * AST greater-than-or-equal operator token (">=").
151 */
152 public static final Token GE = Token.newSymbol(Types.COMPARE_GREATER_THAN_EQUAL, -1, -1);
153 /**
154 * AST greater-than operator token (">").
155 */
156 public static final Token GT = Token.newSymbol(Types.COMPARE_GREATER_THAN , -1, -1);
157 /**
158 * AST less-than-or-equal operator token ("<=").
159 */
160 public static final Token LE = Token.newSymbol(Types.COMPARE_LESS_THAN_EQUAL , -1, -1);
161 /**
162 * AST less-than operator token ("<").
163 */
164 public static final Token LT = Token.newSymbol(Types.COMPARE_LESS_THAN , -1, -1);
165 /**
166 * AST logical AND operator token ("&&").
167 */
168 public static final Token AND = Token.newSymbol(Types.LOGICAL_AND , -1, -1);
169 /**
170 * AST logical OR operator token ("||").
171 */
172 public static final Token OR = Token.newSymbol(Types.LOGICAL_OR , -1, -1);
173 /**
174 * AST instanceof keyword token.
175 */
176 public static final Token INSTANCEOF = Token.newSymbol(Types.KEYWORD_INSTANCEOF , -1, -1);
177 /**
178 * AST subtraction operator token ("-").
179 */
180 public static final Token MINUS = Token.newSymbol(Types.MINUS , -1, -1);
181 /**
182 * AST addition operator token ("+").
183 */
184 public static final Token PLUS = Token.newSymbol(Types.PLUS , -1, -1);
185

Callers

nothing calls this directly

Calls 1

newSymbolMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…