/// <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"); }
/// <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); }
/// <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); }
/// <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; }
/// <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); }
/// <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); }
/// <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"); }
/// <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); }
/// <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"); }
/// <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()); }
/// <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"); }
/// <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); }
/// <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"); }
/// <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)); }
/// <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"); }
/// <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()) { // }
/// <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()) { // }
/// <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"); }
/// <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()) { // }
/// <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"); }
/// <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);
/// <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)); }
/// <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]) { // }