Exemple #1
0
 public MatchContext(PatternRoot patternUst, Dictionary <string, IdToken> vars = null)
 {
     PatternUst = patternUst;
     if (vars != null)
     {
         Vars = vars;
     }
 }
Exemple #2
0
 public MatchContext(PatternRoot patternUst, UstConstantFolder ustConstantFolder, List <Ust> parentStack, Dictionary <string, IdToken> vars = null)
 {
     PatternUst        = patternUst;
     UstConstantFolder = ustConstantFolder;
     this.parentStack  = parentStack;
     if (vars != null)
     {
         Vars = vars;
     }
 }
        public PatternRoot Normalize(PatternRoot pattern)
        {
            var newPattern = new PatternRoot
            {
                Logger           = pattern.Logger,
                Key              = pattern.Key,
                FilenameWildcard = pattern.FilenameWildcard,
                File             = pattern.File,
                Languages        = new HashSet <Language>(pattern.Languages),
                DataFormat       = pattern.DataFormat,
                DebugInfo        = pattern.DebugInfo,
                Node             = Visit(pattern.Node),
            };
            var ascendantsFiller = new PatternAscendantsFiller(newPattern);

            ascendantsFiller.FillAscendants();
            return(newPattern);
        }
 public PatternAscendantsFiller(PatternRoot patternRoot)
 {
     this.patternRoot = patternRoot;
     parents          = new Stack <PatternUst>();
 }