public class ParseTools extends Object
Modifier and Type | Field and Description |
---|---|
static Class[] |
EMPTY_CLS_ARR |
static Object[] |
EMPTY_OBJ_ARR |
static String[] |
EMPTY_STR_ARR |
Constructor and Description |
---|
ParseTools() |
Modifier and Type | Method and Description |
---|---|
static int |
__resolveType(Class cls) |
static int |
balancedCapture(char[] chars,
int start,
char type)
This is an important aspect of the core parser tools.
|
static int |
balancedCapture(char[] chars,
int start,
int end,
char type) |
static int |
balancedCaptureWithLineAccounting(char[] chars,
int start,
int end,
char type,
ParserContext pCtx) |
static Class |
boxPrimitive(Class cls) |
static String[] |
captureContructorAndResidual(char[] cs,
int start,
int offset) |
static int |
captureStringLiteral(char type,
char[] expr,
int cursor,
int end) |
static int |
captureToEOS(char[] expr,
int cursor,
int end,
ParserContext pCtx) |
static int |
captureToNextTokenJunction(char[] expr,
int cursor,
int end,
ParserContext pCtx) |
static void |
checkNameSafety(String name) |
static boolean |
containsCheck(Object compareTo,
Object compareTest) |
static Class |
createClass(String className,
ParserContext pCtx) |
static int |
createClassSignatureHash(Class declaring,
Class[] sig) |
static char[] |
createShortFormOperativeAssignment(String name,
char[] statement,
int start,
int offset,
int operation) |
static String |
createStringTrimmed(char[] s) |
static String |
createStringTrimmed(char[] s,
int start,
int length) |
static Method |
determineActualTargetMethod(Method method) |
static boolean |
endsWith(char[] c,
int start,
int offset,
char[] test) |
static int |
find(char[] c,
int start,
int offset,
char find) |
static int |
findAbsoluteLast(char[] array) |
static Class |
findClass(VariableResolverFactory factory,
String name,
ParserContext pCtx) |
static ClassImportResolverFactory |
findClassImportResolverFactory(VariableResolverFactory factory,
ParserContext pCtx) |
static int |
findLast(char[] c,
int start,
int offset,
char find) |
static Class |
getBaseComponentType(Class cls) |
static Method |
getBestCandidate(Class[] arguments,
String method,
Class decl,
Method[] methods,
boolean requireExact) |
static Method |
getBestCandidate(Class[] arguments,
String method,
Class decl,
Method[] methods,
boolean requireExact,
boolean classTarget) |
static Method |
getBestCandidate(Object[] arguments,
String method,
Class decl,
Method[] methods,
boolean requireExact) |
static Constructor |
getBestConstructorCandidate(Class[] arguments,
Class cls,
boolean requireExact) |
static Constructor |
getBestConstructorCandidate(Object[] args,
Class cls,
boolean requireExact) |
static Constructor[] |
getConstructors(Class cls) |
static FileWriter |
getDebugFileWriter() |
static Method |
getExactMatch(String name,
Class[] args,
Class returnType,
Class cls) |
static Class |
getSubComponentType(Class cls) |
static Method |
getWidenedTarget(Class cls,
Method method) |
static Method |
getWidenedTarget(Method method) |
static int |
handleEscapeSequence(char[] escapeStr,
int pos)
Replace escape sequences and return trim required.
|
static Object |
handleNumericConversion(char[] val,
int start,
int offset) |
static String |
handleStringEscapes(char[] input) |
static boolean |
isArrayType(char[] array,
int start,
int end) |
static boolean |
isDigit(int c) |
static boolean |
isIdentifierPart(int c) |
static boolean |
isJunct(char c) |
static boolean |
isNotValidNameorLabel(String name)
Check if the specfied string represents a valid name of label.
|
static boolean |
isNumber(char[] val,
int start,
int offset) |
static boolean |
isNumber(Object val) |
static boolean |
isNumber(String val) |
static boolean |
isNumeric(Object val) |
static boolean |
isNumericallyCoercible(Class target,
Class parm) |
static boolean |
isPrimitiveWrapper(Class clazz) |
static boolean |
isPropertyOnly(char[] array,
int start,
int end) |
static boolean |
isReservedWord(String name)
Check if the specified string is a reserved word in the parser.
|
static boolean |
isStatementNotManuallyTerminated(char[] expr,
int cursor) |
static boolean |
isWhitespace(char c) |
static char[] |
loadFromFile(File file) |
static char[] |
loadFromFile(File file,
String encoding) |
static Object |
narrowType(BigDecimal result,
int returnTarget) |
static int |
nextNonBlank(char[] expr,
int cursor) |
static int |
numericTest(char[] val,
int start,
int offset) |
static int |
opLookup(char c) |
static Serializable |
optimizeTree(CompiledExpression compiled) |
static List<char[]> |
parseMethodOrConstructor(char[] parm) |
static String[] |
parseParameterDefList(char[] parm,
int offset,
int length) |
static List<char[]> |
parseParameterList(char[] parm,
int offset,
int length) |
static void |
parseWithExpressions(String nestParm,
char[] block,
int start,
int offset,
Object ctx,
VariableResolverFactory factory) |
static char[] |
readIn(InputStream inStream,
String encoding) |
static String |
repeatChar(char c,
int times) |
static int |
resolveType(Object o) |
static int |
scoreInterface(Class parm,
Class arg) |
static float |
similarity(String s1,
String s2) |
static int |
skipWhitespace(char[] expr,
int cursor) |
static char[] |
subArray(char[] expr,
int start,
int end) |
static Serializable |
subCompileExpression(char[] expression) |
static Serializable |
subCompileExpression(char[] expression,
int start,
int offset) |
static Serializable |
subCompileExpression(char[] expression,
int start,
int offset,
ParserContext ctx) |
static Serializable |
subCompileExpression(char[] expression,
ParserContext ctx) |
static Serializable |
subCompileExpression(String expression,
ParserContext ctx) |
static char[] |
subset(char[] array,
int start) |
static char[] |
subset(char[] array,
int start,
int length) |
static char[] |
subsetTrimmed(char[] array,
int start,
int length) |
static int |
trimLeft(char[] expr,
int start,
int pos)
From the specified cursor position, trim out any whitespace between the current position and the end of the
last non-whitespace character.
|
static int |
trimRight(char[] expr,
int pos)
From the specified cursor position, trim out any whitespace between the current position and beginning of the
first non-whitespace character.
|
static Class |
unboxPrimitive(Class cls) |
public static final String[] EMPTY_STR_ARR
public static final Object[] EMPTY_OBJ_ARR
public static final Class[] EMPTY_CLS_ARR
public static List<char[]> parseMethodOrConstructor(char[] parm)
public static String[] parseParameterDefList(char[] parm, int offset, int length)
public static List<char[]> parseParameterList(char[] parm, int offset, int length)
public static Method getBestCandidate(Object[] arguments, String method, Class decl, Method[] methods, boolean requireExact)
public static Method getBestCandidate(Class[] arguments, String method, Class decl, Method[] methods, boolean requireExact)
public static Method getBestCandidate(Class[] arguments, String method, Class decl, Method[] methods, boolean requireExact, boolean classTarget)
public static Method getExactMatch(String name, Class[] args, Class returnType, Class cls)
public static Constructor getBestConstructorCandidate(Object[] args, Class cls, boolean requireExact)
public static Constructor getBestConstructorCandidate(Class[] arguments, Class cls, boolean requireExact)
public static Class createClass(String className, ParserContext pCtx) throws ClassNotFoundException
ClassNotFoundException
public static Constructor[] getConstructors(Class cls)
public static String[] captureContructorAndResidual(char[] cs, int start, int offset)
public static int handleEscapeSequence(char[] escapeStr, int pos)
escapeStr
- -pos
- -public static char[] createShortFormOperativeAssignment(String name, char[] statement, int start, int offset, int operation)
public static ClassImportResolverFactory findClassImportResolverFactory(VariableResolverFactory factory, ParserContext pCtx)
public static Class findClass(VariableResolverFactory factory, String name, ParserContext pCtx) throws ClassNotFoundException
ClassNotFoundException
public static char[] subsetTrimmed(char[] array, int start, int length)
public static char[] subset(char[] array, int start, int length)
public static char[] subset(char[] array, int start)
public static int resolveType(Object o)
public static int __resolveType(Class cls)
public static Object narrowType(BigDecimal result, int returnTarget)
public static int captureToNextTokenJunction(char[] expr, int cursor, int end, ParserContext pCtx)
public static int nextNonBlank(char[] expr, int cursor)
public static int skipWhitespace(char[] expr, int cursor)
public static boolean isStatementNotManuallyTerminated(char[] expr, int cursor)
public static int captureToEOS(char[] expr, int cursor, int end, ParserContext pCtx)
public static int trimLeft(char[] expr, int start, int pos)
expr
- -start
- -pos
- - current positionpublic static int trimRight(char[] expr, int pos)
expr
- -pos
- -public static char[] subArray(char[] expr, int start, int end)
public static int balancedCapture(char[] chars, int start, char type)
chars
- -start
- -type
- -public static int balancedCapture(char[] chars, int start, int end, char type)
public static int balancedCaptureWithLineAccounting(char[] chars, int start, int end, char type, ParserContext pCtx)
public static String handleStringEscapes(char[] input)
public static int captureStringLiteral(char type, char[] expr, int cursor, int end)
public static void parseWithExpressions(String nestParm, char[] block, int start, int offset, Object ctx, VariableResolverFactory factory)
public static Object handleNumericConversion(char[] val, int start, int offset)
public static boolean isNumeric(Object val)
public static int numericTest(char[] val, int start, int offset)
public static boolean isNumber(Object val)
public static boolean isNumber(String val)
public static boolean isNumber(char[] val, int start, int offset)
public static int find(char[] c, int start, int offset, char find)
public static int findLast(char[] c, int start, int offset, char find)
public static String createStringTrimmed(char[] s)
public static String createStringTrimmed(char[] s, int start, int length)
public static boolean endsWith(char[] c, int start, int offset, char[] test)
public static boolean isIdentifierPart(int c)
public static boolean isDigit(int c)
public static int findAbsoluteLast(char[] array)
public static boolean isJunct(char c)
public static int opLookup(char c)
public static boolean isReservedWord(String name)
name
- -public static boolean isNotValidNameorLabel(String name)
name
- -public static boolean isPropertyOnly(char[] array, int start, int end)
public static boolean isArrayType(char[] array, int start, int end)
public static void checkNameSafety(String name)
public static FileWriter getDebugFileWriter() throws IOException
IOException
public static boolean isPrimitiveWrapper(Class clazz)
public static Serializable subCompileExpression(char[] expression)
public static Serializable subCompileExpression(char[] expression, ParserContext ctx)
public static Serializable subCompileExpression(char[] expression, int start, int offset)
public static Serializable subCompileExpression(char[] expression, int start, int offset, ParserContext ctx)
public static Serializable subCompileExpression(String expression, ParserContext ctx)
public static Serializable optimizeTree(CompiledExpression compiled)
public static boolean isWhitespace(char c)
public static String repeatChar(char c, int times)
public static char[] loadFromFile(File file) throws IOException
IOException
public static char[] loadFromFile(File file, String encoding) throws IOException
IOException
public static char[] readIn(InputStream inStream, String encoding) throws IOException
IOException
Copyright © 2013. All rights reserved.