protected void RegisterLexerProc(int State, char Char, LexerProc Proc) { char[] chArray1 = new char[1] { Char }; this.RegisterLexerProc(State, chArray1, Proc); }
public override int ParseText(int State, string String, ref short[] ColorData) { base.State = State; this.source = String; int num3 = String.Length; for (int num4 = 0; num4 < num3; num4 = this.currentPos) { int num2 = num4; LexerProc proc1 = this.lexerState.GetProc(String[num4]); if (proc1 == null) { num4++; continue; } if (num2 != num4) { for (int num5 = num4; num5 < num2; num5++) { ColorData[num5] = 0; } } this.currentPos = num4; this.tokenPos = num4; int num1 = proc1(); for (int num6 = num4; num6 < Math.Min(this.currentPos, num3); num6++) { ColorData[num6] = (byte)(num1 + 1); } } return(base.State); }
public void Add(char[] Chars, LexerProc Proc) { char[] chArray1 = Chars; for (int num1 = 0; num1 < chArray1.Length; num1++) { char ch1 = chArray1[num1]; this.hash[ch1] = Proc; } }
protected void RegisterLexerProc(int State, char StartChar, char EndChar, LexerProc Proc) { char[] chArray1 = new char[(EndChar - StartChar) + '\x0001']; for (char ch1 = StartChar; ch1 <= EndChar; ch1++) { chArray1[ch1 - StartChar] = ch1; } this.RegisterLexerProc(State, chArray1, Proc); }
public LexerProc GetProc(char ch) { LexerProc proc1 = (LexerProc)this.hash[ch]; if (proc1 == null) { proc1 = this.stateProc; } return(proc1); }
public override int ParseText(int State, string String, ref int Pos, ref int Len, ref int Style) { int num1 = String.Length; LexerProc proc1 = null; while (Pos < num1) { proc1 = this.lexerState.GetProc(String[Pos]); if (proc1 != null) { break; } Pos += 1; } if (proc1 != null) { this.currentPos = Pos; this.tokenPos = Pos; Style = proc1(); Len = this.currentPos - Pos; } return(base.State); }
protected void RegisterLexerProc(int State, char[] Chars, LexerProc Proc) { this.GetLexerState(State).Add(Chars, Proc); }
protected void RegisterLexerProc(int State, LexerProc Proc) { this.GetLexerState(State).StateProc = Proc; }