Mercurial > emacs
comparison etc/ETAGS.EBNF @ 47053:b87525d8fbd7
Clarified per rms request.
author | Francesco Potortì <pot@gnu.org> |
---|---|
date | Tue, 27 Aug 2002 16:13:12 +0000 |
parents | eeab5bdaffa2 |
children | d0c1bb6d79a0 |
comparison
equal
deleted
inserted
replaced
47052:40da307fae0a | 47053:b87525d8fbd7 |
---|---|
1 -*- indented-text -*- | 1 -*- indented-text -*- |
2 | 2 |
3 This file contains two sections: | 3 This file contains two sections: |
4 | 4 |
5 1) An EBNF (Extended Backus Normal Form) description of the format of | 5 1) An EBNF (Extended Backus Normal Form) description of the format of |
6 the tags file created by etags.c and interpreted by etags.el | 6 the tags file created by etags.c and interpreted by etags.el; |
7 2) A discussion of tag names and implicit tag names | 7 2) A discussion of tag names and implicit tag names. |
8 | 8 |
9 ======================= EBNF tag file description ======================= | 9 ====================== 1) EBNF tag file description ===================== |
10 | 10 |
11 Productions created from current behavior to aid extensions | 11 Productions created from current behavior to aid extensions |
12 Francesco Potorti` <pot@gnu.org> 2002 | 12 Francesco Potorti` <pot@gnu.org> 2002 |
13 ---------------- | 13 ---------------- |
14 | 14 |
56 | 56 |
57 ==================== end of EBNF tag file description ==================== | 57 ==================== end of EBNF tag file description ==================== |
58 | 58 |
59 | 59 |
60 | 60 |
61 ======================== discussion of tag names ========================= | 61 ======================= 2) discussion of tag names ======================= |
62 | 62 |
63 - What are tag names | 63 - WHAT ARE TAG NAMES |
64 Tag lines in a tags file are usually made from the above defined pattern | 64 Tag lines in a tags file are usually made from the above defined pattern |
65 and by an optional tag name. The pattern is a string that is searched | 65 and by an optional tag name. The pattern is a string that is searched |
66 in the source file to find the tagged line. | 66 in the source file to find the tagged line. |
67 | 67 |
68 - Why tag names are good | 68 - WHY TAG NAMES ARE GOOD |
69 When a user looks for a tag, Emacs first compares the tag with the tag | 69 When a user looks for a tag, Emacs first compares the tag with the tag |
70 names contained in the tags file. If no match is found, Emacs compares | 70 names contained in the tags file. If no match is found, Emacs compares |
71 the tag with the patterns. The tag name is then the preferred way to | 71 the tag with the patterns. The tag name is then the preferred way to |
72 look for tags in the tags file, because when the tag name is present | 72 look for tags in the tags file, because when the tag name is present |
73 Emacs can find a tag faster and more accurately. These tag names are | 73 Emacs can find a tag faster and more accurately. These tag names are |
74 part of tag lines in the tags file, so we call them "explicit". | 74 part of tag lines in the tags file, so we call them "explicit". |
75 | 75 |
76 - Why implicit tag names are even better | 76 - WHY IMPLICIT TAG NAMES ARE EVEN BETTER |
77 When a tag line has no name, but a name can be deduced from the pattern, | 77 When a tag line has no name, but a name can be deduced from the pattern, |
78 we say that the tag line has an implicit tag name. etags.c uses | 78 we say that the tag line has an implicit tag name. Often tag names are |
79 implicit tag names when possible, in order to reduce the number of | 79 redundant; this happens when the name of a tag is an easily guessable |
80 explicit tag names in a tags file, thus reducing the size of the tags | 80 substring of the tag pattern. We define a set of rules to decide |
81 file. When the user looks for a tag, and Emacs founds no explicit tag | 81 whether it is possible to deduce the tag name from the pattern, and make |
82 names that match it, Emacs then tries to match the tag with an implicit | 82 an unnamed tag in those cases. The name deduced from the pattern of an |
83 tag name. Such a match occurs when the tag matches a pattern, subject | 83 unnamed tag is the implicit name of that tag. etags.c uses implicit tag |
84 to the satisfaction of all the following four rules: | 84 names when possible, in order to reduce the size of the tags file. |
85 An implicit tag name is deduced from the pattern by discarding the | |
86 last character if it is one of ` \f\t\n\r()=,;', then taking all the | |
87 rightmost consecutive characters in the pattern which are not one of | |
88 those. | |
85 | 89 |
86 NONAM=" \f\t\n\r()=,;"; | 90 ===================== end of discussion of tag names ===================== |
87 1. the tag does not contain any of the characters in NONAM; | |
88 2. the pattern contains the tag as either a rightmost, or rightmost | |
89 but one character, substring; | |
90 3. the character, if any, immediately before the tag in the pattern | |
91 must be a character in NONAM; | |
92 4. the character, if any, immediately after the tag in the pattern | |
93 must also be a character in NONAM. | |
94 | |
95 ===================== end of discussion on tag names ===================== |