コード例 #1
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.PHPScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public PHPScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : base(tokenizer, scannerResult)
 {
     this.scannerResult     = scannerResult;
     this.xmlScanner        = new XmlScanner(this.Tokenizer, this.scannerResult);
     this.xmlScanner.Match += new MatchEventHandler(this.xmlScanner_Match);
     this.SetID("PHPScanner");
 }
コード例 #2
0
ファイル: CSharpHighlighter.cs プロジェクト: Verlic/BlueMoon
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public override IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.Tokenizer     = tokenizer;
            this.ScannerResult = scannerResult;

            IScanner wordScanner = this.BuildWordScanner();

            IScanner stringLineScanner = this.BuildStringScanner();

            stringLineScanner.Child = wordScanner;

            IScanner stringBlockScanner = this.BuildStringBlockScanner();

            stringBlockScanner.Child = stringLineScanner;

            IScanner commentLineScanner = this.BuildCommentLineScanner();

            commentLineScanner.Child = stringBlockScanner;

            CommentLineScanner xmlCommentLineScanner = new CommentLineScanner(this.Tokenizer, this.ScannerResult);

            xmlCommentLineScanner.CommentLineNode.Entities.Add("///");
            xmlCommentLineScanner.CommentLineNode.ForeColor = Color.Gray;
            xmlCommentLineScanner.Child = commentLineScanner;

            IScanner commentBlockScanner = this.BuildCommentBlockScanner();

            commentBlockScanner.Child = xmlCommentLineScanner;

            return(commentBlockScanner);
        }
コード例 #3
0
ファイル: PHPHighlighter.cs プロジェクト: Verlic/BlueMoon
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public override IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.Tokenizer     = tokenizer;
            this.ScannerResult = scannerResult;

            IScanner wordScanner = this.BuildWordScanner();

            StringLineScanner stringScanner = (StringLineScanner)this.BuildStringScanner();

            stringScanner.StringNode.Entities.Add(new StringEntity("'", "'", "\\"));
            stringScanner.Child = wordScanner;

            CommentLineScanner commentLineScanner = (CommentLineScanner)this.BuildCommentLineScanner();

            commentLineScanner.CommentLineNode.Entities.Add("#");
            commentLineScanner.Child = stringScanner;

            IScanner commentBlockScanner = this.BuildCommentBlockScanner();

            commentBlockScanner.Child = commentLineScanner;

            PHPScanner phpScanner = new PHPScanner(this.Tokenizer, this.ScannerResult);

            phpScanner.Child = commentBlockScanner;

            return(phpScanner);
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.ScannerBase"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public ScannerBase(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
 {
     this.dependencies  = new ScannerCollection();
     this.enabled       = true;
     this.id            = "Unnamed";
     this.tokenizer     = tokenizer;
     this.scannerResult = scannerResult;
 }
コード例 #5
0
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public override IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.Tokenizer     = tokenizer;
            this.ScannerResult = scannerResult;

            // We don't know yet what the chain of scanners will be.
            return(null);
        }
コード例 #6
0
ファイル: ASPXHighlighter.cs プロジェクト: Verlic/BlueMoon
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public override IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.Tokenizer     = tokenizer;
            this.ScannerResult = scannerResult;

            ASPXScanner aspxScanner = new ASPXScanner(this.Tokenizer, this.ScannerResult);

            return(aspxScanner);
        }
コード例 #7
0
ファイル: ASPXScanner.cs プロジェクト: Verlic/BlueMoon
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.ASPXScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <param name="aspxNode">A <see cref="Wilco.SyntaxHighlighting.ASPXNode"/> object.</param>
 public ASPXScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult, ASPXNode aspxNode)
     : base(tokenizer, scannerResult)
 {
     this.aspxNode           = aspxNode;
     this.aspxNode.BackColor = System.Drawing.Color.Yellow;
     this.xmlScanner         = new XmlScanner(this.Tokenizer, this.ScannerResult);
     this.xmlScanner.Match  += new MatchEventHandler(this.xmlScanner_Match);
     this.parser             = new HtmlParser();
     this.SetID("ASPXScanner");
 }
コード例 #8
0
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public override IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.Tokenizer     = tokenizer;
            this.ScannerResult = scannerResult;

            CssScanner cssScanner = new CssScanner(this.Tokenizer, this.ScannerResult);

            cssScanner.Child = this.BuildCommentBlockScanner();
            return(cssScanner);
        }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of an <see cref="Wilco.SyntaxHighlighting.CssScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public CssScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : base(tokenizer, scannerResult)
 {
     this.cssSelectorNameNode             = new CssAttributeNameNode();
     this.cssSelectorNameNode.ForeColor   = System.Drawing.Color.Maroon;
     this.cssAttributeNameNode            = new CssAttributeNameNode();
     this.cssAttributeNameNode.ForeColor  = System.Drawing.Color.Red;
     this.cssAttributeValueNode           = new CssAttributeValueNode();
     this.cssAttributeValueNode.ForeColor = System.Drawing.Color.Blue;
     this.SetID("CssScanner");
 }
コード例 #10
0
ファイル: Register.cs プロジェクト: Verlic/BlueMoon
 /// <summary>
 /// Registers the scanners.
 /// </summary>
 private void InitializeScanners(TokenizerBase tokenizer)
 {
     this.scanners.Add(new CommentBlockScanner());
     this.scanners.Add(new CommentLineScanner());
     this.scanners.Add(new StringBlockScanner());
     this.scanners.Add(new StringLineScanner());
     this.scanners.Add(new WordScanner());
     this.scanners.Add(new XmlScanner());
     this.scanners.Add(new ASPXScanner());
     this.scanners.Add(new PHPScanner());
 }
コード例 #11
0
ファイル: XmlScanner.cs プロジェクト: Verlic/BlueMoon
 /// <summary>
 /// Initializes a new instance of an <see cref="Wilco.SyntaxHighlighting.XmlScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public XmlScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : base(tokenizer, scannerResult)
 {
     this.xmlSpecialCharNode           = new XmlSpecialCharNode();
     this.xmlSpecialCharNode.ForeColor = System.Drawing.Color.Blue;
     this.xmlTagNode                      = new XmlTagNode();
     this.xmlTagNode.ForeColor            = System.Drawing.Color.Maroon;
     this.xmlNamespaceNode                = new XmlNamespaceNode();
     this.xmlNamespaceNode.ForeColor      = System.Drawing.Color.MediumVioletRed;
     this.xmlCommentNode                  = new XmlCommentNode();
     this.xmlCommentNode.ForeColor        = System.Drawing.Color.Green;
     this.xmlAttributeNameNode            = new XmlAttributeNameNode();
     this.xmlAttributeNameNode.ForeColor  = System.Drawing.Color.Red;
     this.xmlAttributeValueNode           = new XmlAttributeValueNode();
     this.xmlAttributeValueNode.ForeColor = System.Drawing.Color.Blue;
     this.SetID("XmlScanner");
 }
コード例 #12
0
ファイル: HighlighterBase.cs プロジェクト: Verlic/BlueMoon
        /// <summary>
        /// Builds a new chain of scanners.
        /// </summary>
        /// <param name="tokenizer">The tokenizer used by the scanners.</param>
        /// <param name="scannerResult">The scanner result.</param>
        /// <returns>
        /// The scanner at the start of the chain.
        /// </returns>
        public virtual IScanner BuildEntryPointScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
        {
            this.tokenizer     = tokenizer;
            this.scannerResult = scannerResult;

            IScanner wordScanner = this.BuildWordScanner();

            IScanner stringScanner = this.BuildStringScanner();

            stringScanner.Child = wordScanner;

            IScanner commentLineScanner = this.BuildCommentLineScanner();

            commentLineScanner.Child = stringScanner;

            IScanner commentBlockScanner = this.BuildCommentBlockScanner();

            commentBlockScanner.Child = commentLineScanner;

            return(commentBlockScanner);
        }
コード例 #13
0
ファイル: StringLineScanner.cs プロジェクト: Verlic/BlueMoon
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.StringLineScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <param name="stringNode">A <see cref="Wilco.SyntaxHighlighting.StringNode"/> object.</param>
 public StringLineScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult, StringNode stringNode) : base(tokenizer, scannerResult)
 {
     this.ScannerResult = scannerResult;
     this.stringNode    = stringNode;
     this.SetID("StringLineScanner");
 }
コード例 #14
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <returns>A new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.</returns>
 public override IScanner Create(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
 {
     return(new StringBlockScanner(tokenizer, scannerResult));
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.StringBlockScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <param name="stringNode">A <see cref="Wilco.SyntaxHighlighting.StringNode"/> object.</param>
 public StringBlockScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult, StringNode stringNode) : base(tokenizer, scannerResult)
 {
     this.stringNode = stringNode;
     this.lastToken  = null;
     this.SetID("StringBlockScanner");
 }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.StringBlockScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public StringBlockScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : this(tokenizer, scannerResult, new StringNode())
 {
     //
 }
コード例 #17
0
ファイル: ASPXScanner.cs プロジェクト: Verlic/BlueMoon
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.ASPXScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public ASPXScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
     : this(tokenizer, scannerResult, new ASPXNode())
 {
     //
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.CommentBlockScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <param name="commentBlockNode">A <see cref="Wilco.SyntaxHighlighting.CommentBlockNode"/> object.</param>
 public CommentBlockScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult, CommentBlockNode commentBlockNode) : base(tokenizer, scannerResult)
 {
     this.commentBlockNode = commentBlockNode;
     this.SetID("CommentBlockScanner");
 }
コード例 #19
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.CommentBlockScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public CommentBlockScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : this(tokenizer, scannerResult, new CommentBlockNode())
 {
     //
 }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.WordScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <param name="wordNodes">An array of <see cref="Wilco.SyntaxHighlighting.WordNode"/> objects.</param>
 public WordScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult, WordNode[] wordNodes) : base(tokenizer, scannerResult)
 {
     this.wordNodes = wordNodes;
     this.SetID("WordScanner");
 }
コード例 #21
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <returns>A new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.</returns>
 public abstract IScanner Create(TokenizerBase tokenizer, OccurrenceCollection scannerResult);
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 /// <returns>A new instance of a <see cref="Wilco.SyntaxHighlighting.IScanner"/> implementation class.</returns>
 public override IScanner Create(TokenizerBase tokenizer, OccurrenceCollection scannerResult)
 {
     return(new CommentLineScanner(tokenizer, scannerResult));
 }
コード例 #23
0
 /// <summary>
 /// Initializes a new instance of a <see cref="Wilco.SyntaxHighlighting.WordScanner"/> class.
 /// </summary>
 /// <param name="tokenizer">The <see cref="Wilco.SyntaxHighlighting.TokenizerBase"/> which is used to tokenize the source code.</param>
 /// <param name="scannerResult">The <see cref="Wilco.SyntaxHighlighting.OccurrenceCollection"/> which will contain the scanner result.</param>
 public WordScanner(TokenizerBase tokenizer, OccurrenceCollection scannerResult) : this(tokenizer, scannerResult, new WordNode[0])
 {
     //
 }