|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.tromer.jie.Syntax
Utility functions for handling of Java syntax.
Constructor Summary | |
Syntax()
|
Method Summary | |
static java.lang.String |
cleanIdentifier(java.lang.String in)
Remove whitespace and ignorable character from string. |
static byte |
compareCodeLocations(java.awt.Point a,
java.awt.Point b)
Returns 1 is 'a' comes after b, -1 if 'a' comes before 'b', and 0 if 'a' equals 'b'. |
static java.lang.String |
dumpToString(Node root)
Returns a dump of the AST tree branch, without special tokens removed. |
static void |
fillInNodeDFSIndices(CompilationUnit root)
Fills in the previsitIndex and postvisitIndex
fields of all the nodes in the AST. |
static void |
fillInNodePositions(CompilationUnit root)
Fills in the textual position fields of all the nodes in the AST. |
static java.lang.String |
getIdentFromName(java.lang.String name)
Returns the last identifier in a Java name. |
static int |
lastIndexOfNewline(java.lang.String s,
int end)
Similar to s.lastIndexOf('\n', int) , but handles all
possible newlines combinations (CR, LF, CRLF). |
static java.lang.String |
normalizeArrayDimsAndInits(ArrayDimsAndInits n)
Returns the normalized form of an ArrayDimsAndInits ,
consisting of square brackets only. |
static java.lang.String |
normalizeWhitespace(java.lang.String in)
Convert each sequence of whitespace characters to a single space. |
static int |
numOfNewlines(java.lang.String s)
Returns the number of newlines in a string, taking into account all possible combinations (CR, LF, CRLF). |
static java.lang.String |
zeroLiteralForType(java.lang.String type)
Returns the literal value for zero ("false", "0" or "null") for the specified type. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Syntax()
Method Detail |
public static java.lang.String getIdentFromName(java.lang.String name)
public static java.lang.String cleanIdentifier(java.lang.String in)
public static java.lang.String normalizeWhitespace(java.lang.String in)
public static java.lang.String dumpToString(Node root)
public static java.lang.String zeroLiteralForType(java.lang.String type)
public static int lastIndexOfNewline(java.lang.String s, int end)
s.lastIndexOf('\n', int)
, but handles all
possible newlines combinations (CR, LF, CRLF).public static int numOfNewlines(java.lang.String s)
public static java.lang.String normalizeArrayDimsAndInits(ArrayDimsAndInits n)
ArrayDimsAndInits
,
consisting of square brackets only.public static byte compareCodeLocations(java.awt.Point a, java.awt.Point b)
public static void fillInNodePositions(CompilationUnit root)
public static void fillInNodeDFSIndices(CompilationUnit root)
previsitIndex
and postvisitIndex
fields of all the nodes in the AST.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |