public CreateText(string textFile, string codesFile, Table simpleDelimitersTable, Table multiCharacterDelimitersTable, Table keyWordsTable, Table constantsTable, Table identifiersTable, ErrorsList errorsTable) { TextFile = textFile; CodesFile = codesFile; _simpleDelimitersTable = simpleDelimitersTable; _multiCharacterDelimitersTable = multiCharacterDelimitersTable; _keyWordsTable = keyWordsTable; _constantsTable = constantsTable; _identifiersTable = identifiersTable; _errorsTable = errorsTable; Tokens = new Dictionary <Token, int>(); }
public LexAnalyzer() { using (var fs = File.Open(Folder + ResultJson, FileMode.Open)) { fs.SetLength(0); } using (var fs1 = File.Open(Folder + CodesFile, FileMode.Open)) { fs1.SetLength(0); } using (var fs2 = File.Open(Folder + Result, FileMode.Open)) { fs2.SetLength(0); } _simpleDelimitersTable = new Table(Folder + ResultJson, SimpleDelimitersOffset, "SimpleDelimiters", Folder + CodesFile); _multiCharacterDelimitersTable = new Table(Folder + ResultJson, MultiCharacterDelimitersOffset, "MultiCharacterDelimiters", Folder + CodesFile); _keyWordsTable = new Table(Folder + ResultJson, KeyWordsOffset, "KeyWords", Folder + CodesFile); _constantsTable = new Table(Folder + ResultJson, ConstantsOffset, "Constants", Folder + CodesFile); _identifiersTable = new Table(Folder + ResultJson, IdentifiersOffset, "Identifiers", Folder + CodesFile); _errorsTable = new ErrorsList(); createText = new CreateText(Folder + Result, Folder + CodesFile, _simpleDelimitersTable, _multiCharacterDelimitersTable, _keyWordsTable, _constantsTable, _identifiersTable, _errorsTable); }