annotate info/dir @ 28062:26edef632c89

This is a big redesign of failure-stack and register handling, prompted by bugs revealed when trying to add shy-groups. Overall, what happened is that loops are now structured a little differently, groups can be shy and the code is a little simpler. (enum re_opcode_t): Remove jump_past_alt, maybe_pop_jump, push_dummy_failure and dumy_failure_jump. Add on_failure_jump_(exclusive, loop and smart). Also fix the comment for (start|stop)_memory since they now only take one argument (the second has becomes unnecessary). (print_partial_compiled_pattern): Adjust for changes in re_opcode_t. (print_compiled_pattern): Use %ld to printf long ints and flush to make debugging a little easier. (union fail_stack_elt): Make the integer unsigned. (struct fail_stack_type): Add a `frame' element. (INIT_FAIL_STACK): Init `frame' as well. (POP_PATTERN_OP): New macro for re_compile_fastmap. (DEBUG_PUSH, DEBUG_POP): Remove. (NUM_REG_ITEMS): Remove. (NUM_NONREG_ITEMS): Adjust. (FAILURE_PAT, FAILURE_STR, NEXT_FAILURE_HANDLE, TOP_FAILURE_HANDLE): New macros for the cycle detection. (ENSURE_FAIL_STACK): New macro for PUSH_FAILURE_(REG|POINT). (PUSH_FAILURE_REG, POP_FAILURE_REG, CHECK_INFINITE_LOOP): New macros. (PUSH_FAILURE_POINT): Don't push registers any more. The pattern address pushed is not the destination of the jump but the source of it instead. (NUM_FAILURE_ITEMS): Remove. (POP_FAILURE_POINT): Adapt to the new stack structure (i.e. pop registers before the actual failure point). Don't hardcode any meaning for str==NULL anymore. (union register_info_type, REG_MATCH_NULL_STRING_P, IS_ACTIVE) (MATCHED_SOMETHING, EVER_MATCHED_SOMETHING, SET_REGS_MATCHED): Remove. (REG_UNSET_VALUE): Use NULL (why not?). (compile_range): Remove declaration since it doesn't exist. (struct compile_stack_elt_t): Remove inner_group_offset. (old_reg(start|end), reg_info, reg_dummy, reg_info_dummy): Remove. (regex_grow_registers): Remove dead code. (FIXUP_ALT_JUMP): New macro. (regex_compile): Add shy-groups Change loops to use on_failure_jump_smart&jump instead of on_failure_jump&maybe_pop_jump. Change + loops to eliminate the initial (dummy_failure_)jump. Remove c1_base (looks like unused variable to me). Use `jump' instead of `jump_past_alt' and don't bother with push_dummy_failure in alternatives since it is now unnecessary. Use FIXUP_ALT_JUMP. Eliminate a useless `#ifdef emacs' for (re)allocating the stack. (re_compile_fastmap): Remove dead variables i and num_regs. Exit from loop when bufp->can_be_null rather than jumping to `done'. Avoid jumping backwards so as to ensure termination. Use PATTERN_STACK_EMPTY and POP_PATTERN_OP. Improved handling of backreferences. Remove dead code in handling of `anychar'. (skip_noops, mutually_exclusive_p): New functions taken from the handling of `maybe_pop_jump' in re_match_2_internal. Slightly improve mutually_exclusive_p to handle ".+\n". ((lowest|highest)_active_reg, NO_(LOWEST|HIGHEST)_ACTIVE_REG) Remove. (re_match_2_internal): Use %p instead of 0x%x when printf'ing ptrs. Don't SET_REGS_MATCHED anymore. Remove many dead variables. Push register (in `start_memory') on the stack rather than storing it in old_reg(start|end). Remove the cycle detection from `stop_memory', replaced by the use of on_failure_jump_loop for greedy loops. Add code for the new on_failure_jump_<foo>. Remove ad-hoc code in `on_failure_jump' to push more registers in the case of a loop. Take out code from `maybe_pop_jump' into separate functions and adapt it to the semantics of `on_failure_jump_smart'. Remove jump_past_alt, dummy_failure_jump and push_dummy_failure. Remove dummy_failure handling and handling of `failures to jump to on_failure_jump' (this last one was already dead code, it seems). ((group|alt|common_op)_match_null_string_p): Remove.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 08 Mar 2000 23:25:41 +0000
parents 6e868e0bc324
children 48daf6eb57cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25845
Dave Love <fx@gnu.org>
parents:
diff changeset
1 -*- Text -*-
Dave Love <fx@gnu.org>
parents:
diff changeset
2 This is the file .../info/dir, which contains the topmost node of the
Dave Love <fx@gnu.org>
parents:
diff changeset
3 Info hierarchy. The first time you invoke Info you start off
Dave Love <fx@gnu.org>
parents:
diff changeset
4 looking at that node, which is (dir)Top.
Dave Love <fx@gnu.org>
parents:
diff changeset
5 
Dave Love <fx@gnu.org>
parents:
diff changeset
6 File: dir Node: Top This is the top of the INFO tree
Dave Love <fx@gnu.org>
parents:
diff changeset
7 This (the Directory node) gives a menu of major topics.
Dave Love <fx@gnu.org>
parents:
diff changeset
8 Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
Dave Love <fx@gnu.org>
parents:
diff changeset
9 gives a primer for first-timers, "mEmacs<Return>" visits the Emacs topic,
Dave Love <fx@gnu.org>
parents:
diff changeset
10 etc.
Dave Love <fx@gnu.org>
parents:
diff changeset
11 In Emacs, you can click mouse button 2 on a menu item or cross reference
Dave Love <fx@gnu.org>
parents:
diff changeset
12 to select it.
Dave Love <fx@gnu.org>
parents:
diff changeset
13 --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
Dave Love <fx@gnu.org>
parents:
diff changeset
14
Dave Love <fx@gnu.org>
parents:
diff changeset
15 * Menu: The list of major topics begins on the next line.
Dave Love <fx@gnu.org>
parents:
diff changeset
16
Dave Love <fx@gnu.org>
parents:
diff changeset
17 * Info: (info). Documentation browsing system.
Dave Love <fx@gnu.org>
parents:
diff changeset
18 * Emacs: (emacs). The extensible self-documenting text editor.
Dave Love <fx@gnu.org>
parents:
diff changeset
19 * VIPER: (viper). The newest Emacs VI-emulation mode.
Dave Love <fx@gnu.org>
parents:
diff changeset
20 * VIP: (vip). An older VI-emulation for Emacs.
Dave Love <fx@gnu.org>
parents:
diff changeset
21 * Forms: (forms). Emacs package for editing data bases
Dave Love <fx@gnu.org>
parents:
diff changeset
22 by filling in forms.
Dave Love <fx@gnu.org>
parents:
diff changeset
23 * Gnus: (gnus). The news reader Gnus.
Dave Love <fx@gnu.org>
parents:
diff changeset
24 * Message: (message). Mail and news composition mode that goes with Gnus.
Dave Love <fx@gnu.org>
parents:
diff changeset
25 * MH-E: (mh-e). Emacs interface to the MH mail system.
Dave Love <fx@gnu.org>
parents:
diff changeset
26 * CL: (cl). Partial Common Lisp support for Emacs Lisp.
Dave Love <fx@gnu.org>
parents:
diff changeset
27 * SC: (sc). Supercite lets you cite parts of messages you're
Dave Love <fx@gnu.org>
parents:
diff changeset
28 replying to, in flexible ways.
Dave Love <fx@gnu.org>
parents:
diff changeset
29 * Dired-X: (dired-x). Dired Extra Features.
Dave Love <fx@gnu.org>
parents:
diff changeset
30 * Ediff: (ediff). A comprehensive visual interface to diff & patch.
Dave Love <fx@gnu.org>
parents:
diff changeset
31 * CC mode: (ccmode). The GNU Emacs mode for editing C, C++, Objective-C
Dave Love <fx@gnu.org>
parents:
diff changeset
32 and Java code.
25912
83a419607df5 Add ada-mode.
Gerd Moellmann <gerd@gnu.org>
parents: 25845
diff changeset
33 * Ada mode: (ada-mode). The GNU Emacs mode editing Ada.
27135
27b3c145fd73 Add an entry for IDLWAVE.
Eli Zaretskii <eliz@gnu.org>
parents: 26150
diff changeset
34 * IDLWAVE: (idlwave). Major mode and shell for IDL and WAVE/CL files.
27316
6e868e0bc324 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 27180
diff changeset
35 * EUDC: (eudc). Emacs Unified Directory Client.
25845
Dave Love <fx@gnu.org>
parents:
diff changeset
36
Dave Love <fx@gnu.org>
parents:
diff changeset
37 Editors
26150
96712277c1da Add autotype.
Dave Love <fx@gnu.org>
parents: 25912
diff changeset
38 * Autotype: (autotype). Convenient features for text that you enter frequently
96712277c1da Add autotype.
Dave Love <fx@gnu.org>
parents: 25912
diff changeset
39 in Emacs.
27180
387e9fffc218 Renamed emacs-faq to efaq.
Eli Zaretskii <eliz@gnu.org>
parents: 27135
diff changeset
40 * Emacs FAQ: (efaq). Frequently Asked Questions about Emacs.