Child pages
  • ExtendToken

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Code Block
| ExtendToken  = "extend" "token"  (Name "=")? BaseName "{" InlineExtensionRule* "}";

Use this construct to extend an extensible token declared in another syntax module. BaseName specifies the name of the rule that is to be extended. This name may be fully qualified, plain, or partially qualified if a syntax module in which the extensible rule is declared is opened with the using directive.

Code Block
extend token IgnoreToken
{
  ...
}

In this example IgnoreToken is extended with C and C++ style comment rules.

In case the extensible rule name gets in conflict with the names from the current syntax module, you can assign it a local alias – Name.

Code Block
extend token LocalAlias = Whitespaces.IgnoreToken
{
  ...
}

In this example Whitespaces.IgnoreToken is a fully qualified invocation of IgnoreToken from the Whitespaces module, and LocalAlias is a local name. This name is used as an AST name.

See also

Name
BaseName
ExtensionRule