1 |
EBNF (Extended Backus Normal Form) description of the format of the tags |
This file contains two sections: |
2 |
file created by etags.c and interpreted by etags.el |
|
3 |
|
1) An EBNF (Extended Backus Normal Form) description of the format of |
4 |
|
the tags file created by etags.c and interpreted by etags.el |
5 |
|
2) A discussion of tag names and implicit tag names |
6 |
|
|
7 |
|
======================= EBNF tag file description ======================= |
8 |
|
|
9 |
Productions created from current behaviour to aid extensions |
Productions created from current behaviour to aid extensions |
10 |
Francesco Potorti` <pot@gnu.org> 2002 |
Francesco Potorti` <pot@gnu.org> 2002 |
11 |
================================================================ |
---------------- |
12 |
|
|
13 |
FF ::= #x0c /* tag section starter */ |
FF ::= #x0c /* tag section starter */ |
14 |
|
|
51 |
position ::= realposition | "," /* charpos,linepos */ |
position ::= realposition | "," /* charpos,linepos */ |
52 |
|
|
53 |
realposition ::= "," unsint | unsint "," | unsint "," unsint |
realposition ::= "," unsint | unsint "," | unsint "," unsint |
54 |
|
|
55 |
|
==================== end of EBNF tag file description ==================== |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
======================== discussion on tag names ========================= |
60 |
|
|
61 |
|
- What are tag names |
62 |
|
Tag lines in a tags file are usually made from the above defined pattern |
63 |
|
and by an optional tag name. The pattern is a string that is searched |
64 |
|
in the source file to find the tagged line. |
65 |
|
|
66 |
|
- Why tag names are good |
67 |
|
When a user looks for a tag, Emacs first compares the tag with the tag |
68 |
|
names contained in the tags file. If no match is found, Emacs compares |
69 |
|
the tag with the patterns. The tag name is then the preferred way to |
70 |
|
look for tags in the tags file, because when the tag name is present |
71 |
|
Emacs can find a tag faster and more accurately. These tag names are |
72 |
|
part of tag lines in the tags file, so we call them "explicit". |
73 |
|
|
74 |
|
- Why implicit tag names are even better |
75 |
|
The purpose of implicit tag names is to reduce the number of tag names |
76 |
|
in a tags file, thus reducing the size of the tags file. When the user |
77 |
|
looks for a tag, and Emacs founds no explicit tag names that match it, |
78 |
|
Emacs then tries to match the tag with an implicit tag name. Such a |
79 |
|
match occurs when the tag matches a pattern, subject to the satisfaction |
80 |
|
of all the following four rules: |
81 |
|
|
82 |
|
NONAM=" \f\t\n\r()=,;"; |
83 |
|
1. the tag does not contain any of the characters in NONAM; |
84 |
|
2. the pattern contains the tag as either a rightmost, or rightmost |
85 |
|
but one character, substring; |
86 |
|
3. the character, if any, immediately before the tag in the pattern |
87 |
|
must be a character in NONAM; |
88 |
|
4. the character, if any, immediately after the tag in the pattern |
89 |
|
must also be a character in NONAM. |
90 |
|
|
91 |
|
===================== end of discussion on tag names ===================== |