Example #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);
        }
Example #2
0
 public void InitTests()
 {
     tokenizer = new RegExpTokenizer();
     tokenizer.SetTransitionFunction(new TableDrivenTransitionFunction());
 }