/// <summary> /// キーワードと変数名を識別する /// </summary> /// <param name="word"></param> /// <returns></returns> private static Token JudgeWord(string word) { if (BoolLiteral.SpecifiedCollection.Contains(word)) { return(new BoolLiteral(word)); } if (word.Length == 2 && IfKeyword.IsMatch(word)) { return(new IfKeyword()); } if (word.Length == 5 && WhileKeyword.IsMatch(word)) { return(new WhileKeyword()); } if (word.Length == 5 && BreakKeyword.IsMatch(word)) { return(new BreakKeyword()); } if (word.Length == 8 && ContinueKeyword.IsMatch(word)) { return(new ContinueKeyword()); } return(new Identifier(word)); }
private static void KeywordEqual(IfKeyword expected, IfKeyword actual) { throw new NotImplementedException(); }