private RegExp ParseUnionExp() { RegExp e = this.ParseInterExp(); if (this.Match('|')) { e = RegExp.MakeUnion(e, this.ParseUnionExp()); } return(e); }
private RegExp ParseCharClasses() { RegExp e = this.ParseCharClass(); while (this.More() && !this.Peek("]")) { e = RegExp.MakeUnion(e, this.ParseCharClass()); } return(e); }
private RegExp ParseCharClass() { char @char = this.ParseCharExp(); if (this.Match('-')) { if (this.Peek("]")) { return(RegExp.MakeUnion(RegExp.MakeChar(@char), RegExp.MakeChar('-'))); } return(RegExp.MakeCharRange(@char, this.ParseCharExp())); } return(RegExp.MakeChar(@char)); }