aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2009-11-16 22:25:49 +0000
committerChong Yidong2009-11-16 22:25:49 +0000
commit3149927d2fd0b67dc917ab29bbf8344dc1500cc3 (patch)
tree4591bac4bc6927a55c7e030a0edd491c6578614f /doc
parent48b27575344c9352bd4eab19fa1a17f97fb21dda (diff)
downloademacs-3149927d2fd0b67dc917ab29bbf8344dc1500cc3.tar.gz
emacs-3149927d2fd0b67dc917ab29bbf8344dc1500cc3.zip
* Makefile.in: Build the Semantic manual.
* semantic.texi, sem-user.texi: New files, adapted from the Semantic repository.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/ChangeLog7
-rw-r--r--doc/misc/Makefile.in8
-rw-r--r--doc/misc/ede.texi6
-rw-r--r--doc/misc/sem-user.texi787
-rw-r--r--doc/misc/semantic.texi638
5 files changed, 1443 insertions, 3 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 5cdbdded3f4..e0f0baed986 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,10 @@
12009-11-16 Chong Yidong <cyd@stupidchicken.com>
2
3 * Makefile.in: Build the Semantic manual.
4
5 * semantic.texi, sem-user.texi: New files, adapted from the Semantic
6 repository.
7
12009-11-16 Michael Albinus <michael.albinus@gmx.de> 82009-11-16 Michael Albinus <michael.albinus@gmx.de>
2 9
3 * dbus.texi (Receiving Method Calls): New defun 10 * dbus.texi (Receiving Method Calls): New defun
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 9aeea6149b0..4c04ad60e41 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -74,6 +74,7 @@ INFO_TARGETS = \
74 $(infodir)/reftex \ 74 $(infodir)/reftex \
75 $(infodir)/sasl \ 75 $(infodir)/sasl \
76 $(infodir)/sc \ 76 $(infodir)/sc \
77 $(infodir)/semantic \
77 $(infodir)/ses \ 78 $(infodir)/ses \
78 $(infodir)/sieve \ 79 $(infodir)/sieve \
79 $(infodir)/smtpmail \ 80 $(infodir)/smtpmail \
@@ -122,6 +123,7 @@ DVI_TARGETS = \
122 remember.dvi \ 123 remember.dvi \
123 sasl.dvi \ 124 sasl.dvi \
124 sc.dvi \ 125 sc.dvi \
126 semantic.dvi \
125 ses.dvi \ 127 ses.dvi \
126 sieve.dvi \ 128 sieve.dvi \
127 smtpmail.dvi \ 129 smtpmail.dvi \
@@ -383,6 +385,12 @@ $(infodir)/sc: sc.texi
383sc.dvi: sc.texi 385sc.dvi: sc.texi
384 $(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi 386 $(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi
385 387
388semantic : $(infodir)/semantic
389$(infodir)/semantic: semantic.texi sem-user.texi
390 cd $(srcdir); $(MAKEINFO) semantic.texi
391semantic.dvi: semantic.texi
392 $(ENVADD) $(TEXI2DVI) ${srcdir}/semantic.texi
393
386ses : $(infodir)/ses 394ses : $(infodir)/ses
387$(infodir)/ses: ses.texi 395$(infodir)/ses: ses.texi
388 cd $(srcdir); $(MAKEINFO) ses.texi 396 cd $(srcdir); $(MAKEINFO) ses.texi
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index aaea464bea2..67b5dd7dfab 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -132,9 +132,9 @@ information.
132@node EDE Mode, Creating a project, EDE Project Concepts, top 132@node EDE Mode, Creating a project, EDE Project Concepts, top
133@chapter @ede{} Mode 133@chapter @ede{} Mode
134 134
135@ede{} is implemented as a minor-mode, which augments other modes such as C 135@ede{} is implemented as a minor-mode, which augments other modes such
136mode, and Texinfo mode. You can turn @ede{} on for all buffers by running 136as C mode, and Texinfo mode. You can enable @ede{} for all buffers by
137the command @code{global-ede-mode}, or by putting this in your 137running the command @code{global-ede-mode}, or by putting this in your
138@file{~/.emacs} file: 138@file{~/.emacs} file:
139 139
140@example 140@example
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi
new file mode 100644
index 00000000000..e8d700cf43d
--- /dev/null
+++ b/doc/misc/sem-user.texi
@@ -0,0 +1,787 @@
1@c This file is included by semantic.texi
2
3@c Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
4@c Free Software Foundation, Inc.
5
6@c Permission is granted to copy, distribute and/or modify this
7@c document under the terms of the GNU Free Documentation License,
8@c Version 1.3 or any later version published by the Free Software
9@c Foundation; with no Invariant Sections, no Front-Cover Texts, and
10@c no Back-Cover Texts. A copy of the license is included in the
11@c section entitled ``GNU Free Documentation License''.
12
13You can begin using @semantic{} by enabling Semantic mode, a global
14minor mode: type @kbd{M-x semantic-mode}, or click on the @samp{Source
15Code Parsers (Semantic)} menu item in the @samp{Tools} menu.
16
17When Semantic mode is turned on, Emacs automatically parses each file
18you visit. This allows you to use @semantic{} user commands in those
19buffers. It also enables a number of ``helper'' minor modes for
20saving tags, displaying tag information, and so forth. @xref{Semantic
21mode}.
22
23To enable Semantic mode each time you start Emacs, add the line
24@code{(semantic-mode 1)} to your initialization file. @xref{Init
25File,,,emacs,Emacs manual}.
26
27@menu
28* Semantic mode:: Global minor mode for @semantic{}.
29* SemanticDB:: Caching parsed buffers between sessions.
30* Idle Scheduler:: Performing @semantic{} operations when idle.
31@end menu
32
33@node Semantic mode
34@section Semantic mode
35@cindex Semantic mode
36
37Semantic mode is a global minor mode for @semantic{} as a whole. When
38enabled, each file you visit is automatically parsed, provided its
39major mode is specified in the variable
40@code{semantic-new-buffer-setup-functions} (the default is to parse
41every buffer @semantic{} knows how to parse).
42
43In each parser-enabled buffer, a number of @semantic{} commands are
44available for navigating, querying, and editing source code.
45@xref{Semantic mode user commands}. Enabling Semantic mode also
46installs a @samp{Development} menu on the menu-bar, with many of these
47commands.
48
49In addition, enabling Semantic mode turns on certain auxilliary global
50minor modes, as specified by the variable
51@code{semantic-default-submodes}. The default auxilliary modes are
52SemanticDB mode (@pxref{SemanticDB}) and Global Semantic Idle
53Scheduler mode. You can also toggle the auxilliary minor modes
54separately, using their mode functions (e.g. @kbd{M-x
55semanticdb-minor-mode}), or via the @samp{Development} menu. These
56auxilliary minor modes are described in the following sections.
57
58@defvar semantic-new-buffer-setup-functions
59The value of this variable is an alist of functions to call for
60setting up @semantic{} parsing in the buffer. Each element has the
61form @code{(@var{mode} . @var{fn})}, where @var{mode} is a value of
62@code{major-mode} for the buffer and @var{fn} is the corresponding
63function for setting up the parser. @var{fn} is called, with no
64arguments, after the major mode is initialized (and after the mode
65hooks have been run).
66
67The default value enables @semantic{} for all supported major modes
68(i.e., C, C++, Scheme, Javascript, Java, HTML, SRecode, and Make), but
69you can remove modes from this list if you don't want to use
70@semantic{} with them.
71@end defvar
72
73@defvar semantic-default-submodes
74The value of this variable is a list of symbols, specifying the
75auxilliary minor modes to enable when enabling Semantic mode. The
76valid mode symbols are:
77
78@itemize
79@item @code{semantic-idle-scheduler-mode} (@pxref{Idle Scheduler}).
80@item @code{semanticdb-minor-mode} (@pxref{SemanticDB}).
81@item @code{semantic-idle-summary-mode} (@pxref{Idle Summary Mode}).
82@item @code{semantic-idle-completions-mode} (@pxref{Idle Completions Mode}).
83@item @code{semantic-highlight-func-mode}
84@item @code{semantic-decoration-mode}
85@item @code{semantic-stickyfunc-mode}
86@item @code{semantic-mru-bookmark-mode}
87@end itemize
88@end defvar
89
90@menu
91* Semantic mode user commands::
92@end menu
93
94@node Semantic mode user commands
95@subsection Semantic mode user commands
96
97Semantic mode provides a number of commands for navigating, querying,
98and editing source code in a language-aware manner. These commands
99generally act on @dfn{tags}, which are the source-code units deemed
100``important'' by the present programming language (e.g. functions in
101the C programming language).
102
103These commands may be used in any buffer that has been parsed by
104@semantic{}. Several of them prompt for a tag name using the
105minibuffer; here, the @kbd{TAB} key can be used to complete tag names.
106Others act on the @dfn{current tag}, meaning the tag at (or around)
107point.
108
109@table @kbd
110@item \C-c , j
111Prompt for a tag defined in the current file, and move point to it
112(@code{semantic-complete-jump-local}).
113
114@item \C-c , J
115Prompt for a tag defined in any file that Emacs has parsed, and move
116point to it (@code{semantic-complete-jump}).
117
118@item \C-c , l
119Display a list of the possible completions of the current tag
120(@code{semantic-analyze-possible-completions}).
121
122@item \C-c , g
123Prompt for a tag, and display a list of tags that call it
124(@code{semantic-symref-symbol}).
125
126@item \C-c , G
127Display a list of tags that call the current tag
128(@code{semantic-symref}).
129
130@item \C-c , p
131Move point to the previous tag (@code{senator-previous-tag}).
132
133@item \C-c , n
134Move point to the next tag (@code{senator-next-tag}).
135
136@item \C-c , u
137Move point ``up'' one reference (@code{senator-go-to-up-reference}).
138The meaning of ``up'' is language-dependent; in C++, for instance,
139this means moving to the parent of the current tag.
140
141@item \C-c, @key{SPC}
142(@code{semantic-complete-analyze-inline})
143
144@item \C-c,\C-w
145Kill the current tag (@code{senator-kill-tag}). This removes the text
146for that tag, placing it in the kill ring. You can retrieve the text
147with @kbd{C-y}. This also places the tag in the @dfn{tag ring}, so
148that you can yank it with @kbd{\C-c,\C-y}, below.
149
150@item \C-c,\M-w
151Copy the current tag into the kill ring as well as the tag ring
152(@code{senator-copy-tag}).
153
154@item \C-c,\C-y
155Yank a tag from the tag ring (@code{senator-yank-tag}).
156
157@item \C-c,r
158Copy the current tag into a register
159(@code{senator-copy-tag-to-register}). With an optional argument,
160kill it as well. This allows you to insert or jump to that tag with
161the usual register commands. @xref{Registers,,,emacs,Emacs manual}.
162
163@item ?\C-c , @kbd{up}
164Transpose the current tag with the previous one
165(@code{senator-transpose-tags-up}).
166
167@item ?\C-c ?, @kbd{down}
168Transpose the current tag with the next one
169(@code{senator-transpose-tags-down}).
170@end table
171
172@node SemanticDB
173@section Semantic Database
174@cindex SemanticDB
175
176The Semantic Database (SemanticDB) caches the results of parsing
177source code files. This data can be saved to disk when you exit
178Emacs, and reloaded automatically when you subsequently revisit the
179same source code files. This saves time by eliminating the need to
180re-parse unmodified files.
181
182SemanticDB also provides an @acronym{API} that programs can use to
183acquire information about source code tags. This information can be
184accessed without loading the original the source files into memory.
185It can also be used to create alternate ``back-ends'' for storing tag
186information in alternative on-disk formats.
187
188By default, SemanticDB is enabled together with Semantic mode. To
189disable it, remove it from @code{semantic-default-submodes}
190(@pxref{Semantic mode}). You can also enable or disable SemanticDB
191with @kbd{M-x global-semanticdb-minor-mode}.
192
193@deffn Command global-semanticdb-minor-mode
194Toggle SemanticDB mode. When enabled, any source code parsed by
195@semantic{} is cached in a database.
196@end deffn
197
198SemanticDB offers a large number of customizable options, which are
199described in the following subsections.
200
201@menu
202* Semanticdb Tag Storage::
203* Semanticdb Search Configuration::
204* Changing Backends::
205* Script Generated Cache Files::
206* Create System Databases::
207@end menu
208
209@node Semanticdb Tag Storage
210@subsection Semanticdb Tag Storage
211
212Each time you exit Emacs, any data cached by SemanticDB is saved in
213the directory @file{.emacs.d/semanticdb/}, located in your home
214directory. Within this directory, the cache data is written into a
215set of files according to a SemanticDB-specific filename convention.
216If the SemanticDB directory does not exist, Emacs first asks if you
217want to create it.
218
219You can change the name of the SemanticDB directory by customizing the
220variable @code{semanticdb-default-save-directory}.
221
222@anchor{semanticdb-default-save-directory}
223@deffn Option semanticdb-default-save-directory
224The name of the directory where SemanticDB cache files are saved. If
225the value is @code{nil}, SemanticDB saves its data into a single file,
226in the current directory, whose filename is given by
227@code{semanticdb-default-file-name}.
228@end deffn
229
230@anchor{semanticdb-default-file-name}
231@deffn Option semanticdb-default-file-name
232The name of a cache file in which to save SemanticDB, when
233@code{semanticdb-default-save-directory} is @code{nil}.
234@end deffn
235
236You can force SemanticDB to save the data from only certain files, or
237suppress saving altogether, by customizing
238@code{semanticdb-persistent-path}:
239
240@anchor{semanticdb-persistent-path}
241@deffn Option semanticdb-persistent-path
242List of valid paths for SemanticDB to cache. Each element should be a
243directory name (a string); then the parse data from any file in that
244directory is saved.
245
246As a special exception, the value of this variable can be a list
247containing a single symbol: @code{never}, @code{always}, or
248@code{project}. The symbol @code{never} disables saving anywhere;
249@code{always} enables saving everywhere; and @code{project} enables
250saving directory based on the variable
251@code{semanticdb-project-predicate-functions}.
252
253The default value is @code{(always)}.
254@end deffn
255
256@anchor{semanticdb-project-predicate-functions}
257@defvar semanticdb-project-predicate-functions
258The value of this variable is a list of predicates for indicating that
259a directory belongs to a project. This list is used when the value of
260@code{semanticdb-persistent-path} is @code{(project)}. If the list is
261empty, all paths are considered valid.
262
263Project management packages, such as EDE (@pxref{Top,,,ede,EDE
264manual}), may add their own predicates with @dfn{add-hook} to this
265variable. This allows SemanticDB to save tag caches in directories
266controlled by them.
267@end defvar
268
269@anchor{semanticdb-save-database-hooks}
270@deffn Option semanticdb-save-database-hooks
271Abnormal hook run after a database is saved. Each function is called
272with one argument, the object representing the database recently
273written.
274@end deffn
275
276@node Semanticdb Search Configuration
277@subsection Semanticdb Search Configuration
278
279 When another part of @semantic{} (or another Emacs package using
280@semantic{}) searches for a tag within SemanticDB, the SemanticDB
281library may perform a search in the locations of the database:
282
283@enumerate
284@item
285The entries defined by the current file.
286@item
287The entries defined by the @dfn{include files} of the current file.
288@item
289The entries defined by the include files included from the include
290files (and so on, recursively).
291@end enumerate
292
293In C and C++, for instance, include files are defined with the
294@samp{#include} preprocessor directive (SemanticDB tries to
295distinguish between project and system headers, based on the @code{""}
296and @code{<>} filename delimiters). Include directives are matched to
297filenames in the SemanticDB cache using the following criteria:
298
299@enumerate
300@item
301Whether the file is in the same directory as the current file
302@item
303Whether the file is in the same project, as defined by EDE
304(@pxref{Top,,,ede,EDE manual}) or the @code{semanticdb-project-roots}
305variable (@pxref{Semanticdb Roots}).
306@item
307Whether the file is in the @dfn{system include path} (@pxref{Include
308paths}).
309@end enumerate
310
311@menu
312* Semanticdb Roots:: Specifying the root of different projects
313* Include paths:: Add/Remove directories to include search paths
314* Search Throttle:: Controlling how semanticdb searches occur
315* Semanticdb search debugging commands::
316@end menu
317
318@node Semanticdb Roots
319@subsubsection SemanticDB project roots
320
321Project roots are the ``top-level'' directories for a single code
322project. With the exception of system directories, SemanticDB
323searches are usually limited to the current single code project.
324Therefore, it is helpful to specify the project root if you want
325@semantic{} tag searches to work correctly.
326
327@anchor{semanticdb-project-roots}
328@deffn Option semanticdb-project-roots
329The value of this variable is a list of directories (strings) that are
330project root. All subdirectories of a project root are considered
331part of the same project. This variable can be overriden by project
332management programs via @code{semanticdb-project-root-functions}.
333@end deffn
334
335@anchor{semanticdb-project-root-functions}
336@defvar semanticdb-project-root-functions
337The value of this variable is a list of functions to determine a given
338directory's project root. These functions are called, one at a time,
339with one argument (the directory name), and must return either
340@code{nil}, a string (the project root), or a list of strings
341(multiple project roots, for complex systems). The first
342non-@code{nil} return value, if any, is taken to be the project root,
343overriding @code{semanticdb-project-roots}.
344@end defvar
345
346If you use EDE for project management, it will set
347@code{semanticdb-project-root-functions} automatically.
348@xref{Top,,,ede,EDE manual}.
349
350@node Include paths
351@subsubsection Include Paths
352
353System include paths are standard locations to find source code tags,
354such as the @dfn{header files} in @file{/usr/include} and its
355subdirectories on Unix-like operating systems. You can add and remove
356system include paths using the following commands:
357
358@anchor{semantic-add-system-include}
359@deffn Command semantic-add-system-include dir &optional mode
360This command prompts for a directory, @var{dir}, and adds it as a
361system include path for the current major mode. When called
362non-interactively, the major mode can be specified with the @var{mode}
363argument.
364@end deffn
365
366@anchor{semantic-remove-system-include}
367@deffn Command semantic-remove-system-include dir &optional mode
368This command prompt for a directory, @var{dir}, and removes it from
369the system include path for the current major mode (or @var{mode}).
370@end deffn
371
372@anchor{semantic-customize-system-include-path}
373@deffn Command semantic-customize-system-include-path &optional mode
374Customize the system include path for the current major mode (or
375@code{mode}).
376@end deffn
377
378@anchor{semanticdb-implied-include-tags}
379@defun semanticdb-implied-include-tags
380Include tags implied for all files of a given mode. You can set this
381variable with @code{defvar-mode-local} for a particular mode so that
382any symbols that exist for all files for that mode are included.
383@end defun
384
385@c @xref{Search Optimization}, for more information on include paths.
386
387@node Search Throttle
388@subsubsection SemanticDB Search Throttle
389
390The SemanticDB search throttle is a variable that may be configured by
391a language support author. If you need to customize this for
392yourself, you may need to override the mode values in a mode support
393hook.
394
395@defvar semanticdb-find-default-throttle
396@anchor{semanticdb-find-default-throttle}
397The default throttle for @code{semanticdb-find} routines.
398The throttle controls how detailed the list of database
399tables is for a symbol lookup. The value is a list with
400the following keys:
401
402@table @code
403@item file
404The file the search is being performed from. This option is here for
405completeness only, and is assumed to always be on.
406@item local
407Tables from the same local directory are included. This includes
408files directly referenced by a file name which might be in a different
409directory.
410@item project
411Tables from the same local project are included If @code{project} is
412specified, then @code{local} is assumed.
413@item unloaded
414If a table is not in memory, load it. If it is not cached on disk
415either, get the source, parse it, and create the table.
416@item system
417Tables from system databases. These are specifically tables
418from system header files, or language equivalent.
419@item recursive
420For include based searches, includes tables referenced by included
421files.
422@item omniscience
423Included system databases which are omniscience, or somehow know
424everything. Omniscience databases are found in
425@code{semanticdb-project-system-databases}. The Emacs Lisp system
426@var{db} is an omniscience database.
427@end table
428
429@end defvar
430
431To set the throttle, use a command like this:
432
433@example
434(setq-mode-local c-mode
435 semanticdb-find-default-throttle
436 '(project unloaded system recursive))
437@end example
438
439The default value of the throttle is for maximum accuracy at the
440expense of time taken to perform a particular look-up. The throttle
441is tweaked by @code{semantic-idle-summary-mode} to remove 'unloaded,
442thus removing poor speed at unexpected times.
443
444@node Semanticdb search debugging commands
445@subsubsection Semanticdb search debugging commands
446
447You can use @kbd{M-x semanticdb-dump-all-table-summary RET} to see the
448list of databases that will be searched from a given buffer. It
449should include DBs for the directories you expect. You can follow up
450with @kbd{M-x semanticdb-find-test-translate-path RET} to then make
451sure specific tables from the path are discovered correctly.
452
453Alternately, you can get a list of include files @semantic{}
454encountered, but could not find on disk using
455@kbd{M-x semanticdb-find-adebug-lost-includes RET}.
456
457Once you have used the below functions to debug the problem, you may
458need to reconfigure how @semantic{} finds include files.
459See @ref{Semanticdb Search Configuration}. If the search config is
460ok, you may need to configure the search throttle. See @ref{Search Throttle}.
461
462@deffn Command semanticdb-dump-all-table-summary
463@anchor{semanticdb-dump-all-table-summary}
464Dump a list of all databases in Emacs memory.
465@end deffn
466
467@deffn Command semanticdb-find-test-translate-path &optional arg
468@anchor{semanticdb-find-test-translate-path}
469Call and output results of @dfn{semanticdb-find-translate-path}
470With @var{arg} non-@code{nil}, specify a @var{brutish} translation.
471@end deffn
472
473@deffn Command semanticdb-find-adebug-lost-includes
474@anchor{semanticdb-find-adebug-lost-includes}
475Translate the current path, then display the lost includes.
476Examines the variable @code{semanticdb-find-lost-includes}.
477@end deffn
478
479Lastly, you can test an explicit search term using this command:
480
481@deffn Command semantic-adebug-searchdb regex
482@anchor{semantic-adebug-searchdb}
483Search the semanticdb for @var{regex} for the current buffer.
484Display the results as a debug list.
485@end deffn
486
487@node Changing Backends
488@subsection Changing Backends
489
490If you want to use some other form of backend, you can use this
491variable to choose which back end class to use for your general tag
492storage.
493
494The default is to save databases in flat files. Alternatively, you
495could write a new database backend that stores tags into a database,
496or other storage system.
497
498@defvar semanticdb-new-database-class
499@anchor{semanticdb-new-database-class}
500The default type of database created for new files.
501This can be changed on a per file basis, so that some directories
502are saved using one mechanism, and some directories via a different
503mechanism.
504@end defvar
505
506@node Script Generated Cache Files
507@subsection Script Generated Cache Files
508
509You can create new semantic databases with the @file{semanticdb.sh}
510script file. Give this script the directory you want parsed, and it
511will create a cache file for you.
512
513@example
514$ semanticdb.sh *.el
515@end example
516
517To use these generated tables, you would likely need to restart Emacs.
518
519@node Create System Databases
520@subsection Create System Databases
521
522If your supported language stores the system libraries in readily
523available parsable source code, you can pre-generate database files
524for them once, which will be used over and over for tools such as
525summary-mode, or the analyzer.
526
527@deffn Command semanticdb-create-ebrowse-database dir
528@anchor{semanticdb-create-ebrowse-database}
529Create an @var{ebrowse} database for directory @var{dir}.
530The database file is stored in ~/.semanticdb, or whichever directory
531is specified by @code{semanticdb-default-system-save-directory}.
532@end deffn
533
534
535@node Idle Scheduler
536@section Idle Scheduler
537@cindex Idle Scheduler
538
539The Idle Scheduler in @semantic{} performs multiple duties.
540
541The primary job is to schedule buffer parsing in idle time. The
542first buffer whose cache is checked is the current buffer. After
543this, all other buffers are checked.
544
545Once that has been accomplished, scheduled idle processes that use the
546semantic tag tables are run.
547
548@deffn Command global-semantic-idle-scheduler-mode &optional arg
549@anchor{global-semantic-idle-scheduler-mode}
550Toggle global use of option @dfn{semantic-idle-scheduler-mode}.
551The idle scheduler with automatically reparse buffers in idle time,
552and then schedule other jobs setup with @dfn{semantic-idle-scheduler-add}.
553If @var{ARG} is positive, enable, if it is negative, disable.
554If @var{ARG} is @code{nil}, then toggle.
555@obsolete{global-semantic-auto-parse-mode,global-semantic-idle-scheduler-mode}
556@end deffn
557
558@obsolete{semantic-auto-parse-mode, semantic-idle-scheduler-mode}
559
560@deffn Option semantic-idle-scheduler-idle-time
561@anchor{semantic-idle-scheduler-idle-time}
562Time in seconds of idle before scheduling events.
563This time should be short enough to ensure that idle-scheduler will be
564run as soon as Emacs is idle.
565@end deffn
566
567@deffn Option semantic-idle-scheduler-mode-hook
568@anchor{semantic-idle-scheduler-mode-hook}
569Hook run at the end of function @dfn{semantic-idle-scheduler-mode}.
570@end deffn
571
572@deffn Option semantic-idle-scheduler-verbose-flag
573@anchor{semantic-idle-scheduler-verbose-flag}
574Non-@code{nil} means that the idle scheduler should provide debug messages.
575Use this setting to debug idle activities.
576@end deffn
577
578You can add new functionality to the idle scheduler by reading the
579Application Developers Guide
580@inforef{Idle Scheduling, , semantic-appdev.info}.
581
582@menu
583* Reparsing Options:: Reparsing the current buffer in idle time
584* Idle Working Options:: Options for extra work done at idle time
585* Debugging Idle Time Issues:: How to produce good bug reports.
586* Idle Summary Mode:: Display prototype of symbol under cursor
587* Idle Completions Mode:: Smart completion pop-up help.
588@end menu
589
590@node Reparsing Options
591@subsection Reparsing Options
592
593The Idle Scheduler will automatically reparse all buffers that need
594it. User input at any time will cancel the operations and return to
595normal editing.
596
597@deffn Option semantic-idle-scheduler-max-buffer-size
598@anchor{semantic-idle-scheduler-max-buffer-size}
599Maximum size in bytes of buffers automatically reparsed.
600If this value is less than or equal to @var{0}, buffers are automatically
601reparsed regardless of their size.
602@end deffn
603
604@deffn Option semantic-idle-scheduler-no-working-message
605@anchor{semantic-idle-scheduler-no-working-message}
606If non-@code{nil}, disable display of working messages during parse.
607@end deffn
608
609@deffn Option semantic-idle-scheduler-working-in-modeline-flag
610@anchor{semantic-idle-scheduler-working-in-modeline-flag}
611Non-@code{nil} means show working messages in the mode line.
612Typically, parsing will show messages in the minibuffer.
613This will move the parse message into the modeline.
614@end deffn
615
616@defvar semantic-before-idle-scheduler-reparse-hooks
617@anchor{semantic-before-idle-scheduler-reparse-hooks}
618Hooks run before option @code{semantic-idle-scheduler} begins parsing.
619If any hook throws an error, this variable is reset to nil.
620This hook is not protected from lexical errors.
621@end defvar
622
623@defvar semantic-after-idle-scheduler-reparse-hooks
624@anchor{semantic-after-idle-scheduler-reparse-hooks}
625Hooks run after option @code{semantic-idle-scheduler} has parsed.
626If any hook throws an error, this variable is reset to nil.
627This hook is not protected from lexical errors.
628@end defvar
629
630@node Idle Working Options
631@subsection Idle Working Options
632
633Similiar to the reparsing that occurs at short intervals in idle
634time, there is extra work that can be controlled to occur in idle time
635also.
636
637Idle work occurs after a longer delay, and can be very time
638consuming. The work done includes:
639
640@table @asis
641@item Create Include Path Caches
642Create the optimized search caches needed for symbol lookup.
643@item Create Type Cache
644Create the datatype caches needed for intellisense features.
645@item Save Databases
646All file-based @semantic{} databases are saved to disk.
647@item Parse neighboring files
648All files in the same directory as the current buffer are
649speculatively parsed.
650@end table
651
652These features can be controlled with the following variables:
653
654@deffn Option semantic-idle-scheduler-work-idle-time
655@anchor{semantic-idle-scheduler-work-idle-time}
656Time in seconds of idle before scheduling big work.
657This time should be long enough that once any big work is started, it is
658unlikely the user would be ready to type again right away.
659@end deffn
660
661@deffn Option semantic-idle-work-parse-neighboring-files-flag
662@anchor{semantic-idle-work-parse-neighboring-files-flag}
663Non-@code{nil} means to parse files in the same dir as the current buffer.
664Disable to prevent lots of excessive parsing in idle time.
665@end deffn
666
667@node Debugging Idle Time Issues
668@subsection Debugging Idle Time Issues
669
670If you see errors produced in idle time, it could be an indication of a
671more serious issue elsewhere. It is not enough to enable
672@code{debug-on-error}, as the idle timer tries to keep errors under
673wraps.
674
675Instead, there are two commands you can use whenever you see an idle
676error.
677
678@deffn Command semantic-debug-idle-function
679@anchor{semantic-debug-idle-function}
680Run the Semantic idle function with debugging turned on.
681@end deffn
682
683@deffn Command semantic-debug-idle-work-function
684@anchor{semantic-debug-idle-work-function}
685Run the Semantic idle work function with debugging turned on.
686@end deffn
687
688Once you identify the general location of the idle error, you can send
689the stack trace to the mailing list, or perhaps find a more focused
690way to reproduce the issue.
691
692@node Idle Summary Mode
693@subsection Idle Summary Mode
694
695Similar to the Emacs Lisp facility eldoc,
696@code{semantic-idle-summary-mode} will display the prototype, or other
697helpful doc about the symbol currently under point.
698
699
700@deffn semantic-idle-summary-mode &optional arg
701@anchor{semantic-idle-summary-mode}
702Display a tag summary of the lexical token under the cursor.
703This means for getting the current tag to display information can
704be overriden with @code{idle-summary-current-symbol-info}.
705This is a minor mode which performs actions during idle time.
706With prefix argument ARG, turn on if positive, otherwise off. The
707minor mode can be turned on only if semantic feature is available and
708the current buffer was set up for parsing. Return non-nil if the
709minor mode is enabled
710@end deffn
711
712@obsolete{semantic-summary-mode, semantic-idle-summary-mode}
713
714@deffn Option semantic-idle-summary-function
715@anchor{semantic-idle-summary-function}
716Function to use when displaying tag information during idle time.
717Some useful functions are found in @code{semantic-format-tag-functions}.
718@end deffn
719
720@defvar semantic-idle-summary-out-of-context-faces
721@anchor{semantic-idle-summary-out-of-context-faces}
722List of font-lock faces that indicate a useless summary context.
723Those are generally faces used to highlight comments or strings.
724
725It might be useful to override this variable to add comment faces
726specific to a major mode. For example, in jde mode:
727
728@example
729(defvar-mode-local jde-mode semantic-idle-summary-out-of-context-faces
730 (append (default-value 'semantic-idle-summary-out-of-context-faces)
731 '(jde-java-font-lock-doc-tag-face
732 jde-java-font-lock-link-face
733 jde-java-font-lock-bold-face
734 jde-java-font-lock-underline-face
735 jde-java-font-lock-pre-face
736 jde-java-font-lock-code-face)))
737@end example
738
739@end defvar
740
741@node Idle Completions Mode
742@subsection Idle Completions Mode
743
744The definition of smart completion is described in the Analyzer
745section @ref{Analyzer}.
746
747The Idle Completions mode will calculate the list of possible
748completions in idle time, and display them in a popup list, or other
749inline completion mechanism.
750
751@deffn semantic-idle-completions-mode &optional arg
752@anchor{semantic-idle-completions-mode}
753Display a tooltip with a list of possible completions near the cursor.
754There is no convenience for performing a completion replacement. For
755that you should bind @code{semantic-ia-complete-symbol}.
756This is a minor mode which performs actions during idle time.
757With prefix argument ARG, turn on if positive, otherwise off. The
758minor mode can be turned on only if semantic feature is available and
759the current buffer was set up for parsing. Return non-nil if the
760minor mode is enabled
761@end deffn
762
763This mode operates by using the command
764@code{semantic-complete-inline-analyzer}.
765
766Idle completion uses the completion function
767@code{semantic-complete-analyze-inline-idle}. Changing the behavior of
768the idle completion popups should be done through those utilities.
769
770@deffn Command semantic-complete-analyze-inline-idle
771@anchor{semantic-complete-analyze-inline-idle}
772Perform prompt completion to do in buffer completion.
773@dfn{semantic-analyze-possible-completions} is used to determine the
774possible values.
775The function returns immediately, leaving the buffer in a mode that
776will perform the completion.
777Configure @code{semantic-complete-inline-analyzer-idle-displayor-class}
778to change how completion options are displayed.
779@end deffn
780
781@deffn Option semantic-complete-inline-analyzer-idle-displayor-class
782@anchor{semantic-complete-inline-analyzer-idle-displayor-class}
783Class for displayor to use with inline completion at idle time.
784
785Customize this variable to get a list of options, such as popup
786tooltips, ghosting text, or traditional completion tools.
787@end deffn
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi
new file mode 100644
index 00000000000..adfecde2568
--- /dev/null
+++ b/doc/misc/semantic.texi
@@ -0,0 +1,638 @@
1\input texinfo
2@setfilename ../../info/semantic
3@set TITLE Semantic Manual
4@set AUTHOR Eric M. Ludlam and David Ponce
5@settitle @value{TITLE}
6
7@c *************************************************************************
8@c @ Header
9@c *************************************************************************
10
11@c Merge all indexes into a single index for now.
12@c We can always separate them later into two or more as needed.
13@syncodeindex vr cp
14@syncodeindex fn cp
15@syncodeindex ky cp
16@syncodeindex pg cp
17@syncodeindex tp cp
18
19@c @footnotestyle separate
20@c @paragraphindent 2
21@c @@smallbook
22@c %**end of header
23
24@copying
25This manual documents the Semantic library and utilities.
26
27Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
282009 Free Software Foundation, Inc.
29
30@quotation
31Permission is granted to copy, distribute and/or modify this document
32under the terms of the GNU Free Documentation License, Version 1.3 or
33any later version published by the Free Software Foundation; with no
34Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
35and with the Back-Cover Texts as in (a) below. A copy of the license
36is included in the section entitled ``GNU Free Documentation License.''
37
38(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
39modify this GNU manual. Buying copies from the FSF supports it in
40developing GNU and promoting software freedom.''
41@end quotation
42@end copying
43
44@ifinfo
45@format
46START-INFO-DIR-ENTRY
47* Semantic: (semantic). Source code parser library and utilities.
48END-INFO-DIR-ENTRY
49@end format
50@end ifinfo
51
52@titlepage
53@center @titlefont{Semantic}
54@sp 4
55@center by @value{AUTHOR}
56@end titlepage
57@page
58
59@macro semantic{}
60@i{Semantic}
61@end macro
62
63@macro keyword{kw}
64@anchor{\kw\}
65@b{\kw\}
66@end macro
67
68@macro obsolete{old,new}
69@sp 1
70@strong{Compatibility}:
71@code{\new\} introduced in @semantic{} version 2.0 supercedes
72@code{\old\} which is now obsolete.
73@end macro
74
75@c *************************************************************************
76@c @ Document
77@c *************************************************************************
78@contents
79
80@node top
81@top @value{TITLE}
82
83@semantic{} is a suite of Emacs libraries and utilities for parsing
84source code. At its core is a lexical analyzer and two parser
85generators (@code{bovinator} and @code{wisent}) written in Emacs Lisp.
86@semantic{} provides a variety of tools for making use of the parser
87output, including user commands for code navigation and completion, as
88well as enhancements for imenu, speedbar, whichfunc, eldoc,
89hippie-expand, and several other parts of Emacs.
90
91To send bug reports, or participate in discussions about semantic,
92use the mailing list cedet-semantic@@sourceforge.net via the URL:
93@url{http://lists.sourceforge.net/lists/listinfo/cedet-semantic}
94
95@ifnottex
96@insertcopying
97@end ifnottex
98
99@menu
100* Introduction::
101* Using Semantic::
102* Semantic Internals::
103* Glossary::
104* GNU Free Documentation License::
105* Index::
106@end menu
107
108@node Introduction
109@chapter Introduction
110
111This chapter gives an overview of @semantic{} and its goals.
112
113Ordinarily, Emacs uses regular expressions (and syntax tables) to
114analyze source code for purposes such as syntax highlighting. This
115approach, though simple and efficient, has its limitations: roughly
116speaking, it only ``guesses'' the meaning of each piece of source code
117in the context of the programming language, instead of rigorously
118``understanding'' it.
119
120@semantic{} provides a new infrastructure to analyze source code using
121@dfn{parsers} instead of regular expressions. It contains two
122built-in parser generators (an @acronym{LL} generator named
123@code{Bovine} and an @acronym{LALR} generator named @code{Wisent},
124both written in Emacs Lisp), and parsers for several common
125programming languages. It can also make use of @dfn{external
126parsers}---programs such as GNU Global and GNU IDUtils.
127
128@semantic{} provides a uniform, language-independent @acronym{API} for
129accessing the parser output. This output can be used by other Emacs
130Lisp programs to implement ``syntax-aware'' behavior. @semantic{}
131itself includes several such utilities, including user-level Emacs
132commands for navigating, searching, and completing source code.
133
134The following diagram illustrates the structure of the @semantic{}
135package:
136
137@table @strong
138@item Please Note:
139The words in all-capital are those that @semantic{} itself provides.
140Others are current or future languages or applications that are not
141distributed along with @semantic{}.
142@end table
143
144@example
145 Applications
146 and
147 Utilities
148 -------
149 / \
150 +---------------+ +--------+ +--------+
151 C --->| C PARSER |--->| | | |
152 +---------------+ | | | |
153 +---------------+ | COMMON | | COMMON |<--- SPEEDBAR
154 Java --->| JAVA PARSER |--->| PARSE | | |
155 +---------------+ | TREE | | PARSE |<--- SEMANTICDB
156 +---------------+ | FORMAT | | API |<--- ecb
157 Scheme --->| SCHEME PARSER |--->| | | |
158 +---------------+ | | | |
159 +---------------+ | | | |
160 Texinfo --->| TEXI. PARSER |--->| | | |
161 +---------------+ | | | |
162
163 ... ... ... ...
164
165 +---------------+ | | | |<--- app. 1
166 Lang. A --->| A Parser |--->| | | |
167 +---------------+ | | | |<--- app. 2
168 +---------------+ | | | |
169 Lang. B --->| B Parser |--->| | | |<--- app. 3
170 +---------------+ | | | |
171
172 ... ... ... ... ...
173
174 +---------------+ | | | |
175 Lang. Y --->| Y Parser |--->| | | |<--- app. ?
176 +---------------+ | | | |
177 +---------------+ | | | |<--- app. ?
178 Lang. Z --->| Z Parser |--->| | | |
179 +---------------+ +--------+ +--------+
180@end example
181
182@menu
183* Semantic Components::
184@end menu
185
186@node Semantic Components
187@section Semantic Components
188
189In this section, we provide a more detailed description of the major
190components of @semantic{}, and how they interact with one another.
191
192The first step in parsing a source code file is to break it up into
193its fundamental components. This step is called lexical analysis:
194
195@example
196 syntax table, keywords list, and options
197 |
198 |
199 v
200 input file ----> Lexer ----> token stream
201@end example
202
203@noindent
204The output of the lexical analyzer is a list of tokens that make up
205the file. The next step is the actual parsing, shown below:
206
207@example
208 parser tables
209 |
210 v
211 token stream ---> Parser ----> parse tree
212@end example
213
214@noindent
215The end result, the parse tree, is @semantic{}'s internal
216representation of the language grammar. @semantic{} provides an
217@acronym{API} for Emacs Lisp programs to access the parse tree.
218
219Parsing large files can take several seconds or more. By default,
220@semantic{} automatically caches parse trees by saving them in your
221@file{.emacs.d} directory. When you revisit a previously-parsed file,
222the parse tree is automatically reloaded from this cache, to save
223time. @xref{SemanticDB}.
224
225@node Using Semantic
226@chapter Using Semantic
227
228@include sem-user.texi
229
230@node Semantic Internals
231@chapter Semantic Internals
232
233This chapter provides an overview of the internals of @semantic{}.
234This information would not be needed by neither application developers
235nor grammar developers.
236
237It would be useful mostly for the hackers who would like to learn
238more about how @semantic{} works.
239
240@menu
241* Parser code :: Code used for the parsers
242* Tag handling :: Code used for manipulating tags
243* Semanticdb internals :: Code used in the semantic database
244* Analyzer :: Code used in the code analyzer
245* Tools :: Code used in user tools.
246* Tests :: Code used for testing.
247@end menu
248
249@node Parser code
250@section Parser code
251
252@semantic{} parsing code is spread across a range of files.
253
254@table @file
255@item semantic.el
256The core infrastructure sets up buffers for parsing, and has all the
257core parsing routines. Most parsing routines are overloadable, so the
258actual implementation may be somewhere else.
259
260@item semantic-edit.el
261Incremental reparse based on user edits.
262
263@item semantic-grammar.el
264@itemx semantic-grammar.wy
265Parser for the different grammar languages, and a major mode for
266editing grammars in Emacs.
267
268@item semantic-lex.el
269Infrastructure for implementing lexical analyzers. Provides macros
270for creating individual analyzers for specific features, and a way to
271combine them together.
272
273@item semantic-lex-spp.el
274Infrastructure for a lexical symbolic preprocessor. This was written
275to implement the C preprocessor, but could be used for other lexical
276preprocessors.
277
278@item bovine/bovine-grammar.el
279@itemx bovine/bovine-grammar-macros.el
280@itemx bovine/semantic-bovine.el
281The ``bovine'' grammar. This is the first grammar mode written for
282@semantic{} and is useful for simple creating simple parsers.
283
284@item wisent/wisent.el
285@itemx wisent/bison-wisent.el
286@itemx wisent/semantic-wisent.el
287@itemx wisent/semantic-debug-grammar.el
288A port of bison to Emacs. This infrastructure lets you create LALR
289based parsers for @semantic{}.
290
291@item semantic-ast.el
292Manage Abstract Syntax Trees for parsers.
293
294@item semantic-debug.el
295Infrastructure for debugging grammars.
296
297@item semantic-util.el
298Various utilities for manipulating tags, such as describing the tag
299under point, adding labels, and the all important
300@code{semantic-something-to-tag-table}.
301
302@end table
303
304@node Tag handling
305@section Tag handling
306
307A tag represents an individual item found in a buffer, such as a
308function or variable. Tag handling is handled in several source
309files.
310
311@table @file
312@item semantic-tag.el
313Basic tag creation, queries, cloning, binding, and unbinding.
314
315@item semantic-tag-write.el
316Write a tag or tag list to a stream. These routines are used by
317@file{semanticdb-file.el} when saving a list of tags.
318
319@item semantic-tag-file.el
320Files associated with tags. Goto-tag, file for include, and file for
321a prototype.
322
323@item semantic-tag-ls.el
324Language dependant features of a tag, such as parent calculation, slot
325protection, and other states like abstract, virtual, static, and leaf.
326
327@item semantic-dep.el
328Include file handling. Contains the include path concepts, and
329routines for looking up file names in the include path.
330
331@item semantic-format.el
332Convert a tag into a nicely formatted and colored string. Use
333@code{semantic-test-all-format-tag-functions} to test different output
334options.
335
336@item semantic-find.el
337Find tags matching different conditions in a tag table.
338These routines are used by @file{semanticdb-find.el} once the database
339has been converted into a simpler tag table.
340
341@item semantic-sort.el
342Sorting lists of tags in different ways. Includes sorting a plain
343list of tags forward or backward. Includes binning tags based on
344attributes (bucketize), and tag adoption for multiple references to
345the same thing.
346
347@item semantic-doc.el
348Capture documentation comments from near a tag.
349
350@end table
351
352@node Semanticdb internals
353@section Semanticdb internals
354
355@acronym{Semanticdb} complexity is certainly an issue. It is a rather
356hairy problem to try and solve.
357
358@table @file
359@item semanticdb.el
360Defines a @dfn{database} and a @dfn{table} base class. You can
361instantiate these classes, and use them, but they are not persistent.
362
363This file also provides support for @code{semanticdb-minor-mode},
364which automatically associates files with tables in databases so that
365tags are @emph{saved} while a buffer is not in memory.
366
367The database and tables both also provide applicate cache information,
368and cache flushing system. The semanticdb search routines use caches
369to save datastructures that are complex to calculate.
370
371Lastly, it provides the concept of @dfn{project root}. It is a system
372by which a file can be associated with the root of a project, so if
373you have a tree of directories and source files, it can find the root,
374and allow a tag-search to span all available databases in that
375directory hierarchy.
376
377@item semanticdb-file.el
378Provides a subclass of the basic table so that it can be saved to
379disk. Implements all the code needed to unbind/rebind tags to a
380buffer and writing them to a file.
381
382@item semanticdb-el.el
383Implements a special kind of @dfn{system} database that uses Emacs
384internals to perform queries.
385
386@item semanticdb-ebrowse.el
387Implements a system database that uses Ebrowse to parse files into a
388table that can be queried for tag names. Successful tag hits during a
389find causes @semantic{} to pick up and parse the reference files to
390get the full details.
391
392@item semanticdb-find.el
393Infrastructure for searching groups @semantic{} databases, and dealing
394with the search results format.
395
396@item semanticdb-ref.el
397Tracks crossreferences. Cross references are needed when buffer is
398reparsed, and must alert other tables that any dependant caches may
399need to be flushed. References are in the form of include files.
400
401@end table
402
403@node Analyzer
404@section Analyzer
405
406The @semantic{} analyzer is a complex engine which has been broken
407down across several modules. When the @semantic{} analyzer fails,
408start with @code{semantic-analyze-debug-assist}, then dive into some
409of these files.
410
411@table @file
412@item semantic-analyze.el
413The core analyzer for defining the @dfn{current context}. The
414current context is an object that contains references to aspects of
415the local context including the current prefix, and a tag list
416defining what the prefix means.
417
418@item semantic-analyze-complete.el
419Provides @code{semantic-analyze-possible-completions}.
420
421@item semantic-analyze-debug.el
422The analyzer debugger. Useful when attempting to get everything
423configured.
424
425@item semantic-analyze-fcn.el
426Various support functions needed by the analyzer.
427
428@item semantic-ctxt.el
429Local context parser. Contains overloadable functions used to move
430around through different scopes, get local variables, and collect the
431current prefix used when doing completion.
432
433@item semantic-scope.el
434Calculate @dfn{scope} for a location in a buffer. The scope includes
435local variables, and tag lists in scope for various reasons, such as
436C++ using statements.
437
438@item semanticdb-typecache.el
439The typecache is part of @code{semanticdb}, but is used primarilly by
440the analyzer to look up datatypes and complex names. The typecache is
441bound across source files and builds a master lookup table for data
442type names.
443
444@item semantic-ia.el
445Interactive Analyzer functions. Simple routines that do completion or
446lookups based on the results from the Analyzer. These routines are
447meant as examples for application writers, but are quite useful as
448they are.
449
450@item semantic-ia-sb.el
451Speedbar support for the analyzer, displaying context info, and
452completion lists.
453
454@end table
455
456@node Tools
457@section Tools
458
459These files contain various tools a user can use.
460
461@table @file
462@item semantic-idle.el
463Idle scheduler for @semantic{}. Manages reparsing buffers after
464edits, and large work tasks in idle time. Includes modes for showing
465summary help and pop-up completion.
466
467@item senator.el
468The @semantic{} navigator. Provides many ways to move through a
469buffer based on the active tag table.
470
471@item semantic-decorate.el
472A minor mode for decorating tags based on details from the parser.
473Includes overlines for functions, or coloring class fields based on
474protection.
475
476@item semantic-decorate-include.el
477A decoration mode for include files, which assists users in setting up
478parsing for their includes.
479
480@item semantic-complete.el
481Advanced completion prompts for reading tag names in the minibuffer, or
482inline in a buffer.
483
484@item semantic-imenu.el
485Imenu support for using @semantic{} tags in imenu.
486
487@item semantic-mru-bookmark.el
488Automatic bookmarking based on tags. Jump to locations you've been
489before based on tag name.
490
491@item semantic-sb.el
492Support for @semantic{} tag usage in Speedbar.
493
494@item semantic-util-modes.el
495A bunch of small minor-modes that exposes aspects of the semantic
496parser state. Includes @code{semantic-stickyfunc-mode}.
497
498@item document.el
499@itemx document-vars.el
500Create an update comments for tags.
501
502@item semantic-adebug.el
503Extensions of @file{data-debug.el} for @semantic{}.
504
505@item semantic-chart.el
506Draw some charts from stats generated from parsing.
507
508
509@item semantic-elp.el
510Profiler for helping to optimize the @semantic{} analyzer.
511
512
513@end table
514
515@node Tests
516@section Tests
517
518@table @file
519
520@item semantic-utest.el
521Basic testing of parsing and incremental parsing for most supported
522languages.
523
524@item semantic-ia-utest.el
525Test the semantic analyzer's ability to provide smart completions.
526
527@item semantic-utest-c.el
528Tests for the C parser's lexical pre-processor.
529
530@item semantic-regtest.el
531Regression tests from the older Semantic 1.x API.
532
533@end table
534
535@node Glossary
536@appendix Glossary
537
538@table @keyword
539@item BNF
540In semantic 1.4, a BNF file represented ``Bovine Normal Form'', the
541grammar file used for the 1.4 parser generator. This was a play on
542Backus-Naur Form which proved too confusing.
543
544@item bovinate
545A verb representing what happens when a bovine parser parses a file.
546
547@item bovine lambda
548In a bovine, or LL parser, the bovine lambda is a function to execute
549when a specific set of match rules has succeeded in matching text from
550the buffer.
551
552@item bovine parser
553A parser using the bovine parser generator. It is an LL parser
554suitible for small simple languages.
555
556@item context
557
558@item LALR
559
560@item lexer
561A program which converts text into a stream of tokens by analyzing
562them lexically. Lexers will commonly create strings, symbols,
563keywords and punctuation, and strip whitespaces and comments.
564
565@item LL
566
567@item nonterminal
568A nonterminal symbol or simply a nonterminal stands for a class of
569syntactically equivalent groupings. A nonterminal symbol name is used
570in writing grammar rules.
571
572@item overloadable
573Some functions are defined via @code{define-overload}.
574These can be overloaded via ....
575
576@item parser
577A program that converts @b{tokens} to @b{tags}.
578
579@item tag
580A tag is a representation of some entity in a language file, such as a
581function, variable, or include statement. In semantic, the word tag is
582used the same way it is used for the etags or ctags tools.
583
584A tag is usually bound to a buffer region via overlay, or it just
585specifies character locations in a file.
586
587@item token
588A single atomic item returned from a lexer. It represents some set
589of characters found in a buffer.
590
591@item token stream
592The output of the lexer as well as the input to the parser.
593
594@item wisent parser
595A parser using the wisent parser generator. It is a port of bison to
596Emacs Lisp. It is an LALR parser suitable for complex languages.
597@end table
598
599
600@node GNU Free Documentation License
601@appendix GNU Free Documentation License
602@include doclicense.texi
603
604@node Index
605@unnumbered Index
606@printindex cp
607
608@iftex
609@contents
610@summarycontents
611@end iftex
612
613@bye
614
615@c Following comments are for the benefit of ispell.
616
617@c LocalWords: alist API APIs arg argc args argv asis assoc autoload Wisent
618@c LocalWords: backquote bnf bovinate bovinates LALR
619@c LocalWords: bovinating bovination bovinator bucketize
620@c LocalWords: cb cdr charquote checkcache cindex CLOS
621@c LocalWords: concat concocting const constantness ctxt Decl defcustom
622@c LocalWords: deffn deffnx defun defvar destructor's dfn diff dir
623@c LocalWords: doc docstring EDE EIEIO elisp emacsman emph enum
624@c LocalWords: eq Exp EXPANDFULL expresssion fn foo func funcall
625@c LocalWords: ia ids iff ifinfo imenu imenus init int isearch itemx java kbd
626@c LocalWords: keymap keywordtable lang languagemode lexer lexing Ludlam
627@c LocalWords: menubar metaparent metaparents min minibuffer Misc mode's
628@c LocalWords: multitable NAvigaTOR noindent nomedian nonterm noselect
629@c LocalWords: nosnarf obarray OLE OO outputfile paren parsetable POINT's
630@c LocalWords: popup positionalonly positiononly positionormarker pre
631@c LocalWords: printf printindex Programmatically pt punctuations quotemode
632@c LocalWords: ref regex regexp Regexps reparse resetfile samp sb
633@c LocalWords: scopestart SEmantic semanticdb setfilename setq
634@c LocalWords: settitle setupfunction sexp sp SPC speedbar speedbar's
635@c LocalWords: streamorbuffer struct subalist submenu submenus
636@c LocalWords: subsubsection sw sym texi texinfo titlefont titlepage
637@c LocalWords: tok TOKEN's toplevel typemodifiers uml unset untar
638@c LocalWords: uref usedb var vskip xref yak