コード例 #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");
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
 }
コード例 #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();
        }