public void Visit(PlusRepetition target) { target.child.Accept(this); var f = stack.Pop(); stack.Push(NFA.OneOrMany(f)); }
private AstNode Element() { var atomNode = Atom(); while (More() && PeekIsAny('*', '+', '?')) { var character = Peek(); switch (character) { case '*': atomNode = new KleenStarRepetition(atomNode); Consume('*'); break; case '+': atomNode = new PlusRepetition(atomNode); Consume('+'); break; case '?': atomNode = new QuestionRepetition(atomNode); Consume('?'); break; default: break; } } return(atomNode); }