<commit_before>#pragma once
#include<string>
#include <vector>
#include"LexicalScanner.h"
#include "TableManager.h"

using std::string;

class Assembler {
	public:	
		Assembler(string outFileName);
		~Assembler();

		int GetLine();
		int ExecuteDirective(string directiveName, DirectiveInfo const * info,vector<string> operands, SymbolInfo* symbol);
		void Assemble();
	private:
		void firstPass();
		void secondPass();

		LexicalScanner scanner;
		string outputFileName;

		int positionCount;
		int lineCount;
		bool successAssemble;

		bool hasStop;

		unsigned char sectionFlags;
		enum SectionFlags {
			Text = 1,
			Data = 2
		};

		unsigned char beginFlags;
		enum BeginFlags {
			Begin = 1,
			End = 2
		};
		enum operandTypes {
			number,
			label,
			operation
		};

		void ShowError(string message, ErrorType type);
		int ExecuteSection(vector<string> operands);
		bool TryStringToInt(string s, int* result);
		void FirstPassLastChecks();
		/// <summary>
		///	Preenche a tabela de definicoes com os valores dos simbolos publicos
		///	calculados na tabela de simbolos
		/// </summary>
		void setDefinitionTableValues();
		
		bool CheckLabels(const vector<string>& operands);
		void ValidateAndWriteInstruction(const InstructionInfo* info, const vector<string>& operands);
		bool TryCalculateOperandRealValue(string operand, int& extractedValue, SymbolInfo** symbol);
		int CalculateAndCheckArrayBoundaries(const string& operationSides);

		operandTypes GetType(string operand);
};<commit_msg>Comentada função de calculo do valor dos operandos<commit_after>#pragma once
#include<string>
#include <vector>
#include"LexicalScanner.h"
#include "TableManager.h"

using std::string;

class Assembler {
	public:	
		Assembler(string outFileName);
		~Assembler();

		int GetLine();
		int ExecuteDirective(string directiveName, DirectiveInfo const * info,vector<string> operands, SymbolInfo* symbol);
		void Assemble();
	private:
		void firstPass();
		void secondPass();

		LexicalScanner scanner;
		string outputFileName;

		int positionCount;
		int lineCount;
		bool successAssemble;

		bool hasStop;

		unsigned char sectionFlags;
		enum SectionFlags {
			Text = 1,
			Data = 2
		};

		unsigned char beginFlags;
		enum BeginFlags {
			Begin = 1,
			End = 2
		};
		enum operandTypes {
			number,
			label,
			operation
		};

		void ShowError(string message, ErrorType type);
		int ExecuteSection(vector<string> operands);
		bool TryStringToInt(string s, int* result);
		void FirstPassLastChecks();
		/// <summary>
		///	Preenche a tabela de definicoes com os valores dos simbolos publicos
		///	calculados na tabela de simbolos
		/// </summary>
		void setDefinitionTableValues();
		
		bool CheckLabels(const vector<string>& operands);
		void ValidateAndWriteInstruction(const InstructionInfo* info, const vector<string>& operands);
		bool TryCalculateOperandRealValue(string operand, int& extractedValue, SymbolInfo** symbol);

		/// <summary>
		/// Calcula o valor numerico do operando passado e faz checagem de indice de vetores
		/// com operador +
		/// </summary>
		/// <param name="operand"></param>
		/// <returns></returns>
		int CalculateAndCheckArrayBoundaries(const string& operand);

		operandTypes GetType(string operand);
};
{'fraction_non_alphanumeric': 0.10151187904967603, 'fraction_numerical': 0.002468373958654736, 'mean_word_length': 4.367549668874172, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3785370', 'n_tokens_mistral': 1125, 'n_tokens_neox': 989, 'n_words': 286}