public Node AddToken(RegularExpressionToken token) { var newEnd = CreateNewNode(); End.AddAdjacent(newEnd, token); End = newEnd; return(End); }
public IGraph AddSequence(IGraph sequenceGraph) { if (sequenceGraph == null) { return(this); } End.AddAdjacent(sequenceGraph.Root, RegularExpressionToken.Blank); End = sequenceGraph.End; return(this); }
public void RepeatPlus() { var newRoot = CreateNewNode(); newRoot.AddAdjacent(Root, RegularExpressionToken.Blank); End.AddAdjacent(Root, RegularExpressionToken.Blank, true); Root = newRoot; var newEnd = CreateNewNode(); End.AddAdjacent(newEnd, RegularExpressionToken.Blank); End = newEnd; }
public IGraph AddChoice(IGraph concatGraph) { var newRoot = CreateNewNode(); newRoot.AddAdjacent(Root, RegularExpressionToken.Blank); newRoot.AddAdjacent(concatGraph.Root, RegularExpressionToken.Blank); Root = newRoot; var newEnd = CreateNewNode(); End.AddAdjacent(newEnd, RegularExpressionToken.Blank); concatGraph.End.AddAdjacent(newEnd, RegularExpressionToken.Blank); End = newEnd; return(this); }