/// <summary> /// 打印表项,根据类型 /// </summary> /// <param name="type"></param> public void PrintByType(ConstTable.GrammarMsgType type) { if (type == ConstTable.GrammarMsgType.error) { System.Console.WriteLine("************************************************"); System.Console.WriteLine("输出的错误信息:"); foreach (GrammarMsgTableItem item in msgList) { if (item.MsgType == ConstTable.GrammarMsgType.error) { System.Console.WriteLine(item.MsgString); } } System.Console.WriteLine("************************************************"); } else if (type == ConstTable.GrammarMsgType.identified) { System.Console.WriteLine("************************************************"); System.Console.WriteLine("已经识别出的信息:"); foreach (GrammarMsgTableItem item in msgList) { if (item.MsgType == ConstTable.GrammarMsgType.identified) { System.Console.WriteLine(item.MsgString); } } System.Console.WriteLine("************************************************"); } }
public GrammarMsgTableItem(string msgString, ConstTable.GrammarMsgType msgType) { this.msgString = msgString; this.msgType = msgType; }