当前位置: 首页>>代码示例>>C#>>正文


C# SmiLexer类代码示例

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


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


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