Structural Elements

Contents

Category Group Element


The Category Group Element groups matchers into named categories. All descendents of a category group will inherit this element's category unless they explicitly define their own category attribute.

Syntax

<category-group category="WHITESPACE">
...
</category-group>

Class

com.aptana.ide.lexer.matcher.model.CategoryGroupElement

Children

Any IMatcher class

Attributes

Name Description Type Default Required
category Sets the category to which all descendants will be associated. Descendents may override this value by defining their own category attributes. The active category name is used when adding tokens to the MatcherTokenList for IMatcher elements that define a type attribute. String null yes


Lexer Element


The Lexer Element is the XML root element used when defining a language's lexer. This element includes attributes for defining the language's MIME type and the associated enumeration used to cross-reference type attribute values to integers.

The Lexer Element (and all descendants) must be in the http://www.aptana.com/2007/lexer/1.2 namespace.

Syntax

<lexer
    xmlns="http://www.aptana.com/2007/lexer/1.2"
    language="text/css"
    type-enumeration="com.aptana.ide.editor.css.lexing.CSSTokenTypes">
...
</lexer>

Class

com.aptana.ide.lexer.matcher.model.LexerElement

Children

<token-group/>
<bundle/>
<package/>

Attributes

Name Description Type Default Required
language Sets the MIME type for this lexer's language String null yes
category-enumeration The fully-qualified Java class to be used to lookup integer values for type category values String null no
type-enumeration The fully-qualified Java class to be used to lookup integer values for type attribute values String null no


Token Group Element


The Token Group Element groups matchers into named groups. All children of a token group are added to the resulting MatcherTokenList created by the Lexer Element.

Syntax

<token-group group="default">
...
</token-group>

Class

com.aptana.ide.lexer.matcher.model.TokenGroupElement

Children

<category-group/>
Any IMatcher class

Attributes

Name Description Type Default Required
group Sets the group to which this element's children will be associated in the MatcherTokenList String null yes


Use Element


The Use Element allows for the injection of matched text from a previously successful match. This allows for dynamic defintion of a matcher's content at runtime. Currently, only StringMatchers and CharacterMatchers allow use elements as children.

Syntax

<and category="LITERAL" type="STRING">
  <character-class name="quote">'"</character-class>
  <to-delimiter>
    <string>
      <use name="quote"/>
    </string>
  </to-delimiter>
</and>

Class

com.aptana.ide.lexer.matcher.model.UseElement

Children

none

Attributes

Name Description Type Default Required
name Specifies a name defined in another matcher's name attribute. The text from that matcher's last successful match will be used in place of the use element. String null yes