public ParsingStageService( ICOMReferenceSynchronizer comSynchronizer, IBuiltInDeclarationLoader builtInDeclarationLoader, IParseRunner parseRunner, IDeclarationResolveRunner declarationResolver, IReferenceResolveRunner referenceResolver) { if (comSynchronizer == null) { throw new ArgumentNullException(nameof(comSynchronizer)); } if (builtInDeclarationLoader == null) { throw new ArgumentNullException(nameof(builtInDeclarationLoader)); } if (parseRunner == null) { throw new ArgumentNullException(nameof(parseRunner)); } if (declarationResolver == null) { throw new ArgumentNullException(nameof(declarationResolver)); } if (referenceResolver == null) { throw new ArgumentNullException(nameof(referenceResolver)); } _comSynchronizer = comSynchronizer; _builtInDeclarationLoader = builtInDeclarationLoader; _parseRunner = parseRunner; _declarationResolver = declarationResolver; _referenceResolver = referenceResolver; }
private static void InternalRunParse(IParseRunner parseRunner) { while (!parseRunner.EndOfStream()) { Assert.IsTrue(parseRunner.Read(), $"Parse Failed at Position {parseRunner.Position}"); } Assert.IsTrue(parseRunner.ParseEngine.IsAccepted(), $"Parse was not accepted"); }
private static bool RunParse(IParseRunner lexer) { while (!lexer.EndOfStream()) { if (!lexer.Read()) { return(false); } } return(lexer.ParseEngine.IsAccepted()); }
private static void InternalRunParse(IParseRunner parseRunner) { while (!parseRunner.EndOfStream()) { if (!parseRunner.Read()) { Assert.Fail($"Parse Failed at Position {parseRunner.Position}"); } } if (!parseRunner.ParseEngine.IsAccepted()) { Assert.Fail($"Parse was not accepted"); } }
public void RunParse(TextReader reader) { ParseRunner = new ParseRunner(ParseEngine, reader); InternalRunParse(ParseRunner); }
public void RunParse(string input) { ParseRunner = new ParseRunner(ParseEngine, input); InternalRunParse(ParseRunner); }
public void RunParse(TextReader reader) { ParseRunner = new ParseRunner(ParseEngine, reader); InternalRunParse(ParseRunner); }
public void RunParse(string input) { ParseRunner = new ParseRunner(ParseEngine, input); InternalRunParse(ParseRunner); }