|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.morph.ParsingFunctions
public class ParsingFunctions
Title: ParsingFunctions.java
Description: This class implements all static methods, which can be used for various purposes, like converting rules defined by users into the regular expressions, finding varilable type from its value type etc.
| Field Summary | |
|---|---|
static int |
AND
|
static int |
AND_PLUS
|
static int |
AND_STAR
|
static short |
IRREG_STEM
|
static short |
NULL_STEM
|
static int |
OR
|
static int |
OR_PLUS
|
static int |
OR_STAR
|
static short |
SEMIREG_STEM
|
static short |
STEM
|
| Constructor Summary | |
|---|---|
ParsingFunctions()
|
|
| Method Summary | |
|---|---|
static ArrayList |
andFSMs(String line,
HashSet initStates,
Interpret owner)
(abc) -> a -> b -> c -> |
static ArrayList |
andPlusFSMs(String line,
HashSet initStates,
Interpret owner)
(abc)+ -> a -> b -> c -> null -> a -> b -> c -> a |
static ArrayList |
andStarFSMs(String line,
HashSet initStates,
Interpret owner)
(abc)* |
static String |
convertToRegExp(String line,
Storage storage)
This method convert the expression which has been entered by the user in the .rul file (i.e. rules defined by the user), into the expression which are recognized by the regular expression Patterns |
static HashSet |
createFSMs(String string,
int type,
HashSet initStates,
Interpret owner)
|
static int |
findVariableType(String varValue)
This method takes the value of the variable and tells the user what type of value is from CharacterRange, CharacterSet, StringSet |
private static int |
getIndex(HashSet states)
|
static short |
getMethodIndex(String method)
This method is used to find the method definition But it can recognize only String, boolean and int types for Example: stem(2,"ed","d") ==> stem(int,java.lang.String,java.lang.String); |
static String |
getMethodName(String method)
This method is used to find the method definition But it can recognize only String, boolean and int types for Example: stem(2,"ed","d") ==> stem(int,java.lang.String,java.lang.String); |
static String[] |
getParameterValues(String method)
This method finds the actual parameter values |
static PatternPart[] |
getPatternParts(String line)
|
static boolean |
isBoolean(String value)
This method checks for the string if it is a valid integer value |
static boolean |
isInteger(String value)
This method checks for the string if it is a valid integer value |
private static FSMState |
next(char ch,
HashSet states)
|
static String[] |
normlizePattern(String line)
|
static ArrayList |
orFSMs(String line,
HashSet initStates,
Interpret owner)
[abc] -> a, -> b, -> c |
static ArrayList |
orPlusFSMs(String line,
HashSet initStates,
Interpret owner)
[abc]+ each element can travel to itself and can travel to next one |
static ArrayList |
orStarFSMs(String line,
HashSet initStates,
Interpret owner)
[abc]* each element can have reference to adjecent ones and to itself |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OR
public static final int AND
public static final int OR_PLUS
public static final int AND_PLUS
public static final int OR_STAR
public static final int AND_STAR
public static final short IRREG_STEM
public static final short NULL_STEM
public static final short SEMIREG_STEM
public static final short STEM
| Constructor Detail |
|---|
public ParsingFunctions()
| Method Detail |
|---|
public static int findVariableType(String varValue)
varValue - value for which to find the variable type
public static boolean isInteger(String value)
value - value to be checked for its type to be integer
public static boolean isBoolean(String value)
value - value to be checked for its type to be integer
public static String[] normlizePattern(String line)
public static PatternPart[] getPatternParts(String line)
public static String getMethodName(String method)
method -
public static short getMethodIndex(String method)
method -
public static String[] getParameterValues(String method)
method - from which parameters are required to be found
public static HashSet createFSMs(String string,
int type,
HashSet initStates,
Interpret owner)
string - type - initState -
private static FSMState next(char ch,
HashSet states)
private static int getIndex(HashSet states)
public static ArrayList andFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static ArrayList orFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static ArrayList orPlusFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static ArrayList andPlusFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static ArrayList orStarFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static ArrayList andStarFSMs(String line,
HashSet initStates,
Interpret owner)
line - initState -
public static String convertToRegExp(String line,
Storage storage)
line - rule defined by the userstorage - this method internally requires values of the used variables
to replace the them with their values in the expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||