Пример #1
0
        public void Do(List <string> input)
        {
            var table = new SymbolsTable();
            var lines = new List <string>();

            for (int i = 0; i < input.Count; i++)
            {
                var line = input[i];

                if (line.StartsWith("("))
                {
                    var label = line.Trim(new char[] { '(', ')' });
                    table.AddSymbol(label, (uint)lines.Count);
                }
                else
                {
                    lines.Add(line);
                }
            }

            this.Table          = table;
            this.ProcessedLines = lines;
        }
Пример #2
0
 public Compiler(SymbolsTable _symbols)
 {
     this.symbols = _symbols;
 }