General notes on Emacs Ada mode

build/Makefile

o.e.a: release, in use
o.e.a.stephe-1: dead
o.e.a.stephe-2 (from o.e.a. with o.w.s-1): work
o.e.a.stephe-3 (from o.e.a.s-1): emacs module parser (very old)
o.e.a.stephe-4 (from o.e.a.s-2): available
o.e.a.stephe-5 (from o.e.a.s-2): libadalang backend
o.e.a.stephe-6 (from o.e.a.s-2): available

run test from emacs -Q using source:
(progn
  (setq eval-expression-debug-on-error nil)
  (package-initialize)
  (add-to-list 'exec-path "d:/apps/GNAT-GPL_2018/bin")
  (setenv "PATH" (mapconcat 'identity  exec-path  path-separator))
  (add-to-list 'load-path "c:/Projects/org.emacs.ada-mode")
  (add-to-list 'load-path "c:/Projects/org.emacs.ada-mode/build")
  ; (setq debug-on-error t)
  ; (setq debug-on-quit t)
  (setq default-directory "c:/Projects/org.emacs.ada-mode/build/")
  (setq ada-process-parse-exec (expand-file-name "../ada_mode_wisi_lalr_parse.exe"))
  (load "run-indent-test")
  ; (setq wisi-debug 1)
  (setq wisi-trace-action 2)
  (setq wisi-disable-face t)
  (find-file "../test/ada_mode-partial_parse.adb")
)

(dvc-state-multiple
'((xmtn . "/Projects/org.stephe_leake.makerules")
  (xmtn . "/Projects/org.stephe_leake.sal")
  (xmtn . "/Projects/org.stephe_leake.aunit_ext")
  (xmtn . "/Projects/org.wisitoken")
  (xmtn . "/Projects/org.emacs.ada-mode/")))

(dvc-propagate-multiple
 '(("../org.stephe_leake.sal"  . "../org.stephe_leake.sal.stephe-1")
   ("../org.wisitoken"         . "../org.wisitoken.stephe-1")
   ("../org.emacs.ada-mode"    . "../org.emacs.ada-mode.stephe-2")))

(dvc-state-multiple
'((xmtn . "c:/Projects/org.stephe_leake.makerules")
  (xmtn . "c:/Projects/org.stephe_leake.sal.stephe-1")
  (xmtn . "c:/Projects/org.stephe_leake.aunit_ext")
  (xmtn . "c:/Projects/org.wisitoken.stephe-1")
  (xmtn . "c:/Projects/org.emacs.ada-mode.stephe-2")))

(dvc-propagate-multiple
 '(("../org.stephe_leake.sal.stephe-1" . "../org.stephe_leake.sal")
   ("../org.wisitoken.stephe-1"        . "../org.wisitoken")
   ("../org.emacs.ada-mode.stephe-2"   . "../org.emacs.ada-mode")))

 current work
release

test/ada_mode-recover_partial_16.adb : error during resume
test/ada_mode-recover_partial_19.adb : error during resume

separate partial-parse threshold for face

check Protocol_Version in wisi-process-parse

using o.e.a-m
        (progn
         (setq wisi-debug 1)
         (setq debug-on-error t)
         ;; (setq ada-process-parse-exec "c:/Projects/org.emacs.ada-mode.stephe-2/ada_mode_wisi_lr1_parse.exe")
         )

    working on o.w.s-2
        c:/Projects/org.wisitoken.stephe-2/notes.text

    deadly slow with missing string quote wisitoken_grammar_runtime.adb -- RAW_CODE, actions
        hard to reproduce
        List_Nonterm : constant Token_Index "=


indent %code in .wy loses face in rest of file

change ada-mode to derive-major-mode
    always put ada-mode-post-local-vars on hack-local-variables-hook; it will be run at the right time

Insert context clause inhibit invalidate navigate

loop_statement motion_action include "exit"?

add error recovery strategy counts to recover.log
    language_fixes, minimal_complete_actions, explore

sort error messages in line order

don't repeat language_fixes
    error_during_resume_2

c:/eurocontrol/query_display-flight_operations.adb
    errors cause huge slowdown in parse speed
        due to parallel parse, delete_dup?

    lalr reports error in resume
    lr1 does not

    only errors are missing end labels
        lr1 parse face time:
        with all fixed,      0.175579163
        with errors present, 8.395040656

        1  8.282763405
        2  8.146287525
        3  8.083595595
        4  2.576497063
        5  1.448250382
        6  1.461459692
        7  1.437491198
        8  1.420267629
        9  0.160563880

        second ediff-buffers reliably hangs!
            external process communications bug
            update master, try -Q
            emacs 26 ok

    run with profile => recover takes 0% of time (sigh)

    add put (clock) at various places
    after recover at 15304:(PROCEDURE, (122273 . 122281)) Display_Profile line 2784
    takes 6.5 seconds to get to 20650:(END, (170186 . 170188)) Query_Display.Flight_Operations; line 3625

1. 2091:(BEGIN, (18446 . 18450))
   (subprogram_body, (18252 . 18440))
   1 parser, succeed 2, enqueue 2, check  2, cost:  0
   non-ignore solution is wrong, terminated immediately

2. 4143:(BEGIN, (33687 . 33691))
   (subprogram_specification, (33286 . 33350))
   1 parser, succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 4245:(USE, (34365 . 34367))

3. 5177:(FUNCTION, (40478 . 40485))
   (subprogram_specification, (39991 . 40026))
   1 parser, succeed 1, enqueue 4, check  2, cost:  0
   nested inside 4

4. 5255:(BEGIN, (40951 . 40955)) Resume_Token_Goal 5259
   (subprogram_specification, (40699 . 40726))
   209: succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 5275:(BEGIN, (41044 . 41048))

5. 5364:(BEGIN, (41705 . 41709)) Resume_Token_Goal 5368
   (subprogram_specification, (41435 . 41488))
   215: succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 5802:(IDENTIFIER, (45635 . 45643))

6. 7439:(IDENTIFIER, (59232 . 59243)) Resume_Token_Goal 7443
   (subprogram_specification, (59021 . 59051))
   281: succeed 1, enqueue 4, check  2, cost:  0
   7442:(IDENTIFIER, (59256 . 59259))

7. 10700:(BEGIN, (82600 . 82604)) Resume_Token_Goal 10704
   (subprogram_specification, (82299 . 82324))
   340: succeed 2, enqueue 2, check  2, cost:  0
   encounters next error before terminate extra

8a. 627: 15304:(PROCEDURE, (122273 . 122281)) Resume_Token_Goal 15308
    (subprogram_specification, (40699 . 40726))
    627: succeed 1, enqueue 4, check  2, cost:  0
    no terminate needed

8b. 626: 15304:(PROCEDURE, (122273 . 122281)) Resume_Token_Goal 15308
    (subprogram_specification, (82299 . 82324))
    626: succeed 1, enqueue 4, check  2, cost:  0
    no terminate needed

9a. 957: 20650:(END, (170186 . 170188))
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20650:(END, (170186 . 170188))
    957: succeed 1, enqueue 40, check  17, cost:  1
    error due to some previous bad recovery

9b. 956: 20650:(END, (170186 . 170188)) Resume_Token_Goal 20654
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20650:(END, (170186 . 170188))
    956: succeed 1, enqueue 18, check  7, cost:  1
    error due to some previous bad recovery

10a. 957: 20655:(Wisi_EOI, (170222 . 170221)) Resume_Token_Goal 20659
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20655:(Wisi_EOI, (170222 . 170221))
     error due to some previous bad recovery
     957: succeed 1, enqueue 215, check  49, cost:  2

10b. 956: 20655:(Wisi_EOI, (170222 . 170221)) Resume_Token_Goal 20659
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20655:(Wisi_EOI, (170222 . 170221))
     error due to some previous bad recovery
     956: succeed 1, enqueue 126, check  23, cost:  1

test/lalr_parse_fail.adb
    lalr parse raises constraint_error in main parser
    lr1 no error.
    parser 0: aspect_clause
    parser 1: iteration_scheme
    both merged into state 6 in lalr, but iteration_sheme has no lookaheads!
    bug in lalr generator

ada-align groups preceding comment lines with declarations

run_ada_lr1_parse.exe hangs in free string if input file not found

package for Ludovic: elpa/archive/packages *.tar, archive-contents

stack has compilation_unit_list, next input is "end if;"
    only insert tokens whose minimal complete includes 'end if ;'
        requires another precomputed list; w.stephe-1
        one for each possible token sequence; just to "end ;", "end * ;"?
        current list is for wisi_eof

optimize Grow of SAL.Gen_Unbounded_Definite_Vectors?
    run-time parameter and/or generic parameter giving initial size
    output max size, accumulate in Emacs session

    go thru all uses
        wisitoken.syntax_tree.s.node_arrays

    similar for parse_stack?

enforce unix line endings
    run dos2unix in a mtn pre-commit hook?

time lex with no lex debug

rename parser actions to "parse", "post-parse"

show ada subprogram params as in elisp

ada.wy
    result_profile should not use name_opt, because it should not call wisi-propagate-name
        on the other hand, it doesn't really hurt


wisi-process-time-out is local to *-parse* buffer; setting from .adb has no effect

disable navigate commands if parse navigate fails

stefan complains he gets byte-compiler errors when compiling elpa after an ada-mode update.
    root cause is he doesn't do 'rm *.elc', and the byte-compiler doesn't set load-prefer-newer
    he'll try load-prefer-newer

elisp code has circular dependency
    see if load-prefer-newer finds it
    write dependency checker.
        in elisp so it can be added to batch-byte-compile

other misc fixes from stefan

wisi.el:1299:1:Warning: the following functions are not known to be defined:
    wisi-process--parser-total-wait-time, wisi-process--parser-response-count,
    wisi-process--parser-p
    move definition of time, or add declare-function

https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;include=subject:ada-mode
    33742 fixed, ludovic agrees
    33743 fixed, ludovic agrees
    33746 fixed, ludovic agrees

    33744 indentation of subexpressions
        https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33744
        need to identify subexpressions
        test/hanging.adb need more test cases
        waiting for money
            procedure Operator_Indentation is
            begin
              if B
                   or else C
                     > 2 -- indented relative to "or else"
              then
                null;
              end if;
            end Operator_Indentation;

    34029 multi-line trailing comments
        https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34029
        fixed

    34043: 'Misc | Reset parser' throws an error
        (point-min) /= 0! fixed

    34045: contraint_error on open non-existent file
        gen_emacs_wisi_lr_text_rep_parse.adb:149
        fixed in wisi.el; don't parse empty buffer


    33618 ada-mode sets global compilation-search-path => "breaks grep"
        see bug discussion
        applied Stefan's patch in emacs/master

    1913 non-ascii in regexp (2009!?)
        ada-syntax-propertize assumes ASCII in character literals; wrong (ARM 3.5.2 Wide_Character, Wide_Wide_Character)
        ada-parent-name-regexp is wrong; only used in ada-set-ff-special-constructs
        ada-identifier-at-point is wrong; used in xref/navigation

possible Eurocontrol work
    still to slow on very large files
        implement parser as Emacs module

        do "incremntal" parser
            start at function/block keyword found by lisp regexp
            stop at first compilation unit
                or ignore error from following code

    command line pretty-printer using Ada parser

    full sub-expression indenting for ada-indent-rel-exp

    investigate libadalang

ada-process.el missing TICK_2 on debian o.e.a.s-5
    because generated by External
    should be ada-process-external.el!

use EXE_EXT consistently, delete Executable_Suffix in *.gpr

> When inserting a comment, the marker appears after the leading '-' &
> doesn't go away as the rest of the comment is typed (until DEL or
> RET).

Move defgeneric parse parameters to process, with default. Delete from wisitoken-grammar

move gnatcoll install instructions to wisi elpa package, for reference
from wisitoken-grammar-mode.

delete ada-mode-opentoken
    or rename to -wisitoken

use #'ignore, not nil, for function vars
    or convert to cl-generic

debug-on-error t should only throw error when there is a bug in the
    elisp code, not for a syntax error in user code (since that's expected).
    put errors on wisi--parser-errors lower down.

'wisi-compile-grammar' should be renamed 'wisi-compile-parse-table'

Decrease elisp parser startup time
    wisi-compile-grammar slow
        obarray is not written into elc; must be computed at load time
    wisi-bnf-generate write lambda from wisi-semantic-action into parse table for each action
    also other changes? eliminate wisi-compile-grammar/parse-table

do module interface

remove all code supporting emacs < 25
    syntax-propertize calls

use #'remove-hook

review eglot
    completion; maybe more not obvious from the LSP main page

first use of lr1 can time out because of load table time
    does not recover nicely
    longer timeout on first use?
        or just increase timeout

test/ada_mode-recover_redundant_solutions_1.adb
    recover finds two identical solutions
        one from Language_Fixes end keyword 1
        one from minimal complete actions
        delete the language_fixes case?

interactive indent requires [0 ada-indent] on block start keywords when following token is virtual from recovery
    normally get indent from next token, but that's virtual, and is not in token.first/last_indent_lines
        or something like that
        find a place to document this
            in wisi.texi user guide
                explain emacs wisi package
                parser actions
                section that explains indent-action syntax

        or fix it; for real comment, use indent from next token even if it's virtual

redundant solutions
    ada_mode-recover_redundant_solutions_1.adb

https://github.com/lapo-luchini/asn1js/blob/master/mirror_to_github.sh
    export, incremental update of git mirror works
    push my stuff to savannah
        also to github?

do module interface

gnat pro 2018
    AI12-0125 "@" shorthand  http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0125-3.txt
        target_name ::= @
        Name : target_name | ... ;
        My_Array(I) := @*2 + @/2;

    AI12-0127 delta_aggregates http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0127-1.txt?rev=1.25&raw=N
        aggregate ::= record_aggregate | extension_aggregate | array_aggregate | delta_aggregate
        delta_aggregate ::= record_delta_aggregate | array_delta_aggregate
        record_delta_aggregate ::=
          (*base_*expression with delta record_component_association_list)
        array_delta_aggregate ::=
          (*base_*expression with delta array_component_association_list)

        procedure Twelfth (D : in out Date) -- see 3.8 for type Date with Post => D = (D'Old with delta Day => 12);
        A1 : Vector := ((1.0, 2.0, 3.0) with delta Integer (Random * 3.0) => 14.2);

ada.wy:774: ;; FIXME: | digits_constraint
ada.wy:775: ;; FIXME: | delta_constraint
ada.wy:1015:;; FIXME: leaving out [renaming] [aspect_specification]
ada.wy:1245:      ;; FIXME: indentation of comment after 'is' (and 'with' in
ada.wy:1929: ;; allocator, FIXME: leaving out subpool_specification.


revert "allow everything to be empty"
    see if error handling is good enough

    or start over from annex P, see how many mods are actually required

option to stack/append xref results

Test indent when narrowed to subprogram

packrat
    need to override wisitoken.parse.put_errors for emacs process interface
        derive an Emacs_Parser type?

        or add abstract error_list, change wisi_runtime.put_errors to use that

        using Parser.Put_Errors for now

    langkit packrat is significantly faster than wisitoken lalr
        because of generated code, not table interpreter?
            try generated code for lalr
                lose error correction?
        use non-error-correcting packrat as primary parser, error-correcting lalr as fallback

    generate, compile packrat speed?
        ada_packrat_process_main.adb (31347 lines) compiles _way_ faster than ada_process_main.adb (13692 lines)


time with w32-pipe-read-delay 0

add missing features to gpr_query; see fixmes.
    option to run in background, from Makefiles

Contact ada cubesat lab, see if they will beta test indentation engine.

see if more tasks go faster or slower.

emacs track single parse-max, don't reparse for different action; just execute action.
    requires saving the syntax tree in the process
    lost if another buffer parse intervenes
        unless add per-buffer cache

make-subprogram-body should strip aspects.

clean up gpr-mode; delete 'we reuse ada' comments
    refactor ada auto-case into wisi, use in gpr


clean up Makefile, common.make
    see wisi_grammar

compute align in grammar actions
    align-list action on ':', '=>' etc

Grune 9.10.4 Incremental Parsing.
    Compare new lex to old lex, update syntax tree

support variable pitch fonts
    (put-text-property 118 120 'display '(space :width (10))))

Mark syntax error lines in margin.
    What does fly-check do?

add wisi-forward-anchor, use for comments after 'is', 'when' in record type

gpr-mode.el:263:  (set-syntax-table ada-mode-syntax-table);; FIXME: create gpr-mode-syntax-table
gpr-query.el:263:  ;; FIXME: implement ada-xref-full-path.
gpr-query.el:265:  ;; FIXME: implement append
gpr-query.el:583:  ;; FIXME: implement local-only, append
gpr-skel.el:114:;; FIXME: code below should be in skeleton.el
gpr-skel.el:202:	;; FIXME: hook for Ada case adjust
wisi.el:1145:		 ;; FIXME: ensure at beginning of error message line.

newline not in a word should not cause parse retry after parse fail

refactor {ada|gpr|java}-skel-expand
    (defun skel-expand
    use buffer-local skel-token-alist

Ada 2020 features:
    delta aggregates (partial aggregate notation)
    http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0127-1.txt?rev=1.10
    wait for wisi-2.0

    new syntax in AI12-061:
        http://www.adacore.com/developers/development-log/NF-17-P617-043-gnat

 benchmarks:
    update only in o.e.a

    build/Makefile
        comment out 'export Standard_Common_Build := Debug'
        make recursive-clean build_ada_executables

d:/Apps/GNAT-gpl_2016/gnatcoll-gpl-2016-src/src/sqlite/gnatcoll-xref.adb
    copied to c:/tmp/gnatcoll-xref.adb
    7252 lines, 29461 tokens, 254989 characters

wisi-generate
    $WISI_WISITOKEN/wisi-generate.exe --time ada.wy

    04 mar 2018
        o.e.a.s-2 12.919s
        o.e.a.s-4 24.398s, 24.625s

    12 Apr 2018
        o.e.a.s-4 16.136s

    23 May 2018
        11.967s, 12.035s

    25 Jul 2018
        trees in lr1_items search, -O3
        LALR elisp generate time: 3.290167687
        LALR re2c generate time: 3.309398246
        LR1 re2c generate time: 602.235431713

    26  Jul 2018
        don't loop on all token_ids; loop on set
        LALR elisp generate time: 0.445727505
        LALR re2c generate time: 0.450525800
        LR1 re2c generate time: 31.202567095

    1 Aug 2018 replace Constrain_Terminals with Minimal_Complete_Actions
        LALR elisp generate time: 0.472614643
        LALR re2c generate time: 0.480273867
        LR1 re2c generate time: 31.820868201

mckenzie recover
    ./run_ada_parse.exe test/slow_recover_1.adb Indent --verbosity 1 1 0
    ./run_ada_parse.exe test/slow_recover_1.adb Indent --repeat_count 5
        or, if that's really slow, 'time ./run_ada_parse.exe test/slow_recover_1.adb Indent --verbosity 1 1 0'

    use binary min heap: ~2.7
    use fibonacci min heap: ~2.57
    sal.bounded_vector in Configuration: 1.700269668, 1.675688670
    faster sal stack: 1.599979082, 1.555800480, 1.569708386 -> slightly faster, keep it.
    default_init stack => 50 : 1.602228258, 1.629959644 -> slower!
    7 parallel tasks, one protected object, one solution: 0.556900752, 0.564946255, 0.580240866
    7 tasks, many protected objects, several equal cost solutions, keep last one: 0.588807432, 0.555614030, 0.591806258
    "", keep several: 0.611813538, 0.724677583, 0.659352765
    change to Base_Token, prep for block name matching: 0.829402871, 0.822722491, 0.834653581

    27 Dec 2017
        add match_names, block_label, loop_label; set check_limit 4; requires --max_parallel 17: 4.822095917 4.955374324

    04 Mar 2018
        misc improvements 1.502121666, 1.833030047 seconds
         5: fail, enqueue 68402, check  4683, cost_limit:  12
         1: succeed 1, enqueue 13, check  5, cost:  0

    07 Mar 2018
        convert to syntax trees 1m12.017s
         6: fail, enqueue 7266, check  508, cost_limit:  12
         5: succeed 1, enqueue 1427, check  98, cost:  10
         1: succeed 2, enqueue 2901, check  255, cost:  10

         5: fail, enqueue 68402, check  4683, cost_limit:  12
         1: succeed 1, enqueue 64947, check  5682, cost:  12

    11 Mar 2018
        no syntax trees in recover 0.450195152
         6: succeed 1, enqueue 187, check  13, cost:  7
         5: succeed 1, enqueue 1426, check  97, cost:  10
         1: succeed 2, enqueue 1011, check  87, cost:  9

    14 Mar 2018 final no syntax trees in recover
        2.981941108
         6: succeed 1, enqueue 403, check  18, cost:  5
         5: succeed 1, enqueue 5113, check  267, cost:  8
         1: succeed 2, enqueue 33455, check  1653, cost:  10
        recover: succeed, parser count 4

         6: succeed 1, enqueue 11364, check  678, cost:  9
         5: succeed 1, enqueue 32049, check  1742, cost:  10
         1: succeed 1, enqueue 252, check  28, cost:  6
        recover: succeed, parser count 3

         5: succeed 1, enqueue 18052, check  1038, cost:  8
        recover: succeed

    29 Mar 2018
        Language_Fixes replace patterns
        0.668252932
         6: succeed 1, enqueue 3774, check  275, cost:  9
         5: succeed 1, enqueue 2200, check  153, cost:  8
         1: succeed 2, enqueue 7863, check  753, cost:  10
        recover: succeed, parser count 4

         6: succeed 1, enqueue 16773, check  1826, cost:  10
         5: fail, enqueue 75967, check  5189, cost_limit:  12
         1: succeed 1, enqueue 30892, check  4840, cost:  12
        recover: succeed, parser count 3

    6 Apr
        ? 0.762936988
         6: succeed 1, enqueue 16773, check  1826, cost:  10
         6:  10, Error (END, (405 . 407)) (1227 : (SEMICOLON))| 33:(END 18:0)|((INSERT, RIGHT_PAREN, 33), (INSERT, THEN, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33))
         5: fail, enqueue 75967, check  5189, cost_limit:  12
         1: succeed 1, enqueue 95, check  18, cost:  6
         1:  6, Error (IDENTIFIER, (409 . 422)) (642 : (END))| 34:(IDENTIFIER 18:4)|((INSERT, IF, 34), (INSERT, SEMICOLON, 34), (INSERT, END, 34))
        ... ambiguous with error

    8 Apr
        constrain_terminals to complete current production
        0.879914712
        parser 6: State 357 Current_Token 28:(RIGHT_PAREN, (369 . 369)) Action, expecting: WITH, found 28:(RIGHT_PAREN, (369 . 369))
        parser 5: State 357 Current_Token 27:(RIGHT_PAREN, (368 . 368)) Action, expecting: WITH, found 27:(RIGHT_PAREN, (368 . 368))
        parser 1: State 670 Current_Token 29:(OR, (379 . 380)) Action, expecting: THEN, found 29:(OR, (379 . 380))
         6: succeed 1, enqueue 3774, check  275, cost:  9
         6:  9, Error (RIGHT_PAREN, (369 . 369)) (155 : (LEFT_PAREN))| 14:(IDENTIFIER 10:6)|((PUSH_BACK, expression_opt, 14), (INSERT, IF, 14), (INSERT, LEFT_PAREN, 14))
         5: succeed 1, enqueue 2193, check  151, cost:  8
         5:  8, Error (RIGHT_PAREN, (368 . 368)) (155 : (LEFT_PAREN))| 20:(IDENTIFIER 11:9)|((PUSH_BACK, expression_opt, 20), (INSERT, LEFT_PAREN, 20), (INSERT, LEFT_PAREN, 20))
         1: succeed 2, enqueue 7863, check  753, cost:  10
        spawn parser 7 from 1 (4 active)
         7:  10, Error (OR, (379 . 380)) (47 : (IDENTIFIER))| 29:(OR 13:8)|((INSERT, THEN, 29), (INSERT, ELSIF, 29), (INSERT, IDENTIFIER, 29))
         1:  10, Error (OR, (379 . 380)) (47 : (IDENTIFIER))| 29:(OR 13:8)|((INSERT, THEN, 29), (INSERT, IF, 29), (INSERT, IDENTIFIER, 29))

        parser 6: State 390 Current_Token 33:(END, (405 . 407)) Action, expecting: ABS, ELSE, ELSIF, NEW, NOT, NULL, RAISE, LEFT_PAREN, RIGHT_PAREN, MINUS, PLUS, NUMERIC_LITERAL, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 33:(END, (405 . 407))
        parser 5: State 356 Current_Token 32:(THEN, (398 . 401)) Action, expecting: WITH, RIGHT_PAREN, BAR, COMMA, EQUAL_GREATER, found 32:(THEN, (398 . 401))
        parser 1: State 1112 Current_Token 34:(IDENTIFIER, (409 . 422)) Action, expecting: IF, found 34:(IDENTIFIER, (409 . 422))
         6: fail, enqueue 9, check  9, cost_limit:  12
         5: fail, enqueue 75967, check  5189, cost_limit:  12
         1: succeed 1, enqueue 30892, check  4840, cost:  12
         1:  12, Error (IDENTIFIER, (409 . 422)) (642 : (END))| 34:(IDENTIFIER 18:4)|((INSERT, IF, 34), (INSERT, SEMICOLON, 34), (INSERT, END, 34), (INSERT, IF, 34), (INSERT, SEMICOLON, 34), (INSERT, END, 34))

    12 Apr 2018
        improved constrain_terminals, bug fixes
        slow_recover_1.adb: 0.043599139
        parser 6: State 357 Current_Token 28:(RIGHT_PAREN, (369 . 369)) Action, expecting: WITH, found 28:(RIGHT_PAREN, (369 . 369))
        parser 5: State 357 Current_Token 27:(RIGHT_PAREN, (368 . 368)) Action, expecting: WITH, found 27:(RIGHT_PAREN, (368 . 368))
        parser 1: State 670 Current_Token 29:(OR, (379 . 380)) Action, expecting: THEN, found 29:(OR, (379 . 380))
        6: succeed 1, enqueue 1051, check  86, cost:  7
        6:  7, Error (THEN, (398 . 401)) (395 : (RIGHT_PAREN))| 32:(THEN, (398 . 401))|((PUSH_BACK, expression_opt, 14), (INSERT, LEFT_PAREN, 14), (FAST_FORWARD,  32), (INSERT, RIGHT_PAREN, 32))
        5: succeed 1, enqueue 2637, check  203, cost:  8
        5:  8, (155 : (LEFT_PAREN))| 20:(IDENTIFIER, (305 . 310))|((PUSH_BACK, expression_opt, 20), (INSERT, LEFT_PAREN, 20), (INSERT, LEFT_PAREN, 20))
        1: succeed 1, enqueue 878, check  87, cost:  7
        1:  7, Error (OR, (379 . 380)) (395 : (RIGHT_PAREN))| 29:(OR, (379 . 380))|((PUSH_BACK, expression_opt, 6), (INSERT, LEFT_PAREN, 6), (FAST_FORWARD,  29), (INSERT, RIGHT_PAREN, 29))
        parser 5: State 356 Current_Token 32:(THEN, (398 . 401)) Action, expecting: WITH, RIGHT_PAREN, BAR, COMMA, EQUAL_GREATER, found 32:(THEN, (398 . 401))
        parser 1: State 1112 Current_Token 34:(IDENTIFIER, (409 . 422)) Action, expecting: IF, found 34:(IDENTIFIER, (409 . 422))
        5: succeed 1, enqueue 440, check  28, cost:  3
        5:  3, (1227 : (SEMICOLON))| 33:(END, (405 . 407))|((INSERT, RIGHT_PAREN, 32), (INSERT, RIGHT_PAREN, 32), (FAST_FORWARD,  34), (PUSH_BACK, END, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33), (FAST_FORWARD,  33))
        1: succeed 1, enqueue 2, check  2, cost:  0
        1:  0, (1227 : (SEMICOLON))| 33:(END, (405 . 407))|((PUSH_BACK, END, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33), (FAST_FORWARD,  33))

        slow_recover_2.adb: 0.265317189
        parser 2: State 431 Current_Token 13:(BEGIN, (553 . 557)) Action, expecting: ACCESS, ALIASED, ARRAY, CONSTANT, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (553 . 557))
        parser 1: State 435 Current_Token 13:(BEGIN, (553 . 557)) Action, expecting: ACCESS, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (553 . 557))
         2: succeed 1, enqueue 39, check  13, cost:  5
         2:  5, (716 : (SEMICOLON))| 13:(BEGIN, (553 . 557))|((INSERT, EXCEPTION, 13), (INSERT, SEMICOLON, 13))
         1: succeed 3, enqueue 97, check  27, cost:  7
         3:  7, (382 : (BEGIN))| 11:(IDENTIFIER, (539 . 549))|((PUSH_BACK, COLON, 12), (PUSH_BACK, IDENTIFIER, 11), (INSERT, BEGIN, 11))
         4:  7, Error (BEGIN, (553 . 557)) (111 : (LEFT_PAREN))| 14:(IF, (562 . 563))|((INSERT, IDENTIFIER, 13), (INSERT, LEFT_PAREN, 13), (DELETE, BEGIN, 13))
         1:  7, Error (COLON, (551 . 551)) (274 : (declarations, (509 . 533)))| 13:(BEGIN, (553 . 557))|((PUSH_BACK, COLON, 12), (PUSH_BACK, IDENTIFIER, 11), (DELETE, IDENTIFIER, 11), (DELETE, COLON, 12))
        parser 4: State 47 Current_Token 22:(END, (607 . 609)) Action, expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (607 . 609))
        parser 3: State 47 Current_Token 22:(END, (607 . 609)) Action, expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (607 . 609))
        parser 2: State 47 Current_Token 22:(END, (607 . 609)) Action, expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (607 . 609))
         4: fail, enqueue 28179, check  4088, cost_limit:  12
         3: succeed 1, enqueue 517, check  53, cost:  6
         3:  6, (1138 : (SEMICOLON))| 22:(END, (607 . 609))|((INSERT, RIGHT_PAREN, 22), (INSERT, THEN, 22), (FAST_FORWARD,  23), (PUSH_BACK, END, 22), (INSERT, END, 22), (INSERT, IF, 22), (INSERT, SEMICOLON, 22), (FAST_FORWARD,  22), (FAST_FORWARD,  25), (PUSH_BACK, SEMICOLON, 24), (PUSH_BACK, identifier_opt, 23), (PUSH_BACK, END, 22), (INSERT, END, 22), (INSERT, SEMICOLON, 22), (FAST_FORWARD,  22))
         2: succeed 1, enqueue 208, check  26, cost:  5
         2:  5, (1227 : (SEMICOLON))| 22:(END, (607 . 609))|((INSERT, RIGHT_PAREN, 22), (INSERT, THEN, 22), (FAST_FORWARD,  23), (PUSH_BACK, END, 22), (INSERT, END, 22), (INSERT, IF, 22), (INSERT, SEMICOLON, 22), (FAST_FORWARD,  22))

        slow_recover_3.adb 0.004004858
        parser 1: State 1112 Current_Token 28:(IDENTIFIER, (404 . 417)) Action, expecting: IF, found 28:(IDENTIFIER, (404 . 417))
         1: succeed 1, enqueue 197, check  24, cost:  2
         1:  2, (1230 : (SEMICOLON))| 27:(END, (400 . 402))|((PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, IF, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27), (FAST_FORWARD,  28), (PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, LOOP, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27), (FAST_FORWARD,  28), (PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, RETURN, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27))

    20 Apr 2018
        kill slow parser, fix bugs

        slow_recover_1.adb, debug: 0.044365563, release 0.041309647, 0.041447012
        parser 6: State 357 Current_Token 28:(RIGHT_PAREN, (159 . 159)) Action, expecting: WITH, found 28:(RIGHT_PAREN, (159 . 159))
        parser 5: State 357 Current_Token 27:(RIGHT_PAREN, (158 . 158)) Action, expecting: WITH, found 27:(RIGHT_PAREN, (158 . 158))
        parser 1: State 670 Current_Token 29:(OR, (161 . 162)) Action, expecting: THEN, found 29:(OR, (161 . 162))
         6: succeed 1, enqueue 1051, check  86, cost:  7
         6:  7, (395 : (RIGHT_PAREN))| 32:(THEN, (168 . 171))|((PUSH_BACK, expression_opt, 14), (INSERT, LEFT_PAREN, 14), (FAST_FORWARD,  32), (INSERT, RIGHT_PAREN, 32))
         5: fail, enqueue 2684, check  206, cost_limit:  12
         1: succeed 1, enqueue 961, check  92, cost:  7
         1:  7, (395 : (RIGHT_PAREN))| 29:(OR, (161 . 162))|((PUSH_BACK, expression_opt, 6), (INSERT, LEFT_PAREN, 6), (FAST_FORWARD,  29), (INSERT, RIGHT_PAREN, 29))
        parser 1: State 1112 Current_Token 34:(IDENTIFIER, (177 . 190)) Action, expecting: IF, found 34:(IDENTIFIER, (177 . 190))
         1: succeed 1, enqueue 2, check  2, cost:  0
         1:  0, (1227 : (SEMICOLON))| 33:(END, (173 . 175))|((PUSH_BACK, END, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33), (FAST_FORWARD,  33))

        slow_recover_2.adb, debug: 0.018879361 release 0.017998993, 0.018000352
        parser 2: State 431 Current_Token 13:(BEGIN, (597 . 601)) Action, expecting: ACCESS, ALIASED, ARRAY, CONSTANT, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (597 . 601))
        parser 1: State 435 Current_Token 13:(BEGIN, (597 . 601)) Action, expecting: ACCESS, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (597 . 601))
         2: succeed 1, enqueue 33, check  10, cost:  3
         2:  3, (716 : (SEMICOLON))| 13:(BEGIN, (597 . 601))|((INSERT, EXCEPTION, 13), (INSERT, SEMICOLON, 13))
         1: succeed 1, enqueue 114, check  31, cost:  5
         1:  5, (111 : (LEFT_PAREN))| 14:(IF, (605 . 606))|((INSERT, IDENTIFIER, 13), (INSERT, LEFT_PAREN, 13), (DELETE, BEGIN, 13))
        parser 2: State 47 Current_Token 22:(END, (650 . 652)) Action, expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (650 . 652))
        parser 1: State 47 Current_Token 22:(END, (650 . 652)) Action, expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (650 . 652))
         2: succeed 1, enqueue 165, check  28, cost:  3
         2:  3, (1227 : (SEMICOLON))| 22:(END, (650 . 652))|((INSERT, RIGHT_PAREN, 22), (INSERT, THEN, 22), (FAST_FORWARD,  23), (PUSH_BACK, END, 22), (INSERT, END, 22), (INSERT, IF, 22), (INSERT, SEMICOLON, 22), (FAST_FORWARD,  22))
         1: fail, enqueue 1435, check  228, cost_limit:  12

        slow_recover_3.adb, debug: 0.003649699, release 0.003497308
        parser 1: State 1112 Current_Token 28:(IDENTIFIER, (404 . 417)) Action, expecting: IF, found 28:(IDENTIFIER, (404 . 417))
         1: succeed 1, enqueue 230, check  25, cost:  2
         1:  2, (1230 : (SEMICOLON))| 27:(END, (400 . 402))|((PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, IF, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27), (FAST_FORWARD,  28), (PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, LOOP, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27), (FAST_FORWARD,  28), (PUSH_BACK, END, 27), (INSERT, END, 27), (INSERT, RETURN, 27), (INSERT, SEMICOLON, 27), (FAST_FORWARD,  27))

        slow_recover_4.adb, release: 0.136253722
        parser 2: State 111 Current_Token 122:(WHEN, (994 . 997)) Action, expecting: ABS, CASE, FOR, IF, NEW, NOT, NULL, OTHERS, RAISE, LEFT_PAREN, RIGHT_PAREN, BAR, COMMA, EQUAL_GREATER, MINUS, PLUS, NUMERIC_LITERAL, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 122:(WHEN, (994 . 997))
         2: succeed 2, enqueue 232, check  36, cost:  4
         5:  4, (111 : (LEFT_PAREN, (968 . 968)))| 123:(IDENTIFIER, (974 . 993))|((DELETE, WHEN, 122))
         2:  4, (387 : (IS))| 122:(WHEN, (969 . 972))|((INSERT, CASE, 122), (INSERT, IS, 122))
        parser 6: State 402 Current_Token 131:(WITH, (1100 . 1103)) Action, expecting: IS, RIGHT_PAREN, COMMA, SEMICOLON, found 131:(WITH, (1100 . 1103))
        parser 5: State 187 Current_Token 133:(SEMICOLON, (1120 . 1120)) Action, expecting: RIGHT_PAREN, COMMA, found 133:(SEMICOLON, (1120 . 1120))
        conflicts in Constrain_Terminals; state 891
        conflicts in Constrain_Terminals; state 887
        conflicts in Constrain_Terminals; state 888
         6: fail, enqueue 6900, check  1061, cost_limit:  12
         5: succeed 1, enqueue 6110, check  463, cost:  8
         5:  8, (1241 : (SEMICOLON))| 134:(WHEN, (1109 . 1112))|((INSERT, RIGHT_PAREN, 133), (INSERT, RIGHT_PAREN, 133), (INSERT, SEMICOLON, 133), (INSERT, END, 133), (INSERT, IF, 133), (FAST_FORWARD,  134), (INSERT, END, 134), (INSERT, SEMICOLON, 134))
        parser 5: State 1112 Current_Token 146:(IDENTIFIER, (1222 . 1235)) Action, expecting: IF, found 146:(IDENTIFIER, (1222 . 1235))
         5: succeed 1, enqueue 2, check  2, cost:  0
         5:  0, (1227 : (SEMICOLON))| 145:(END, (1187 . 1189))|((PUSH_BACK, END, 145), (INSERT, END, 145), (INSERT, IF, 145), (INSERT, SEMICOLON, 145), (FAST_FORWARD,  145))

    23 May 2018
        add more cases

        slow_recover_1.adb, release 0.041959739
        parser 5: State 356 Current_Token 32:(THEN, (451 . 454)) expecting: WITH, RIGHT_PAREN, BAR, COMMA, EQUAL_GREATER, found 32:(THEN, (451 . 454))
        parser 1: State 1112 Current_Token 34:(IDENTIFIER, (489 . 502)) expecting: IF, found 34:(IDENTIFIER, (489 . 502))
         5: succeed 1, enqueue 375, check  32, cost:  3
         5:  3, (1227 : (SEMICOLON))| 33:(END, (485 . 487))|((INSERT, RIGHT_PAREN, 32), (INSERT, RIGHT_PAREN, 32), (FAST_FORWARD,  34), (PUSH_BACK, END, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33), (FAST_FORWARD,  33))
         1: succeed 1, enqueue 2, check  2, cost:  0
         1:  0, (1227 : (SEMICOLON))| 33:(END, (485 . 487))|((PUSH_BACK, END, 33), (INSERT, END, 33), (INSERT, IF, 33), (INSERT, SEMICOLON, 33), (FAST_FORWARD,  33))
        ambiguous with error

        slow_recover_2.adb, release 0.018035865
        parser 2: State 431 Current_Token 13:(BEGIN, (599 . 603)) expecting: ACCESS, ALIASED, ARRAY, CONSTANT, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (599 . 603))
        parser 1: State 435 Current_Token 13:(BEGIN, (599 . 603)) expecting: ACCESS, EXCEPTION, NOT, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 13:(BEGIN, (599 . 603))
         2: succeed 1, enqueue 10, check  5, cost:  3
         2:  3, (716 : (SEMICOLON))| 13:(BEGIN, (599 . 603))|((INSERT, EXCEPTION, 13), (INSERT, SEMICOLON, 13))
         1: succeed 1, enqueue 108, check  32, cost:  5
         1:  5, (111 : (LEFT_PAREN))| 14:(IF, (608 . 609))|((INSERT, IDENTIFIER, 13), (INSERT, LEFT_PAREN, 13), (DELETE, BEGIN, 13))
        parser 2: State 47 Current_Token 22:(END, (653 . 655)) expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (653 . 655))
        parser 1: State 47 Current_Token 22:(END, (653 . 655)) expecting: ACCEPT, ABORT, AND, BEGIN, CASE, DECLARE, DELAY, DIGITS, DO, ELSE, ELSIF, EXIT, FOR, GOTO, IF, IN, IS, LOOP, MOD, NOT, NULL, OF, OR, PRAGMA, RAISE, RANGE, REM, RENAMES, REQUEUE, RETURN, SELECT, THEN, USE, WHILE, WITH, XOR, LEFT_PAREN, RIGHT_PAREN, AMPERSAND, BAR, COLON_EQUAL, COMMA, DOT, DOT_DOT, EQUAL, EQUAL_GREATER, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LESS_LESS, MINUS, PLUS, SEMICOLON, SLASH, SLASH_EQUAL, STAR, STAR_STAR, TICK_1, TICK_2, IDENTIFIER, STRING_LITERAL, CHARACTER_LITERAL, found 22:(END, (653 . 655))
         2: succeed 1, enqueue 157, check  22, cost:  3
         2:  3, (1227 : (SEMICOLON))| 22:(END, (653 . 655))|((INSERT, RIGHT_PAREN, 22), (INSERT, THEN, 22), (FAST_FORWARD,  23), (PUSH_BACK, END, 22), (INSERT, END, 22), (INSERT, IF, 22), (INSERT, SEMICOLON, 22), (FAST_FORWARD,  22))
         1: fail, enqueue 1351, check  222, cost_limit:  12, max shared_token  25

navigate, face, indent
    make -r benchmark
        uses gnatcoll-xref.adb

    27 Nov 2017 - compute actions in Ada
        1.377199 seconds 3 gcs 6560 responses 0.509915 wait
        1.523548 seconds 2 gcs 6560 responses 0.518090 wait

    12 Apr 2018 - syntax table
        navigate 1.411872 seconds 4 gcs 6560 responses 0.352224 wait
        face     1.507372 seconds 5 gcs 2145 responses 0.319860 wait
        indent   1.447788 seconds 1 gcs 7251 responses 0.350474 wait

    23 May 2018
        navigate 1.542892 seconds 4 gcs 6560 responses 0.473158 wait
        face     1.645698 seconds 4 gcs 2145 responses 0.452539 wait
        indent   1.603725 seconds 1 gcs 7251 responses 0.491922 wait

    2 Sep 2018
    using lalr
        navigate 0.985181 seconds 4 gcs 6568 responses 0.248143 wait
        face     1.119776 seconds 4 gcs 2145 responses 0.246759 wait
        indent   1.033525 seconds 1 gcs 7251 responses 0.251972 wait
    lr1:
        navigate 0.968994 seconds 4 gcs 6568 responses 0.231818 wait
        face     1.085459 seconds 4 gcs 2145 responses 0.219220 wait
        indent   1.020811 seconds 1 gcs 7251 responses 0.237752 wait


    wisi-motion-action
        in [] token-numbers, skip statements with wisi-goto-end

    wisi-process-parse--Cache
        faster to check for & modify existing?

parse face
    wisitoken-parser-lr-lalr_generator.adb
    (wisi-time (lambda () (wisi-parse-buffer 'face)) 5 t); t for process stats

    15 Sep 2017
        o.e.a.s-4 elisp parser: per iteration 0.284380 seconds, 1 gcs

        process parser, elisp lexer 1.021952 seconds, 2 gcs

    28 Nov 2017 compute actions in Ada
        gnatcoll-xref.adb
            per iteration 1.405831 seconds 2 gcs 2145 responses 0.493506 wait

        wisitoken-parser-lr-lalr_generator.adb
            per iteration 0.175466 seconds 0 gcs 276 responses 0.082255 wait

    marking _every_ identifer as possible face prefix
        count face actions before/after delete that
        to avoid marking contents of allocator aggregate
        handle that case individually; find others

parse indent
    (wisi-time-indent-middle-line-cold-cache 1 t); t for process stats
    /Projects/smm.main/source/smm-server.adb

    gnatcoll-xref.adb: 29461 tokens 149921 actions 1257 parsers

    28 Nov 2017 compute actions in Ada
        gnatcoll-xref.adb
            per iteration 1.497652 seconds 1 gcs 7251 responses 0.507303 wait

        wisitoken-parser-lr-lalr_generator.adb
            per iteration 0.179418 seconds 0 gcs 775 responses 0.083123 wait

    15 Sept 2017:
        elisp parser, full buffer:
            gnatcoll-xref.adb: 2.875186 seconds, 11 gcs => action time (- 2.875186 1.515792) = 1.359394
            smm-server.adb:    0.134355 seconds, 0 gcs

        elisp parser, middle line
            gnatcoll-xref.adb: 2.671991 seconds 11 gcs
            smm-server.adb:    0.140611 seconds 0 gcs

        process parser, whole buffer:
            gnatcoll-xref.adb:

            smm-server.adb:     0.303155 seconds, 1 gcs

        process parser, middle line
            gnatcoll-xref.adb: 16.166306 seconds 19 gcs 29461 tokens 149921 actions 0.015640 wait
            => scan parse action time = total - wisi-lex-send-tokens - action-time - wait-time
               = (+ 16.166306 -1.559691 -1.359394 -0.015640) = 13.231581
               action                count
                1 Lexer_To_Lookahead 29463
                2 Error              (- 30598 29463) 1135 ; from conflict resolution
                3 Spawn              (- 31803 30598) 1205 ; some terminated with identical stacks
                4 Terminate_Parser   (- 33008 31803) 1205
                5 Virtual_To_Lookahead 0 - no actual errors
                6 Push_Current       (- 62469 33008) 29461 = token count
                7 Reduce_Stack       (- 149928 62469) 87459

            smm-server.adb:     0.303128 seconds 1 gcs

            don't send right-hand-side tokens for reduce
                gnatcoll-xref.adb: 10.641623 seconds 15 gcs 29461 tokens 149921 actions 0.000000 wait

    16 Dec 2017:
        process parser: name in base_token, block_label_opt in block, loop
        ../run_ada_parse.exe c:/tmp/gnatcoll-xref.adb Indent --repeat_count 5
            0.346936964, 0.341999256

        (wisi-time-indent-middle-line-cold-cache 1 t)
        gnatcoll-xref.adb: 1.482145 seconds 0 gcs 7251 responses 0.387635 wait

    20 Feb 2018:
        ../run_ada_parse.exe c:/tmp/gnatcoll-xref.adb Indent --repeat_count 5
            0.311213888, 0.317810000

    08 Mar 2018:
        o.e.a.s-2: misc changes 0.331148598
        o.e.a.s-4: syntax_tree: 36.680009379, 36.850242615

    10 Mar 2018:
        o.e.a.s-4: branched syntax_tree in main parse: 0.523269951, 0.508891395

    more recent; see above

    future improvments:
        send more than one indent per output line, to reduce communication overhead

        use module instead of process
            can pass actions from module to elisp in binary?, to avoid scan-sexps
            try mingw64 gnat on Windows
                use 32 bit gprbuild to run 64 bit tools

        take more of multicore:
            Put parallel parse in separate tasks.

            at least one thread in module

        wisi-anchored-2, wisi--indent-token-1
            don't apply anchor if all lines already anchored
            don't loop thru lines more than once?

        indent compute only lines needed
            skip nonterms that don't overlap indent region
            significantly complicates cache valid, wisi-cache-try algorithm

        delete 'end' processing, use next-statement-keyword to look for 'end'?


plain parse, no actions:
    14 Sept 2017:
        elisp parser
            (setq ada-parser 'elisp)
            (let ((wisi-action-disable t))(wisi-time (lambda () (wisi-parse-buffer 'navigate)) 5))
            1.515792 seconds 8 gcs

        command line run_ada_parser with re2c lexer, memory mapped file
            run_ada_parser.exe gnatcoll-xref.adb --repeat_count 10
                per iteration: 0.261657065 seconds - fast enough!

            run_ada_parser.exe gnatcoll-xref.adb --lexer-only --repeat_count 10
                per iteration: 0.004567678

        process parser with elisp lexer, warm process
            (setq ada-parser 'parser)
            gnatcoll-xref.adb
            (let ((wisi-action-disable t))(wisi-time (lambda () (wisi-parse-buffer 'navigate)) 1 t))
            6.734948 seconds 12 gcs 0.031288 wait
            6.708216 seconds 11 gcs 0.015633 wait

        just elisp lexer
            (wisi-time (lambda () (wisi-lex-buffer 'indent)) 5) ;; compute line info
            0.331260 seconds 2 gcs

            (wisi-time (lambda () (wisi-lex-buffer 'face)) 5) ;; no line info
            0.281287 seconds 2 gcs

        elisp lexer + send tokens
            (wisi-time #'wisi-process-send-tokens-noop 1)
            1.559691 seconds 2 gcs

    16 Dec 2017:
        process parser: re2c lexer, name in base_token, block_label_opt in block, loop
        ../run_ada_parse.exe c:/tmp/gnatcoll-xref.adb Indent --repeat_count 5
            0.346936964, 0.341999256

        add byte_region in base_token: 0.339586284, 0.341083772, 0.340257321

history
    ada-mode 5.2
        indent whole buffer:
            (time-it (lambda () (progn (wisi-invalidate-cache)(indent-region (point-min) (point-max)))) 1)

        gps: per iteration 4.463700
        wisi: per iteration 8.331166

        indent one line

    ada-mode 6.x
        indent whole buffer:
            (time-it 'wisi-parse-buffer 1)

        indent first line: (time-it (lambda() (goto-line 1) (indent-for-tab-command)) 1)
        indent middle line: (time-it (lambda() (goto-line 3500) (indent-for-tab-command)) 1)
        indent last line: (time-it (lambda() (goto-line 7251) (indent-for-tab-command)) 1)

        march 8 2017; sort of working
            wisi whole buffer: per iteration 2.484650

        april 16 2017; all Ada tests pass
            wisi whole buffer: per iteration 3.516
            wisi first line: per iteration 2.594025, 2.562731, 2.578430
            wisi middle line: per iteration 2.562810, 2.791537, 2.750257
            wisi last line: per iteration 2.750262, 2.750256

        apr 17 add byte-compile in wisi-semantic-action
            wisi whole buffer: per iteration 3.127059, 3.109702, 2.984694 seconds, 13 gcs

        apr 23 add indent cache
            indent second line cold cache: (wisi-time-indent-line-cold-cache 2)
            indent second line warm cache: (wisi-time-indent-line-warm-cache 2 100)
            middle line: 3500
            last line:   7251

            second line cold cache: 2.735604 seconds 12 gcs
            second line warm cache: 0.006563 seconds

        june 8 Ada fasttoken process parser, wisi lexer
            (setq wisi-indent-region-fallback nil)
            second line cold cache: 5.351977 seconds 15 gcs
            second line warm cache: 0.006563 seconds

 indent issues
http://langserver.org/
    open protocol for IDE/compiler communication

ada-indent-hanging-rel-exp
    see FIXME: in ada-wisi.el
    need input from ludovic

    more cases:

    if FTFX.Main_CASA_Result.Suspension.Status /= Previous_Suspension_Info.Status
      or FTFX.Main_CASA_Result.Suspension.Delay_Threshold_Exceeded_Reg
        /= Previous_Suspension_Info.Delay_Threshold_Exceeded_Reg
    wisi aligns "/=" with "or"

 wisi work

disable or use electric-indent-post-self-insert-function
    called during ada-indent-newline-indent
    on post-self-insert-hook
        use that for ada-mode capitalization

Smart edit - delete if/then/endif, leaving content

gpr_query does not see libraries?
    need clear example; libadalang mains vs langkit?
    compare to GPS, gnatinspect

change Emacs manual section on ada-mode to mention elpa

ada-goto-declaration-start
    fails on task declaration
        only a problem if misusing C-c C-b ada-make-subprogram-body to make a task body
        C-x C-e skeleton expand works fine

        ada-make-subprogram-body should throw an error if it's not on a
        _subprogram_ spec, and recommend C-c C-e in the error message.

        but also fails on
        task body TA is
        begin
           null;
        end TA;

        fix the latter, see if it fixes ada-make-subprogram-body
            if not, make it throw an error.

    fails on separate (P) procedure X;
        C-c C-e works

        but also fails on
        separate (P)
        procedure X;
        is
        begin
        end X;

        fix the latter, see if it fixes ada-make-subprogram-body
            if not, obsolete that.

add "show all overloads" in navigate
    leave out file, line, col from gpr-query id

fill comments:
    set `fill-paragraph-function' to `ada-fill-comment-paragraph'

    `ada-fill-comment-paragraph' doesn't respect the region

    fix errors in filling:
procedure Non_Comment           -- The following line will be removed on M-Q,
                                --
is                              --  * if it was an empty comment.

   E : String := (1 =>    -- The following line will stay when pressing M-Q,
                          --
                          --  * even though it was empty.
                    'A');


gnat-core support RTS choice
    with GNAT GPL 2014:
    foo.gpr contains:
       package Builder is
          for Default_Switches ("ada") use ("--RTS=sjlj");
       end Builder;

    'gnat list -v -P foo.gpr' returns the wrong system library.

    'gnat list -v --RTS=sjlj' returns the correct system library.

    add project variable 'rts'

Gpr_query
    check gnatinspect for new features

    grok --RTS
        may be already done in 2015:
            for Runtime ("ada") use "stm32f429i-disco-rtos";


completion
    (info "(elisp)Completion")
    http://emacswiki.org/emacs/CategoryCompletion
    autocomplete package

    examples:
        Ada.Text_IO.<tab> => Put, Put_line, Get, etc
            needs new query; all symbols that match prefix
            better as an ASIS query?

        what does GPS do?
            works on non-compiled, bad syntax code
            type 'with '; puts up a list of all packages in the project.
            type 'with Ada.'; list of all children of Ada
                requires scroll, <ret> to select
                while scrolling, puts up help text next to list

            type 'Put', puts up a list of all simple names in project matching that prefix
            type 'Put (', puts up a list of all params of all Puts (_not_ filtered by current context clause)

            does _not_ handle 'foo_io.put', where 'foo_io' is an instance of A.Tio.float_io.
                maybe it would if foo_io is:
                    a library package instantiation
                    a local instantiation, but was previously compiled

            find the GPS source code

    match GPS behavior
        get completion candidates from gpr_query
        all names in scope at point

    built-in pcomplete
        completion-at-point-functions

    http://elpa.gnu.org/packages/company.html
        including C++ parameters, class members

    MELPA package auto-complete
    https://github.com/auto-complete/auto-complete
    https://github.com/capitaomorte/yasnippet

c:/Archive/Emacs/slime-2.10.1.tar.gz

face actions in gpr grammar?

after ada-mode is fast enough:
    built-in ada-mode: (make-obsolete 'ada-mode "use later version from ELPA via `list-packages')

use cl-lib class/method for dispatching

emacs 25 compile.el supports HYPERLINK in compilation regexp; use for secondary ref?
    ada-gnat-compile.el ada-gnat-compilation-filter


implement packrat in fasttoken, generate elisp

skip blocks of text unless needed for current user command

    two grammars
        use elisp parser
            simplifies debugging, installation

        coarse grammar skips all non-block statements

        sets high level caches that are start/end points for detailed grammar

        invalidate both for any change; "end" can make a new block.

        define both in one .wy file?
            share keywords, tokens

        start with test language in .wy


    skip statements at lexer level?
         mark all tokens as level 1 or 2
         level 1: function begin end if loop etc
         parse level 2 on demand

if specify project file in gnat_stub_opts, gnat stub can't find it due to changed directory
    change to gnat_stub_gpr, manage directory
    or edit gnat_stub_opts, insert project dir?

skeleton refactor/cleanup
    see fixmes

move stuff out of ada-mode-keys.el
    ada-make-package-spec
        skel default to (ada-name-from-file-name (buffer-file-name))?

different casing for identifiers (uppercase) and attributes (mixed)

refactoring

    rename entity:
        use xref to rename all uses (with/without confirm)

    change parameter_result_profile
        make same change in all overrides
        offer to walk thru all uses

    promote primitive subprogram-local variable to type component

    move primitive from parent to child class

    extract subprogram
        from Eclipse
        highlight lines of source
        prompt for name
        it guesses parameter_result_profile

support for "Adadoc"?
    formatted comments that mention parameters; check that they are all mentioned, spelled correctly

support for "ElDoc"?
    display parameter list for current function

Add Ada parser to gnu global?

 debug hints, relevant files
https://debbugs.gnu.org/Developer.html
https://debbugs.gnu.org/server-control.html
https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;include=subject:ada-mode

gdb run_ada_parse
    in wisitoken-wisi_runtime.adb Indent_Action_0:
        break on 'if token.first_indent_line then' line 1050
        call wisitoken.syntax_trees.id (tree, nonterm)
        p data.descriptor.image ($)
        p i
        p data.descriptor.image (token.id)
        p token.line
        p token.col
        p pair
        p data.indents.elements.ea(token.line)

    in wisitoken-semantic_state.adb Reduce
        break on 'nonterm.paren_state := ' line 334
        p descriptor.image (nonterm.id)
        p i
        p descriptor.image (aug_token.id)
        p aug_token
        p nonterm

to change process executable for all current and future buffers:

    in any *.adb buffer:
    (setf (wisi-process--parser-exec-file wisi--parser)
      "c:/Projects/org.emacs.ada-mode.stephe-2/ada_mode_wisi_parse.exe")
    M-x wisi-kill-parser

    to undo:
      (setf (wisi-process--parser-exec-file wisi--parser)
        "ada_mode_wisi_parse.exe")
    M-x wisi-kill-parser

    if *-process.el has changed:
    in *-process.el: M-x eval-buffer
    in *.<lang> buffer:
    (wisi-kill-parser
    (setq wisi-process--alist nil)
    M-x <lang>-mode

Edebug displays

in wisi-process-parse--Reduce_Stack:
(setq edebug-eval-list
 '(tokens-1
   tok
   (aref token-table (aref tokens-1 i))
   (queue-head (wisi-process--parser-parse-stack wisi--parser))
   sexp
   ))

in wisi-parse-reduce:
(setq edebug-eval-list
 '(nonterm
   tok
   first
   ))

in wisi--indent-token-1:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   wisi-nterm
   i
   delta
   indent
   ))

in wisi-indent-action:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   wisi-nterm
   wisi-tokens
   deltas
   wisi-token-index
   tok
   token-delta
   comment-delta
   ))

wisi-indent-region:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   anchor-indent
   i
   indent
   new-indent
   ))

use elp (emacs lisp profiler)?
    (with-current-buffer (find-file-noselect "~/src/xdisp.c")
      (elp-instrument-function 'c-beginning-of-defun)
      (goto-char (point-max))
      (condition-case nil
          (while (beginning-of-defun) nil)
        (error nil))
      (elp-results))

(progn (profiler-start 'cpu) (time-it 'wisi-parse-buffer 10) (profiler-report) (profiler-stop))
    B - profiler-report-render-reversed-calltree shows low-level time hogs

attach gud-gdb to running emacs: attach <process id>
    source emacs/src/.gdbinit
    xbacktrace shows lisp backtrace

"kill -USR2 <emacspid>" which should also drop you into the (elisp?) debugger.

(browse-url "c:/Projects/arm_info/org.adaic.arm_form/build/html/arm2012/RM-P.html")
(info "(aarm2012)Annex P" "*info Annex P*")
http://www.ada-auth.org/standards/
(info "(elisp)Parser State" "*info syntax-ppss*")
"c:/home/stephe/Backup/eBooks/Dick Grune/Parsing.pdf" [dickgrune]

http://savannah.gnu.org/projects/emacs/

http://git.savannah.gnu.org/cgit/emacs.git/tree/README?h=elpa
http://elpa.gnu.org/

https://www.dropbox.com/sh/7jr3vbv9tm1zod0/jPuvfrJAe8
    w32 builds of cutting-edge emacs branches, pretests

ftp://alpha.gnu.org/gnu/emacs/pretest/
    untar with cygwin
    in mys32 under emacs:
        cd /c/Projects/emacs/emacs-24.3.9x
        ./configure --prefix=/mingw32
        make
        # don't make install, just run from the build dir

 access to ada-france:

anonymous (read only) access:
    mtn --db ~/monotone-dbs/ada-france.db --key '' pull www.ada-france.org "org.emacs.*"

read/write access requires a public key:
    send output of 'mtn pubkey' to Ludovic Brenta
    <ludovic@ludovic-brenta.org> or Stephe Leake
    <stephen_leake@stephe-leake.org>

    add it to monotone db via 'mtn read'
    add it to /etc/monotone/write-permissions
    /etc/init.d/monotone restart

    mtn --db ~/monotone-dbs/ada-france.db sync "mtn://www.ada-france.org?org.emacs.*"

 git config for elpa checkout
in ~/.gitconfig:
    # 15 Feb 2016: ELPA has an object that fails this check; only need
    # to disable (set to false) when pull a full repository (that includes that
    # object)
        fsckObjects = false

[core]
	repositoryformatversion = 0
	filemode = false # don't set exec bits
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	fetch = +refs/heads/master:refs/remotes/origin/master
	push  = +refs/heads/master
	url = stephen_leake@git.sv.gnu.org:/srv/git/emacs/elpa.git
[branch "master"]
	remote = origin
	merge = refs/heads/master

 package install notes
libadalang etc with gnat pro 18.2
    install gnat 18.2
    reinstall gnatcoll 18.2 (needed for gpr-query anyway)
        ./configure --prefix=/usr/gnat/pro_18.2

    git clone libadalang
        see libadalang/install-lal-and-deps.sh
        cd libadalang
        git checkout 18.2
        virtualenv lal-venv
        . lal-venv/bin/activate
        pip install -r REQUIREMENTS.dev
        cd lal-venv/lal-venv/src/langkit/
        git checkout 18.2

        ada/manage.py --enable-static --disable-shared make
            # or --enable-static --enable-shared?
        ada/manage.py --enable-static --disable-shared install /usr/gnat/pro_18.2

        # for Emacs use of lal gpr files: (setenv "LIBRARY_TYPE" "static")

    git clone https://github.com/AdaCore/libadalang-tools.git
        git checkout 18.2

 release process
do wisitoken release ../org.wisitoken/build/release_process.text

(dvc-status ".")

# uninstall elpa packages before change version
build/Makefile uninstall-elpa

check for ELPA patches by others
    (dvc-status "/Projects/elpa")
        revert local changes
    (dvc-pull "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")
        update
        clean sync
    cd /Projects/elpa
    git log -2 -- packages/wisi
    git log -2 -- packages/ada-mode
    git log -2 -- packages/ada-ref-man
    if changes:
        (dvc-log "/Projects/elpa/packages/<dir>/<file>")
        apply changes to current

check emacs buglist
    http://debbugs.gnu.org/cgi/pkgreport.cgi?package=ada-mode
    to close: control@debbugs.gnu.org
        close nnn 6.0.2

check for latest Emacs release
    http://ftp.gnu.org/gnu/emacs/windows/

run all tests without elpa:
    # must bump version before testing elpa, so package installer can tell the difference.

    build/Makefile elisp

    Windows current Emacs, current gnat
    Windows Emacs 25.3, current gnat
    Debian current Emacs, current gnat
    Debian Emacs 25.3, current gnat

compare:
    build stuff to compare with previous release in elpa:
        build/Makefile pub

    (list-packages)
        install previous ada-mode, wisi, ada-ref-man from public ELPA for diffs
        change versions in compares below to match installed versions.

    (ediff-directories "~/.emacs.d/elpa/wisi-2.0.1" "/Projects/elpa/packages/wisi" nil)
        NEWS-wisi.text
            copyright date
            add release date
            add new features

    (ediff-directories "~/.emacs.d/elpa/ada-mode-6.0.1" "/Projects/elpa/packages/ada-mode" nil)
        NEWS-ada-mode.text
            add release date
            add new features

    (ediff-directories "~/.emacs.d/elpa/ada-ref-man-2012.5" "/Projects/elpa/packages/ada-ref-man" nil)
        /Projects/org.adaic.arm_form/NEWS
            add release date, new features

bump versions
    bump if _any_ changes other than autoloads, so ELPA package handler knows to update
        bump third digit for bug fixes, minor features
        bump second digit for major features
            - GPS indentation engine add/delete
            - partial parse
        bump first digit for really major or user-incompatible changes
            - 5 use parser
            - 6 compute indentation in grammar actions, external parser with error correction

    wisi.el
        Version:

    README-wisi
        first line

    build.sh
        GPR_PROJECT_PATH wisi version

    ada-mode.el
        Version:
        package-requires wisi version
        ada-mode-version

    ada-mode.texi
        @title
        @node top

    README-ada-mode
        first line

    ada-ref-man.el
        Version:

    README-ada-ref-man
        first line

    emacs_wisi_common_parse.ads
        Protocol_Version ; integer; bump if wisi-process-parse would break with old version
        Version          ; ?

    build/Makefile
        run uninstall-elpa with old values before changing!
        ADA_MODE_VERSION
        ADA_REF_MAN_VERSION
        WISI_VERSION

    (find-file "d:/Web/savannah/ada-mode/index.html")
        find-replace i.j.k

    ~/Web/Makefile
        ADA_MODE_VERSION

verify other metadata
    ada-mode.el
    ada-ref-man.el
    wisi.el

prep for elpa tests:
    build/Makefile byte-compile-clean pub
    # pushes to elpa workspace, builds archive

Check copyright on files in published in elpa
    elpa/GNUMakefile check_copyrights
    change to FSF

Emacs 25.3, current gnat
    ~/bin/emacs-25.sh
    (add-to-list 'package-archives (cons "test" "/Projects/elpa/archive/packages"))
    build/Makefile install-elpa
    cd ~/.emacs.d/elpa/ada-mode-6.1.0; ./build.sh
    cd ~/.emacs.d/elpa/wisi-2.1.0; ./build-wisitoken-bnf-generate.sh

    restart Emacs to set load-path

    build/Makefile compile-ada-test autoloads test-clean
    build/Makefile test ADA_MODE_DIR="-f package-initialize"

    build/Makefile uninstall-elpa
    (gpr-query-kill-all-sessions)
    build/Makefile recursive-clean clean # if changing compilers

sync for Debian:
    current Emacs for dvc
    # dvc-state-multiple above
    # not elpa; commit elpa on Debian for file permissions
    $ mtn_sync_ada_france.sh
    (dvc-sync-review ".")

Debian stable is 9.6 jessie as of 18 Nov 2018
    emacs  24.5  - no longer supported by ada-mode
    gnat   6.3.0 - fails on wisitoken

    emacs-stable.sh ;; for dvc and testing

    ~/bin/mtn_sync_ada_france.sh
    (dvc-sync-review "/Projects/org.emacs.ada-mode")

    if new machine, install gnat CE 2018, gnatcoll
        http://libre.adacore.com
        ada-mode.texi

    /Projects/org.emacs.ada-mode/build/Makefile
        pub
        install-elpa

    cd ~/.emacs.d/elpa/ada-mode-6.0.0
    ./build.sh
    cd ../wisi-2.0.0/
    ./build-wisitoken-bnf-generate.sh


    build/Makefile
        compile-ada-test
        test ADA_MODE_DIR="-f package-initialize" WISITOKEN_GENERATE="~/.emacs.d/elpa/wisi-2.0.0/wisitoken-bnf-generate.exe"

    emacs.sh ;; current for dvc
    (dvc-status)
    (dvc-sync-run "/home/Projects/org.emacs.ada-mode")
    (dvc-sync-review "/home/Projects/org.emacs.ada-mode")

on Debian, check file permissions (ie exe bit) in elpa

$ mtn_sync_ada_france.sh
(dvc-sync-review ".")

commit elpa:
    (dvc-pull "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")

    build/Makefile docs pub-ada pub-ada-ref-man pub-wisi

    (dvc-state-one "/Projects/elpa")
        add, stage, commit ada-mode, ada-ref-man, wisi

    (dvc-push "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")
    # 24 hrs for web repository to update

after Gnu ELPA updated, test install from GNU ELPA
    5.1.8 crashed emacs for me

check for bogus execute permissions in elpa
    on Debian
    (dvc-pull "elpa")
    $ ls -r -l | grep rwx
    $ chmod -x *.el *.adb
    # keep execute on build.sh

(dvc-state-one ".")
mtn tag h:org.emacs.ada-mode org.emacs.ada-mode-<version>

~/bin/mtn_sync_ada_france.sh

build/Makefile zip

in cygwin console for gpg2 prompts:
    cd /Projects/org.emacs.ada-mode/build/
    ls *.tar*
    rm <old>.tar*
    gpg2 -b *.tar.bz2

    scp *.tar.bz2* stephen_leake@dl.sv.nongnu.org:/releases/ada-mode/

~/Web/Makefile
    # no 'sync' here; all on savannah
    ada-mode

(cvs-examine "d:/Web/savannah/ada-mode/" nil)
    mark all, commit

    takes ~ 10 min for http://www.nongnu.org/ada-mode/ to reflect cvs commit

post on emacs-ada-mode mailing list, c.l.a newsgroup:

Gnu Emacs Ada mode 6.0.1 released.

Gnu Emacs Ada mode 6.0.1 is now available in GNU ELPA. This is a minor
packaging bug release; the file ada_lr1_parse_table.txt, which is 41MB
uncompressed, is now compressed (to 2.9MB), so it takes much less time
to download in 'list-packages'. In addition, copyright on all the Ada
code is now Free Software Foundation.

If you are using this new ada-mode, please try the 'process' parser,
which provides syntax error correction. This requires compiling:

cd ~/.emacs.d/elpa/ada-mode-6.0.1
./build.sh

This requires AdaCore gnatcoll packages which you may not have
installed; see ada-mode.info Installation for help in installing them.

When you've tried the process parser, let me know, in this forum.

mark fixed bugs
    http://debbugs.gnu.org/cgi/pkgreport.cgi?package=ada-mode
    http://debbugs.gnu.org/Developer.html

check https://www.emacswiki.org/emacs/AdaMode
    https://www.emacswiki.org/emacs/StephenLeake

 mini-release to Ludovic
run all tests

bump version (elpa releases don't have to be consecutive)

Makefile build-elpa install-elpa elpa-zip
    # install-elpa verifies all required files are included and byte-compile successfully.

-- end of file
