Mercurial > pub > ImplabNet
comparison Implab/Formats/ScannerContext.cs @ 176:0c3c69fe225b ref20160224
rewritten the text scanner
author | cin |
---|---|
date | Tue, 22 Mar 2016 18:58:40 +0300 |
parents | |
children | a0ff6a0e9c44 |
comparison
equal
deleted
inserted
replaced
175:96a89dcb4060 | 176:0c3c69fe225b |
---|---|
1 using System; | |
2 | |
3 namespace Implab.Formats { | |
4 public class ScannerContext<TTag> { | |
5 public int[,] Dfa { get; private set; } | |
6 public bool[] Final { get; private set; } | |
7 public TTag[][] Tags { get; private set; } | |
8 public int State { get; private set; } | |
9 public int[] Alphabet { get; private set; } | |
10 | |
11 public ScannerContext(int[,] dfa, bool[] final, TTag[][] tags, int state, int[] alphabet) { | |
12 Dfa = dfa; | |
13 Final = final; | |
14 Tags = tags; | |
15 State = state; | |
16 Alphabet = alphabet; | |
17 } | |
18 | |
19 public bool Execute(TextScanner scanner, out TTag[] tag) { | |
20 return scanner.ReadToken(Dfa, Final, Tags, State, Alphabet, out tag); | |
21 } | |
22 } | |
23 } | |
24 |