public LexerTests()
 {
     var memStream = new MemoryStream(Encoding.UTF8.GetBytes(_data));
     var reader = new StreamReader(memStream);
     var source = new Source(reader);
     _sys = new LexicalAnalyzer(source);
 }
        public Compilation Compile(string filePath)
        {
            var streamReader = File.OpenText(filePath);
            var compileSource = new Source(streamReader);
            var lexicalAnalyzer = new LexicalAnalyzer(compileSource);

            lexicalAnalyzer.Tokenize();

            var syntaxAnalyzer = new SyntaxAnalyzer(lexicalAnalyzer.TokenStream);

            var rootNode = syntaxAnalyzer.Analyze();

            var builderVisitor = new BuilderVisitor();
            builderVisitor.Visit(rootNode);

            return new Compilation
            {
                FileDescriptor = builderVisitor.FileDescriptor,
                Errors = rootNode.Errors
            };
        }
 public SourceTests()
 {
     var memStream = new MemoryStream(Encoding.UTF8.GetBytes(Data));
     var reader = new StreamReader(memStream);
     _sys = new Source(reader);
 }