Exemplo n.º 1
0
 public Generator(string name_file, ConstantTable Operations, VariableTable Constants, VariableTable Identificators)
 {
     ReadOPZ(name_file);
     this.Constants      = Constants;
     this.Identificators = Identificators;
     this.Operations     = Operations;
     fOut = new StreamWriter($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\program.asm");
 }
 public Scanner(ConstantTable Operations, ConstantTable Divisions, ConstantTable KeyWords,
                VariableTable Constants, VariableTable Identificators)
 {
     this.Operations     = Operations;
     this.Divisions      = Divisions;
     this.KeyWords       = KeyWords;
     this.Constants      = Constants;
     this.Identificators = Identificators;
 }
 public SyntaxAnalysis(ConstantTable Operations, ConstantTable Divisions, ConstantTable KeyWords,
                       VariableTable Constants, VariableTable Identificators)
 {
     tokensAll           = File.ReadAllText("C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\Tokenы.txt");
     f                   = new StreamWriter("C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\Errors.txt");
     f1                  = new StreamWriter("C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\OPZ.txt");
     this.Operations     = Operations;
     this.Divisions      = Divisions;
     this.KeyWords       = KeyWords;
     this.Constants      = Constants;
     this.Identificators = Identificators;
 }
Exemplo n.º 4
0
        static void Main()
        {
            ConstantTable CTOperators      = new ConstantTable($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\Operators.txt");
            ConstantTable CTDivisions      = new ConstantTable($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\Divisions.txt");
            ConstantTable CTKeyWoeds       = new ConstantTable($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\KeyWords.txt");
            VariableTable VTConstants      = new VariableTable();
            VariableTable VTIdentificators = new VariableTable();

            Scanner scanner = new Scanner(CTOperators, CTDivisions, CTKeyWoeds, VTConstants, VTIdentificators);

            scanner.LexicalAnalysis($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\program.txt");

            SyntaxAnalysis analyzator = new SyntaxAnalysis(CTOperators, CTDivisions, CTKeyWoeds, VTConstants, VTIdentificators);

            analyzator.WorkSyntAn();

            CleanOPZ($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\OPZ.txt", $"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\Errors.txt");
            Generator generator = new Generator($"C:\\Users\\pm82k\\source\\repos\\LoPaMoT\\LoPaMoT\\OPZ.txt", CTOperators, VTConstants, VTIdentificators);

            generator.startGeneration();
        }