노현종

언어별 예약어 목록

...@@ -76,7 +76,7 @@ namespace VulnCrawler ...@@ -76,7 +76,7 @@ namespace VulnCrawler
76 Console.WriteLine(item); 76 Console.WriteLine(item);
77 } 77 }
78 78
79 - return; 79 + // return;
80 var directorys = Directory.GetDirectories(@"c:\VulnPy"); 80 var directorys = Directory.GetDirectories(@"c:\VulnPy");
81 if (directorys.Length == 0) { 81 if (directorys.Length == 0) {
82 Console.WriteLine("Repository 목록 찾기 실패"); 82 Console.WriteLine("Repository 목록 찾기 실패");
......
...@@ -14,7 +14,10 @@ namespace VulnCrawler ...@@ -14,7 +14,10 @@ namespace VulnCrawler
14 public abstract class VulnAbstractCrawler 14 public abstract class VulnAbstractCrawler
15 { 15 {
16 16
17 - private static readonly string[] ReservedList = { "if", "return", "break", "while", "typedef" }; 17 + protected abstract string[] ReservedList { get; }
18 +
19 + // = { "if", "return", "break", "while", "typedef" };
20 +
18 /// <summary> 21 /// <summary>
19 /// 생성자 22 /// 생성자
20 /// 경로를 입력받아서(path) 23 /// 경로를 입력받아서(path)
......
...@@ -10,6 +10,8 @@ namespace VulnCrawler ...@@ -10,6 +10,8 @@ namespace VulnCrawler
10 { 10 {
11 public class VulnC : VulnAbstractCrawler 11 public class VulnC : VulnAbstractCrawler
12 { 12 {
13 + protected override string[] ReservedList => new string[] { "if", "return", "break", "while", "typedef" };
14 +
13 protected override string RegexFuncPattern => $@"@@ \-(?<{OldStart}>\d+),(?<{OldLines}>\d+) \+(?<{NewStart}>\d+),(?<{NewLines}>\d+) @@ (?<{MethodName}>(static)? [\w]+ [\w]+)\([\w \*\,\t\n]*\)"; 15 protected override string RegexFuncPattern => $@"@@ \-(?<{OldStart}>\d+),(?<{OldLines}>\d+) \+(?<{NewStart}>\d+),(?<{NewLines}>\d+) @@ (?<{MethodName}>(static)? [\w]+ [\w]+)\([\w \*\,\t\n]*\)";
14 16
15 protected override string Extension => ".c"; 17 protected override string Extension => ".c";
......
...@@ -20,6 +20,8 @@ namespace VulnCrawler ...@@ -20,6 +20,8 @@ namespace VulnCrawler
20 protected override string Extension => ".py"; 20 protected override string Extension => ".py";
21 protected override string RegexFuncPattern => $@"@@ \-(?<{OldStart}>\d+),(?<{OldLines}>\d+) \+(?<{NewStart}>\d+),(?<{NewLines}>\d+) @@ def (?<{MethodName}>\w+)"; 21 protected override string RegexFuncPattern => $@"@@ \-(?<{OldStart}>\d+),(?<{OldLines}>\d+) \+(?<{NewStart}>\d+),(?<{NewLines}>\d+) @@ def (?<{MethodName}>\w+)";
22 22
23 + protected override string[] ReservedList => throw new NotImplementedException();
24 +
23 // protected override Regex MethodExtractor => new Regex(RegexFuncPattern); 25 // protected override Regex MethodExtractor => new Regex(RegexFuncPattern);
24 26
25 27
......