public class keywordsPrepare extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TTCOLUMN |
static String |
TTIDENTIFIER |
static String |
TTKEYWORD |
static String |
TTRESERVED |
Constructor and Description |
---|
keywordsPrepare() |
Modifier and Type | Method and Description |
---|---|
static void |
addNewKeywords(String pKeywords,
String pKeywordsInLexer,
String kwType) |
static void |
adjustKeywords(String pKeywords,
String pKeywordsInLexer,
String pKwMark)
核对 lexer keyword 列表中的 keyword,如果这些 keyword 在 规定 keyword 列表中出现,必须保证类型的也相同,
如果不同,把 lexer keyword 列表中keyword的类型调整为指定的类型。
这个操作不改变 lexer keyword 列表中 keyword 的个数
|
static void |
checkFalseKeywords(String pKeywords,
String pKeywordsInLexer,
String pKwMark)
检查 lexer keywords 列表中的指定类型的 keyword 是否在 规定的 keyword 列表中出现。
理想的结果是没有发现 false keyword
|
static void |
compareKeywordsWithLexerKeywords(String pReservedWords,
String pKeywordsInLexer) |
static String |
extractNonReservedKeywords(String allKeywords,
String reservedWords)
输入完整的 keyword 列表 和 reserved words 列表, 输出 non-reserved keywords 列表
|
static int |
insertReservedWord(String kw,
ArrayList<keywordRec> targetList,
int startFrom) |
static ArrayList<keywordRec> |
keywordsInLexerToArrayList(String pKeywordsInLexer) |
static ArrayList<String> |
keywordsStringToArrayList(String pReservedWords) |
static void |
main(String[] args) |
static String |
outNewAddReservedWords(ArrayList<keywordRec> targetList) |
static int |
searchKwInList(String kw,
ArrayList<keywordRec> targetList) |
public static String TTRESERVED
public static String TTIDENTIFIER
public keywordsPrepare()
public static String outNewAddReservedWords(ArrayList<keywordRec> targetList)
public static int searchKwInList(String kw, ArrayList<keywordRec> targetList)
public static int insertReservedWord(String kw, ArrayList<keywordRec> targetList, int startFrom)
public static ArrayList<String> keywordsStringToArrayList(String pReservedWords)
public static ArrayList<keywordRec> keywordsInLexerToArrayList(String pKeywordsInLexer)
public static void compareKeywordsWithLexerKeywords(String pReservedWords, String pKeywordsInLexer)
public static void addNewKeywords(String pKeywords, String pKeywordsInLexer, String kwType)
public static void adjustKeywords(String pKeywords, String pKeywordsInLexer, String pKwMark)
pKeywords
- pKeywordsInLexer
- pKwMark
- public static void checkFalseKeywords(String pKeywords, String pKeywordsInLexer, String pKwMark)
pKeywords
- 规定的 keyword 列表pKeywordsInLexer
- lexer keywords 列表pKwMark
- 需要检查的 keyword 类型, 有 TTRESERVED 和 TTKEYWORDpublic static String extractNonReservedKeywords(String allKeywords, String reservedWords)
allKeywords
- reservedWords
-