Contents |
Comment Matcher
The comment matcher matches all text from a starting pattern to an ending pattern. The starting and ending patterns are included in the matched text. The default configuration matches comments that begin with '//' and end at, but not including a line terminator.
Syntax
<comment/>
Class
com.aptana.ide.lexer.matcher.CommentMatcher
Children
none
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
start | This is a pattern matcher that indicates the beginning of a comment. | IMatcher | Matches the string "//" | no |
end | This is a pattern matcher that indicates the end of a comment. | IMatcher | Matches zero or more characters until, but not including a return or newline character | no |
Identifier Matcher
The identifier matcher is used to match identifiers. An identifier starts with a character from a start-characters set and is followed by zero-or-more part-characters.
Syntax
<identifier start-characters="$-"/>
Class
com.aptana.ide.lexer.matcher.IdentifierMatcher
Children
none
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
start-characters | Defines a set of character that may start an identifier. These characters are checked in addition to the default set which includes letters and "_" | String | "" | no |
part-characters | Defines a set of character that may follow the first character of an identifier. These characters are checked in addition to the default set which includes letters, numbers, and "_" | String | "" | no |
Line Terminator Matcher
A line terminator matcher matches a single return, a single newline, or a single return plus a newline. This can be thought of as a platform independent line ending matcher.
Syntax
<line-terminator/>
Class
com.aptana.ide.lexer.matcher.LineTerminatorMatcher
Children
none
Attributes
This matcher does not have attributes
Number Matcher
A number matcher is used to match integers and floating point numbers with optional leading plus or minus characters and optional trailing scientific notation. The components that are allowed to match are configurable to cover a wide set of number syntaxes.
Syntax
<number match-negative="false" />
Class
com.aptana.ide.lexer.matcher.NumberMatcher
Children
none
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
match-negative | Determines if the matched number may be preceded by an optional "-" character. | boolean | true | no |
match-positive | Determines if the matched number may be preceded by an optional "+" character. | boolean | true | no |
match-integer-part | Determines if the number is comprised of digits. This would match up to but not include a "." | boolean | true | no |
match-fraction-part | Determines if the number includes a decimal point followed by one or more digits. | boolean | true | no |
match-sci-notation | Determines if the number includes a trailing exponent which is the letter 'e' followed by an optional "+" or "-", followed by one or more digits. | boolean | false | no |
Quoted String Matcher
The quoted string matcher matchers text surrounded by the same delimiting character at the start and end of a string literal. One or more delimiting characters are defined using the characters from the matchers text node.
Syntax
<quoted-string>"'`</quoted-string>
Class
com.aptana.ide.lexer.matcher.QuotedStringMatcher
Children
none
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
escape-characters | Determines if the matcher should allow its delimiting character to be included in the result when it is preceded by a "\". | boolean | true | no |
multi-line | Determines if the matcher should allow returns and newlines within the matched string. | boolean | false | no |
Regex Matcher
A regex matcher allows the developer to define a text matcher expression using regular expression syntax. Note that all whitespace is ignored by default so spaces will need to be escaped with a leading backslash, '\'.
Syntax
<regex>^abc</regex> match "abc" at start of line <regex>abc$</regex> match "abc" at end of line <regex>abc|def</regex> match "abc" or "def" <regex>(a|b)(c|d)</regex> match "a" or "b" followed by "c" or "d" <regex>(?:a|b)(?:c|d)</regex> match "a" or "b" followed by "c" or "d" <regex>abc(?=def)</regex> match "abc" if it is followed by "def" <regex>abc(?!def)</regex> match "abc" if it is not followed by "def" <regex>a*</regex> match zero or more a's <regex>a+</regex> match one or more a's <regex>a?</regex> optionally match "a" <regex>a{4}</regex> match exactly 4 a's <regex>a{,4}</regex> match between 0 and 4 a's <regex>a{4,}</regex> match 4 or more a's <regex>a{2,4}</regex> match 2 to 4 a's <regex>[a-c]</regex> match "a", "b", or "c" <regex>[-a-c]</regex> match "-", "a", "b", or "c" <regex>[^a-c]</regex> match anything but "a", "b", or "c" <regex>[^-a-c]</regex> match anything but "-", "a", "b", or "c" <regex>.</regex> match any character except return or newline <regex>\Aabc</regex> match "abc" only at the beginning of the string <regex>abc\b</regex> match "abc" only if a word character follows it <regex>abc\B</regex> match "abc" only if a non-word character follows it <regex>\d</regex> match a digit <regex>\D</regex> match anything but a digit <regex>\s</regex> match whitespace <regex>\S</regex> match anything but whitespace <regex>\r</regex> match return <regex>\n</regex> match newline <regex>\t</regex> match tab <regex>\f</regex> match formfeed <regex>\v</regex> match vertical tab <regex>\w</regex> match a word character (alphanumeric or _) <regex>\W</regex> match a non-word character <regex>abc\Z</regex> match "abc" only at the end of the string
Class
com.aptana.ide.lexer.matcher.RegexMatcher
Children
text only
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
ignore-whitespace | Determine if whitespace should be included in the pattern or ignored. When this attribute is true, then all spaces and tabs must be escaped with a backslash, '\'. When this attribute is false, then all spaces and tabs will be included in the regular expression | Boolean | false | no |
String Matcher
A string matcher is used to match a sequence of characters. The character sequence is defined by the matchers text content.
Syntax
<string>This is a test</string>
Class
com.aptana.ide.lexer.matcher.StringMatcher
Children
<use/>
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
case-insensitive | Determines if the sequence of characters must match with case sensitivity or not. | boolean | false | no |
To Delimiter Matcher
The to-delimiter matcher will advance along the source input until a delimiter pattern matches successfully. The delimiting pattern is defined by the child content of the to-delimiter element. If no matcher elements are defined as children of this element, the string content will be wrapped in a StringMatcher which will then be used as this element's delimiter.
The delimiting pattern may be optionally excluded from the match.
If this element contains more than one child, all children will be wrapped in an AndMatcher which then becomes the child of this element.
Syntax
<to-delimiter> <character-set>.;:</character-set> </to-delimiter>
Class
com.aptana.ide.lexer.matcher.ToDelimiterMatcher
Children
Any IMatcher class
Attributes
Name | Description | Type | Default | Required |
---|---|---|---|---|
include-delimiter | Determines if the delimiter will be included will be included in the matched region or not. A value of true includes the delimiter. A value of false does not. | Boolean | true | no |
match-end-of-file | Determines if this matcher will report success if the end-of-file is encountered before a match is found for the delimiter. A value of true will report success in that case. A value of false will report failure. | Boolean | false | no |