public List <TokensError> Run() { List <TokensError> errors = new List <TokensError>(); try { if (path.StartsWith("<")) { library.SetPath(path.Remove(path.Length - 2) + ".tokens"); } else { library.SetPath(AppDomain.CurrentDomain.BaseDirectory + "lib/" + path + ".tokens"); } } catch { errors.Add(new Errors.TokensLibraryError( TokensBuilder.gen.line, $"Tokens library by path {path} not found")); return(errors); } library.GetHeaderAndTarget(out _, out _); library.ReadTokens(); library.EndWork(); TokensBuilder.gen.reader.Add(library); return(errors); }
public void Generate() { reader.GetHeaderAndTarget(out byte h, out Config.platform); Config.header = (HeaderType)h; reader.ReadTokens(); reader.EndWork(); while (reader.tokens.Count > 0) { TakeExpression(); ParseExpression(expression); } errors.AddRange(PartTemplate.errors); foreach (TokensError error in errors) { Console.Error.WriteLine(error); } }