• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SmiLexer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SmiLexer的典型用法代码示例。如果您正苦于以下问题:C# SmiLexer类的具体用法?C# SmiLexer怎么用?C# SmiLexer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SmiLexer类属于命名空间,在下文中一共展示了SmiLexer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TestComment2

 public void TestComment2()
 {
     string test = "ADSL-LINE-MIB --c-c-- DEFINITIONS ::= BEGIN --c " + Environment.NewLine +
         "END";
     var lex = new SmiLexer(new ANTLRStringStream(test));
     var tokens = new CommonTokenStream(lex);
     var parser = new SmiParser(tokens);
     var document = parser.GetDocument();
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:9,代码来源:MibDocumentTestFixture.cs


示例2: TestSNMPv2_SMI

 public void TestSNMPv2_SMI()
 {
     var stream = new ANTLRInputStream(new MemoryStream(Resources.SNMPv2_SMI));
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var document = parser.GetDocument();
     Assert.AreEqual(1, document.Modules.Count);
     Assert.AreEqual("SNMPv2-SMI", document.Modules[0].Name);
     Assert.AreEqual(34, document.Modules[0].Constructs.Count);
     Assert.AreEqual(16, document.Modules[0].Entities.Count);
     var node = document.Modules[0].Entities[15];
     Assert.AreEqual("zeroDotZero", node.Name);
     Assert.AreEqual(0, node.Value);
     Assert.AreEqual("ccitt", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例3: TestSYMMIB_MIB_MIB

 public void TestSYMMIB_MIB_MIB()
 {
     var stream = new ANTLRInputStream(new MemoryStream(Resources.SYMMIB_MIB_MIB));
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var document = parser.GetDocument();
     Assert.AreEqual(1, document.Modules.Count);
     Assert.AreEqual("SYMMIB_MIB-MIB", document.Modules[0].Name);
     Assert.AreEqual(117, document.Modules[0].Constructs.Count);
     Assert.AreEqual(98, document.Modules[0].Entities.Count);
     var node = document.Modules[0].Entities[97];
     Assert.AreEqual("disableTrapAtt3", node.Name);
     Assert.AreEqual(3, node.Value);
     Assert.AreEqual("iNTELMIFTOMIBEntry", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例4: TestRFC_1215

 public void TestRFC_1215()
 {
     var m = new MemoryStream(Resources.RFC_1215);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("RFC-1215", file.Modules[0].Name);
     Assert.AreEqual(0, file.Modules[0].Entities.Count);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:12,代码来源:MibDocumentTestFixture.cs


示例5: TestAPPC_MIB

 public void TestAPPC_MIB()
 {
     var m = new MemoryStream(Resources.APPC_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("APPC-MIB", file.Modules[0].Name);
     Assert.AreEqual(4, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(305, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[304];
     Assert.AreEqual("appcConversationConfGroup", node.Name);
     Assert.AreEqual(10, node.Value);
     Assert.AreEqual("appcGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例6: TestUCD_SNMP_MIB_OLD

 public void TestUCD_SNMP_MIB_OLD()
 {
     var m = new MemoryStream(Resources.UCD_SNMP_MIB_OLD);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("UCD-SNMP-MIB-OLD", file.Modules[0].Name);
     Assert.AreEqual(35, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[34];
     Assert.AreEqual("loadaveErrMessage", node.Name);
     Assert.AreEqual(101, node.Value);
     Assert.AreEqual("loadaves", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例7: TestUCD_IPFWACC_MIB

 public void TestUCD_IPFWACC_MIB()
 {
     var m = new MemoryStream(Resources.UCD_IPFWACC_MIB1);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("UCD-IPFWACC-MIB", file.Modules[0].Name);
     Assert.AreEqual(29, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[28];
     Assert.AreEqual("ipFwAccPort10", node.Name);
     Assert.AreEqual(26, node.Value);
     Assert.AreEqual("ipFwAccEntry", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例8: TestUCD_DISKIO_MIB

 public void TestUCD_DISKIO_MIB()
 {
     var m = new MemoryStream(Resources.UCD_DISKIO_MIB1);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("UCD-DISKIO-MIB", file.Modules[0].Name);
     Assert.AreEqual(14, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[13];
     Assert.AreEqual("diskIONWrittenX", node.Name);
     Assert.AreEqual(13, node.Value);
     Assert.AreEqual("diskIOEntry", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例9: TestTunnel_MIB

 public void TestTunnel_MIB()
 {
     var m = new MemoryStream(Resources.TUNNEL_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("TUNNEL-MIB", file.Modules[0].Name);
     Assert.AreEqual(42, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[41];
     Assert.AreEqual("tunnelMIBInetGroup", node.Name);
     Assert.AreEqual(2, node.Value);
     Assert.AreEqual("tunnelMIBGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例10: TestSNMP_VIEW_BASED_ACM_MIB

 public void TestSNMP_VIEW_BASED_ACM_MIB()
 {
     var m = new MemoryStream(Resources.SNMP_VIEW_BASED_ACM_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("SNMP-VIEW-BASED-ACM-MIB", file.Modules[0].Name);
     Assert.AreEqual(38, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[37];
     Assert.AreEqual("vacmBasicGroup", node.Name);
     Assert.AreEqual(1, node.Value);
     Assert.AreEqual("vacmMIBGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例11: TestADSL_LINE_MIB

 public void TestADSL_LINE_MIB()
 {
     var m = new MemoryStream(Resources.ADSL_LINE_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ADSL-LINE-MIB", file.Modules[0].Name);
     Assert.AreEqual(6, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(275, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[274];
     Assert.AreEqual("adslAturLineProfileControlGroup", node.Name);
     Assert.AreEqual(25, node.Value);
     Assert.AreEqual("adslGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例12: TestADSL_TC_MIB

 public void TestADSL_TC_MIB()
 {
     var m = new MemoryStream(Resources.ADSL_TC_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ADSL-TC-MIB", file.Modules[0].Name);
     Assert.AreEqual(2, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(1, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[0];
     Assert.AreEqual("adsltcmib", node.Name);
     Assert.AreEqual(2, node.Value);
     Assert.AreEqual("transmission.94", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例13: TestADMIN_AUTH_STATS_MIB

 public void TestADMIN_AUTH_STATS_MIB()
 {
     var m = new MemoryStream(Resources.ADMIN_AUTH_STATS_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ADMIN-AUTH-STATS-MIB", file.Modules[0].Name);
     Assert.AreEqual(4, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(23, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[22];
     Assert.AreEqual("alAdminAuthClientMIBGroup", node.Name);
     Assert.AreEqual(2, node.Value);
     Assert.AreEqual("alAdminAuthGroup", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例14: TestALLIEDTELESYN_MIB

 public void TestALLIEDTELESYN_MIB()
 {
     var m = new MemoryStream(Resources.ALLIEDTELESYN_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ALLIEDTELESYN-MIB", file.Modules[0].Name);
     Assert.AreEqual(4, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(606, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[605];
     Assert.AreEqual("ds3TrapInterval", node.Name);
     Assert.AreEqual(4, node.Value);
     Assert.AreEqual("ds3TrapEntry", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例15: TestAIRPORT_BASESTATION_3_MIB

 public void TestAIRPORT_BASESTATION_3_MIB()
 {
     var m = new MemoryStream(Resources.AIRPORT_BASESTATION_3_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("AIRPORT-BASESTATION-3-MIB", file.Modules[0].Name);
     Assert.AreEqual(3, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(47, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[46];
     Assert.AreEqual("physicalInterfaceNumRXError", node.Name);
     Assert.AreEqual(10, node.Value);
     Assert.AreEqual("physicalInterface", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例16: TestARRAYMANAGER_MIB

 public void TestARRAYMANAGER_MIB()
 {
     var m = new MemoryStream(Resources.ARRAYMANAGER_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();
     Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ArrayManager-MIB", file.Modules[0].Name);
     Assert.AreEqual(4, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(380, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[379];
     Assert.AreEqual("rebuildRateEv", node.Name);
     Assert.AreEqual(222, node.Value);
     Assert.AreEqual("aryMgrEvts", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:17,代码来源:MibDocumentTestFixture.cs


示例17: TestALVARION_DOT11_WLAN_MIB

 public void TestALVARION_DOT11_WLAN_MIB()
 {
     var m = new MemoryStream(Resources.ALVARION_DOT11_WLAN_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ALVARION-DOT11-WLAN-MIB", file.Modules[0].Name);
     Assert.AreEqual(2, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(269, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[268];
     Assert.AreEqual("brzaccVLTrapFtpStatus", node.Name);
     Assert.AreEqual(10, node.Value);
     Assert.AreEqual("brzaccVLTraps", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例18: TestRMON_MIB

 public void TestRMON_MIB()
 {
     var m = new MemoryStream(Resources.RMON_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("RMON-MIB", file.Modules[0].Name);
     Assert.AreEqual(232, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[231];
     Assert.AreEqual("rmonNotificationGroup", node.Name);
     Assert.AreEqual(11, node.Value);
     Assert.AreEqual("rmonGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例19: TestSMUX_MIB

 public void TestSMUX_MIB()
 {
     var m = new MemoryStream(Resources.SMUX_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual(1, file.Modules.Count);
     Assert.AreEqual("SMUX-MIB", file.Modules[0].Name);
     Assert.AreEqual(14, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[13];
     Assert.AreEqual("smuxTstatus", node.Name);
     Assert.AreEqual(4, node.Value);
     Assert.AreEqual("smuxTreeEntry", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs


示例20: TestACTONA_ACTASTOR_MIB

 public void TestACTONA_ACTASTOR_MIB()
 {
     var m = new MemoryStream(Resources.ACTONA_ACTASTOR_MIB);
     var stream = new ANTLRInputStream(m);
     var lexer = new SmiLexer(stream);
     var tokens = new CommonTokenStream(lexer);
     var parser = new SmiParser(tokens);
     var file = parser.GetDocument();Assert.AreEqual(0, parser.Warnings.Count);
     Assert.AreEqual("ACTONA-ACTASTOR-MIB", file.Modules[0].Name);
     Assert.AreEqual(3, file.Modules[0].Imports.Clauses.Count);
     Assert.AreEqual(100, file.Modules[0].Entities.Count);
     IEntity node = file.Modules[0].Entities[99];
     Assert.AreEqual("acNotificationInfoGroup", node.Name);
     Assert.AreEqual(7, node.Value);
     Assert.AreEqual("actastorGroups", node.Parent);
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:16,代码来源:MibDocumentTestFixture.cs



注:本文中的SmiLexer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SmiParser类代码示例发布时间:2022-05-24
下一篇:
C# SmbFlags2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap