Esempio n. 1
0
 private PatternMatchProgress(SemanticPattern pattern, int currentPatternPart, MatchElement[][] varBuffers, PatternMatchProgress[][] varSubstitutions)
 {
     Pattern             = pattern;
     _currentPatternPart = currentPatternPart;
     _varSubstitutions   = varSubstitutions;
     _varBuffers         = varBuffers; // we don't need copying because ctor is private
 }
Esempio n. 2
0
        internal MatchElement(SemanticPattern pattern, Dictionary <string, MatchElement> substitutions)
        {
            Pattern = pattern;
            foreach (var substitution in substitutions)
            {
                var child    = substitution.Value;
                var variable = substitution.Key;

                registerChild(child);
                _substitutions.Add(variable, child);
            }

            Token = Substitute(Pattern.Representation);
        }
Esempio n. 3
0
 internal void AddPattern(SemanticPattern pattern)
 {
     _patterns.Add(pattern);
 }
Esempio n. 4
0
 internal PatternMatchProgress(SemanticPattern pattern, MatchElement[] tokens)
 {
     Pattern           = pattern;
     _varBuffers       = new MatchElement[Pattern.PartCount][];
     _varSubstitutions = new PatternMatchProgress[_varBuffers.Length][];
 }
Esempio n. 5
0
 internal MatchElement(string token)
 {
     Token   = token;
     Pattern = SemanticPattern.Raw(Token);
 }