public final class ConverterHelper extends AbstractPatternWorker implements JavaTokenTypes
Modifier and Type | Class and Description |
---|---|
class |
ConverterHelper.Helper
Exports helper user-functions to pattern engine rules for Progress to
Java conversion.
|
resolver
ANNOTATION, ANON_CTOR, ASSIGN, BEGIN_DOCTAGS, BITWISE_AND, BITWISE_OR, BITWISE_XOR, BLOCK, BLOCK_DEF, BOGUS, BOOL_FALSE, BOOL_TRUE, CAST, CHAR_LITERAL, CLASS_REFERENCE, COMPILE_UNIT, COMPLEMENT, CONSTRUCTOR, CS_BEGIN, CS_CONSTANTS, CS_CONSTRUCTORS, CS_END, CS_INNER_CLASSES, CS_INSTANCE_METHODS, CS_INSTANCE_VARS, CS_STATIC_INITS, CS_STATIC_METHODS, CS_STATIC_VARS, DEC_LITERAL, DECREMENT, DIVIDE, DO_WHILE, DOC_COMMENT, DOC_HTML, DOC_PARAGRAPH, DOC_TEXTRUN, DOCTAG_LINK, DOCTAG_PARAM, DOCTAG_RETURN, ELSE_IF, END_DOCTAGS, EQUALS, EXPRESSION, GT, GTE, HEX_LITERAL, INCREMENT, INDENT_GRP, INITIALIZER, KW_ABSTRACT, KW_ASSERT, KW_BOOLEAN, KW_BREAK, KW_BYTE, KW_CASE, KW_CATCH, KW_CHAR, KW_CLASS, KW_CONST, KW_CONTINUE, KW_DEFAULT, KW_DO, KW_DOUBLE, KW_ELSE, KW_ENUM, KW_EXTENDS, KW_FINAL, KW_FINALLY, KW_FLOAT, KW_FOR, KW_GOTO, KW_IF, KW_IMPLEMENTS, KW_IMPORT, KW_INSTANCEOF, KW_INT, KW_INTERFACE, KW_LONG, KW_NATIVE, KW_NEW, KW_PACKAGE, KW_PRIVATE, KW_PROTECTED, KW_PUBLIC, KW_RETURN, KW_SHORT, KW_STATIC, KW_STRICTFP, KW_SUPER, KW_SWITCH, KW_SYNCHRONIZED, KW_THIS, KW_THROW, KW_THROWS, KW_TRANSIENT, KW_TRY, KW_VOID, KW_VOLATILE, KW_WHILE, LABEL, LABEL_DEF, LAMBDA, LBRACKET, LOGICAL_AND, LOGICAL_NOT, LOGICAL_OR, LPARENS, LSHIFT, LT, LTE, MEMBER, METHOD_CALL, METHOD_DECL, METHOD_DEF, MINUS, MINUS_ASSIGN, MODULO, MULTIPLY, NOT_EQ, NULL_LITERAL, NUM_LITERAL, OR_ELSE_IF, PLACEHOLDER, PLUS, PLUS_ASSIGN, REFERENCE, REFERENCE_DEF, RSHIFT, SKIP, SLASH_COMMENT, STAR_COMMENT, STATIC_IMPORT, STATIC_METHOD_CALL, STRING, SYMBOL, TERN_IF_ELSE, THEN, UN_MINUS, UN_PLUS, UNRECOGNIZED, ZERO_RSHIFT
Constructor and Description |
---|
ConverterHelper()
Default constructor which initializes libraries.
|
Modifier and Type | Method and Description |
---|---|
static JavaAst |
createImport(java.lang.String text,
boolean stat,
JavaAst jroot,
AstSymbolResolver resolver)
Creates an import statement (
KW_IMPORT with text as the
package/class to import) or a static import statement
(STATIC_IMPORT with text as the class members to import)
and attaches it to the specified parent, IF an equivalent import
statement does not already exist. |
finish, getCopy, getLibrary, getSource, initialize, registerTree, resolveConstant, setLibrary, visitAst
public ConverterHelper()
public static JavaAst createImport(java.lang.String text, boolean stat, JavaAst jroot, AstSymbolResolver resolver) throws java.lang.IllegalArgumentException
KW_IMPORT
with text as the
package/class to import) or a static import statement
(STATIC_IMPORT
with text as the class members to import)
and attaches it to the specified parent, IF an equivalent import
statement does not already exist.text
- The package/class to import.stat
- true
to create a STATIC_IMPORT
node
otherwise create a KW_IMPORT
.jroot
- The root node of the Java tree in which to create the import
statement.resolver
- The current instance of the AstSymbolResolver
in use
in the pattern engine.null
if text is
null
, jroot is not a valid Java root AST node,
if an equivalent import statement already exists or if there
are errors during creation of the new Java AST.java.lang.IllegalArgumentException