コード例 #1
0
        public vmILParser(string filePath, vmIL2ASMWriter writer)
        {
            this.filePath = filePath;
            this.writer   = writer;
            var data = File.ReadAllText(this.filePath);
            //get all lines
            var allLines = data.Split(Environment.NewLine).Select(x => x.Trim());
            var withoutFullLineComments = allLines.Where(x => !x.StartsWith(@"//"));
            //each line might also contain a comment somewhere in it - lets remove those as well.
            var noComments   = withoutFullLineComments.Select(x => x.Split(@"//").FirstOrDefault());
            var noEmptyLines = noComments.Where(x => !(string.IsNullOrEmpty(x)));

            this.allInputLines = noEmptyLines.ToArray();
        }
コード例 #2
0
 public vmtranslator(string path, vmIL2ASMWriter writer, core.Logger logger = null)
 {
     this.path   = path;
     this.logger = logger ?? new core.Logger();
     this.writer = writer;
 }