Assertion Elements

Contents

End Of File Matcher


The end of file matcher is a zero-width assertion that tests if the matcher engine is currently at the end of the file being matched. If the engine is at the end of file, this matcher will return true. It is possible to negate the logic of this matcher via the "negate" attribute.

Syntax

<end-of-file/>

Class

com.aptana.ide.lexer.matcher.EndOfFileMatcher

Children

none

Attributes

Name Description Type Default Required
negate Determines if the matcher should or should not match letters. True will match letters and false will match anything except letters. boolean true no


End Of Line Matcher


The end of line matcher is a zero-width assertion that tests if the matcher engine is currently at a '\r' character, a '\n' character, or the end of the file. If any of those conditions are true, the matcher will return true. It is possible to negate the logic of this matcher via the "negate" attribute.

Syntax

<end-of-line/>

Class

com.aptana.ide.lexer.matcher.EndOfLineMatcher

Children

none

Attributes

Name Description Type Default Required
negate Determines if the matcher should or should not match letters. True will match letters and false will match anything except letters. boolean true no


Lookahead Matcher


The lookahead matcher allows for the test of a pattern without consuming the matched text. The match can be negated to return true only if the pattern does not match. This is useful when matching keywords where you can test that no other letter follows the matched keyword without consuming the character being tested.

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

<lookahead negate="true">
  <or>
    <letter/>
    <digit/>
    <character>_</character>
  </or>
</lookahead>

Class

com.aptana.ide.lexer.matcher.LookaheadMatcher

Children

Any IMatcher class

Attributes

Name Description Type Default Required
negate Indicates whether this matcher should report success if the match is successful or if the match fails. boolean true no


Start Of File Matcher


The start of file matcher is a zero-width assertion that tests if the matcher engine is currently at the start of the file being matched. If the engine is at the start of the file, this matcher will return true. It is possible to negate the logic of this matcher via the "negate" attribute.

Syntax

<start-of-file/>

Class

com.aptana.ide.lexer.matcher.StartOfFileMatcher

Children

none

Attributes

Name Description Type Default Required
negate Determines if the matcher should or should not match letters. True will match letters and false will match anything except letters. boolean true no


Start Of Line Matcher


The start of line matcher is a zero-width assertion that tests if the matcher engine is currently after a '\r' character, a '\n' character, or is at the start of the file. If any of those conditions are true, the matcher will return true. It is possible to negate the logic of this matcher via the "negate" attribute.

Syntax

<start-of-line/>

Class

com.aptana.ide.lexer.matcher.StartOfLineMatcher

Children

none

Attributes

Name Description Type Default Required
negate Determines if the matcher should or should not match letters. True will match letters and false will match anything except letters. boolean true no


Word Boundary Matcher


The word boundary matcher determines if the current offset within a string is at a word boundary. A word boundary is defined as the position between two characters where one is a word character as defined but the WordMatcher and the other is not a word character. Special cases occur at the before the first character and after the last character. In those cases, this matcher will return true. It is possible to negate the logic of this matcher via the "negate" attribute.

Syntax

<word-boundary/>

Class

com.aptana.ide.lexer.matcher.WordBoundaryMatcher

Children

none

Attributes

Name Description Type Default Required
negate Determines if the matcher should or should not match between a word character and a non-word character. True will match between a word character and a non-word character. False will match between two word characters or between two non-word characters. boolean true no