public <S, P, E, T, D extends Pda<S, P>> D create(Cfg<E, T> cfg, FollowerFunction<E> ff, PdaFactory<D, S, P, ? super E> fact) { return create(cfg, ff, Functions.<E> identity(), fact); }
public <S, P, E, T, D extends Pda<S, P>> D create(Cfg<E, T> cfg, FollowerFunction<E> ff, PdaFactory<D, S, P, ? super E> fact) { return create(cfg, ff, Functions.<E> identity(), fact); }
s = fact.createPop(pda, tokens.apply(c)); stops.put(c, s); create(cfg, pda, s, c, ff.getFollowers(c), ff, tokens, fact, states, stops, callers); s = fact.createPush(pda, tokens.apply(fol)); states.put(fol, s); create(cfg, pda, s, e, ff.getStarts(e), ff, tokens, fact, states, stops, callers); s = fact.createState(pda, tokens.apply(fol)); states.put(fol, s); create(cfg, pda, s, fol, ff.getFollowers(fol), ff, tokens, fact, states, stops, callers);
s = fact.createPop(pda, tokens.apply(c)); stops.put(c, s); create(cfg, pda, s, c, ff.getFollowers(c), false, ff, tokens, fact, states, stops, callers); s = fact.createPush(pda, tokens.apply(fol)); states.put(fol, s); create(cfg, pda, s, e, ff.getStarts(e), true, ff, tokens, fact, states, stops, callers); s = fact.createState(pda, tokens.apply(fol)); states.put(fol, s); create(cfg, pda, s, fol, ff.getFollowers(fol), true, ff, tokens, fact, states, stops, callers);
public <S, P, E, T1, T2, D extends Pda<S, P>> D create(Cfg<E, T1> cfg, FollowerFunction<E> ff, Function<E, T2> element2token, PdaFactory<D, S, P, ? super T2> fact) { D pda = fact.create(null, null); Map<E, S> states = Maps.newHashMap(); Map<E, S> stops = Maps.newHashMap(); Multimap<E, E> callers = new CfgUtil().getCallers(cfg); create(cfg, pda, pda.getStart(), cfg.getRoot(), ff.getStarts(cfg.getRoot()), true, ff, element2token, fact, states, stops, callers); return pda; }
public <S, P, E, T1, T2, D extends Pda<S, P>> D create(Cfg<E, T1> cfg, FollowerFunction<E> ff, Function<E, T2> element2token, PdaFactory<D, S, P, ? super T2> fact) { D pda = fact.create(null, null); Map<E, S> states = Maps.newLinkedHashMap(); Map<E, S> stops = Maps.newLinkedHashMap(); Multimap<E, E> callers = new CfgUtil().getCallers(cfg); create(cfg, pda, pda.getStart(), cfg.getRoot(), ff.getStarts(cfg.getRoot()), ff, element2token, fact, states, stops, callers); return pda; }
protected Pda<ISerState, RuleCall> createPDA(ParserRule rule) { SerializerParserRuleCfg cfg = new SerializerParserRuleCfg(rule); SerializerParserRuleFollowerFunction ff = new SerializerParserRuleFollowerFunction(cfg, rule); Pda<ISerState, RuleCall> pda = pdaUtil.create(cfg, ff, new SerializerPDAElementFactory()); return pdaUtil.filterOrphans(pda, new SerializerPDACloneFactory()); }
protected Pda<ISerState, RuleCall> createPDA(Action action) { SerializerActionCfg cfg = new SerializerActionCfg(action); SerializerActionFollowerFunction ff = new SerializerActionFollowerFunction(cfg, action); SerializerPDAElementFactory fact = new SerializerPDAElementFactory(); Pda<ISerState, RuleCall> actionpda = pdaUtil.create(cfg, ff, fact); SerializerPDAGetToken getToken = new SerializerPDAGetToken(); Pda<ISerState, RuleCall> expandedpda = pdaUtil.expand(actionpda, new ExpandRuleCalls(), getToken, fact); Pda<ISerState, RuleCall> filteredpda = pdaUtil.filterOrphans(expandedpda, new SerializerPDACloneFactory()); return filteredpda; }