Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      . . .
      Display Primitives
         Creating & Destroying Windows
         Window Resizing Primitives
         Preserving Window Arrangements
         . . .
         Colors
      File Primitives
         . . .
         Manipulating File Names
         Internet Primitives
         Tagging Internals
      Operating System Primitives
         System Primitives
         Window System Primitives
         Timing
         Calling Windows DLLs
         Running a Process
      . . .

Previous   Up    Next
Parsing URLs  Primitives and EEL Subroutines   System Primitives


Epsilon User's Manual and Reference > Primitives and EEL Subroutines > File Primitives >

Tagging Internals

This section describes how to add tagging support to Epsilon for other languages. Epsilon already knows how to find tags in C and EEL files, and in assembly languages files.

tag_suffix_ext()     /* example function */
tag_suffix_none()
tag_suffix_default()
tag_mode_c()

When Epsilon wants to add tags for a file, it first looks at the file's extension and constructs a function name of the form tag_suffix_ext(), where ext is the extension. It tries to call this function to tag the file. If the file has no extension, it tries to call tag_suffix_none( ).

If there is no function with the appropriate name, Epsilon looks for a function based on the current buffer's mode. It constructs a function name of the form tag_mode_mode(), where mode is the value of the major_mode variable in the current buffer. If there is no mode-based function either, Epsilon calls tag_suffix_default( ) instead.

Thus, to add tagging for a language that uses file names ending in .xyz, define a function named tag_suffix_xyz(). Or if such files (and perhaps files with other extensions) use mode named "Xyz", define a function named tag_mode_xyz(). In most cases, a mode-based name is more convenient.

add_tag(char *func, int pos)

The tagging function will be called with point positioned at the start of the buffer to be tagged. (Epsilon preserves the old value of point.) It should search through the buffer, looking for names it wishes to tag. To add a tag, it should call the subroutine add_tag( ), passing it the tag name and the offset of the first character of the name within the file. You can use the tagging functions for C and assembler as examples to write your own tagging functions. They are in the source file tags.e.

If the tag is a member of a class (or any similar language construct), include the class name at the start of the name passed to add_tag( ), followed by two colons "::". Use two colons as the class name separator when calling add_tag( ), even if the language uses some other separator after its class names. You may include any number of class name prefixes.

The pluck-tag command uses a regular expression pattern to parse an identifier in the buffer. By default, it uses the pattern in the variable tag-pattern-default. A mode can define a variable like tag-pattern-perl or tag-pattern-c to make Epsilon use a different pattern. (For instance, the pattern for C mode says that identifiers can include :: to specify a class name.)

Epsilon constructs a variable name, like tag-pattern-perl, from the current mode's name. If a variable by that name exists, pluck-tag uses it in place of tag-pattern-default.



Previous   Up    Next
Parsing URLs  Primitives and EEL Subroutines   System Primitives


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.