mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 16:51:56 +00:00
34 lines
799 B
C#
34 lines
799 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace ZoneCodeGenerator.Parsing.Matching
|
|
{
|
|
class MatchingContext
|
|
{
|
|
public ILexer Lexer { get; }
|
|
|
|
public bool Verbose { get; set; }
|
|
|
|
private readonly Dictionary<string, TokenMatcher> taggedMatchers;
|
|
|
|
public MatchingContext(ILexer lexer, Dictionary<string, TokenMatcher> taggedMatchers)
|
|
{
|
|
Lexer = lexer;
|
|
this.taggedMatchers = taggedMatchers;
|
|
|
|
#if DEBUG
|
|
Verbose = true;
|
|
#else
|
|
Verbose = false;
|
|
#endif
|
|
}
|
|
|
|
public TokenMatcher GetMatcherByTag(string tag)
|
|
{
|
|
return taggedMatchers.ContainsKey(tag) ? taggedMatchers[tag] : null;
|
|
}
|
|
}
|
|
}
|