예제 #1
0
파일: Region.cs 프로젝트: svermeulen/iris
 public Region(SyntaxContext context, string groupName)
     : base(context, groupName)
 {
     this.m_startPatterns = new List<Pattern>();
     this.m_skipPatterns = new List<Pattern>();
     this.m_endPatterns = new List<Pattern>();
 }
예제 #2
0
파일: VimMatch.cs 프로젝트: svermeulen/iris
        public VimMatch(SyntaxContext context, string groupName, Pattern pattern)
            : base(context, groupName)
        {
            ArgumentValidator.ThrowIfNull(pattern, "pattern");
            ArgumentValidator.ThrowIfNullOrEmpty(groupName, "groupName");

            this.m_pattern = pattern;
        }
예제 #3
0
파일: Cluster.cs 프로젝트: svermeulen/iris
        internal Cluster(SyntaxContext context)
        {
            ArgumentValidator.ThrowIfNull(context, "scope");

            this.m_containedGroupsAndClusters = new List<string>();
            this.m_syntaxContext = context;
            this.m_ClusterType = ClusterType.NONMAGIC;
            this.m_directItems = new SetOfSyntaxItems();
            this.m_syntaxDefinition = context.SyntaxDefinition;
        }
예제 #4
0
파일: Keyword.cs 프로젝트: svermeulen/iris
        public Keyword(SyntaxContext context, string groupName, string name, bool ignoreCase)
            : base(context, groupName)
        {
            ArgumentValidator.ThrowIfNullOrEmpty(name, "name");

            // MAY: implement more elegant solution here
            // At this point, we have been added by base() to syntaxDefinition.AllItems and also to TopItems. AllItems is unordered,
            // but TopItems is ordered. Unfortunately we must now change our orderingBoost, which messes up the ordering in TopItems.
            // So we remove ourselves, and then put ourselves back there.
            context.TopItems.Remove(this);
            this.m_orderingBoost = ignoreCase ? 1 : 2;
            this.m_ignoreCase = ignoreCase;
            context.TopItems.Add(this);

            this.SetupKeyword(name);
        }
예제 #5
0
        private static void DoContext(SyntaxContext context)
        {
            Console.WriteLine("\nContext:  {0}", context.Name);

            foreach (SyntaxItem item in context.AllItems) {
                StringBuilder firstLine = new StringBuilder(32);
                string moreLines = null;

                if (item is Keyword) {
                    firstLine.AppendFormat("{0,3} keyword  {1,-10} {2,-10} {3}", item.LineNumberInSyntaxFile, (item as Keyword).Name, item.GroupName, item.HighlightMode);
                } else if (item is VimMatch) {
                    firstLine.AppendFormat("{0,3} vimMatch {1,-10} {2}", item.LineNumberInSyntaxFile, item.GroupName, item.HighlightMode);
                    moreLines = DumpPattern((item as VimMatch).Pattern, string.Empty);
                } else if (item is Region) {
                    firstLine.AppendFormat("{0,3} region	{1,-10} {2}", item.LineNumberInSyntaxFile, item.GroupName, item.HighlightMode);
                    moreLines = DumpRegionPatterns((Region) item);
                }

                AppendCommonOptions(item, firstLine);

                Console.WriteLine(firstLine.ToString());
                if (moreLines != null) {
                    Console.Write(moreLines);
                }
            }
        }
예제 #6
0
파일: Cluster.cs 프로젝트: svermeulen/iris
 internal Cluster(SyntaxContext context, string myClusterName)
     : this(context)
 {
     this.m_clusterName = myClusterName;
 }
예제 #7
0
 public ContainerItem(SyntaxContext context, string groupName)
     : base(context, groupName)
 {
     this.m_contains = new Cluster(context);
     this.m_containedItems = new SetOfSyntaxItems();
 }
예제 #8
0
        private void ImportSyntax(Match m, SyntaxContext syntaxContext)
        {
            if (!this.IsProcessingTokens) {
                return;
            }

            string fullScriptPath = this.SourceFile.ScriptFile.Directory.FullName + "\\" + m.Groups["syntaxId"].Value;
            ScriptSourceFile sourceFile = new ScriptSourceFile(new FileInfo(fullScriptPath), syntaxContext);

            this.m_sourceFiles.Add(sourceFile);
            this.ParseFile();
        }
예제 #9
0
 internal ScriptSourceFile(FileInfo scriptFile, SyntaxContext syntaxContext)
 {
     this.ScriptFile = scriptFile;
     this.Reader = new StreamReader(scriptFile.OpenRead(), true);
     this.SyntaxContext = syntaxContext;
 }