예제 #1
0
        public void InitTests()
        {
            fileName = Path.GetTempFileName();
            File.WriteAllText(fileName, SOURCE);

            tokenizer = new RegExpTokenizer();
            tokenizer.SetTransitionFunction(new TableDrivenTransitionFunction());
            Array.ForEach(lexemes, (s) => tokenizer.UseTerminal(RegExp.Literal(s)));
            tokenizer.BuildTransitions();

            lexer = new Lexer(tokenizer);
            fileStream = File.OpenRead(fileName);
            lexer.SetDataSource(fileStream);
        }
예제 #2
0
 public void InitTests()
 {
     tokenizer = new RegExpTokenizer();
     tokenizer.SetTransitionFunction(new TableDrivenTransitionFunction());
 }