public SyntaxTreeAutomataContext MountSyntaxTreeContext(ParserAutomata parserAutomata, LexemeSource <TToken> lexemeSource, ParserContext parserContext, Parser <TGrammar, TToken> parser) { SyntaxTreeAutomataContext context; lock (SyntaxTreeContextPool) context = SyntaxTreeContextPool.Count > 0 ? SyntaxTreeContextPool.Pop() : new SyntaxTreeAutomataContext(this, parserAutomata); context.Mount(lexemeSource, parserContext, parser); return(context); }
public VisitorAutomataContext MountVisitorContext(Visitor visitor, ParserAutomata parserAutomata, LexemeSource <TToken> lexemeSource, ParserContext parserContext, Parser <TGrammar, TToken> parser) { var pool = GetVisitorContextPool(visitor.GetType()); VisitorAutomataContext context; lock (pool) context = pool.Count > 0 ? pool.Pop() : new VisitorAutomataContext(visitor, this, parserAutomata); context.Mount(lexemeSource, parserContext, parser); return(context); }
public ProcessAutomataContext MountProcessContext(ParserAutomata parserAutomata, LexemeSource <TToken> lexemeSource, ParserContext parserContext, Parser <TGrammar, TToken> parser) { ProcessAutomataContext context; lock (ProcessContextPool) context = ProcessContextPool.Count > 0 ? ProcessContextPool.Pop() : new ProcessAutomataContext(this, parserAutomata); context.Mount(lexemeSource, parserContext, parser); return(context); }