static int HandleParsing(LotusTokenizer tokenizer, out List <TopLevelNode> nodes) { var parser = new TopLevelParser(tokenizer); nodes = parser.ToList(); if (Logger.HasErrors) { Logger.PrintAllErrors(); return(1); } return(0); }
static LotusTokenizer GetTokenizerForFile(FileInfo file) { LotusTokenizer tokenizer; var fileStr = file.ToString(); if (fileStr == "-") { using var stdin = new StreamReader(Console.OpenStandardInput(), Console.InputEncoding); tokenizer = new LotusTokenizer(stdin.ReadToEnd()); } else { tokenizer = new LotusTokenizer(new Uri(file.FullName)); } return(tokenizer); }
public LotusTokenizer(LotusTokenizer tokenizer) : base(tokenizer, tokenizer.Grammar) { }