Marpa

Changes On Branch mistake
Login
Tcl 2016 Conference, Houston/TX, US, Nov 14-18
Send your abstracts to tclconference@googlegroups.com by Sep 12.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch example-test-integration Excluding Merge-Ins

This is equivalent to a diff from 7dbbfd79f5 to 67d5a8317b

2018-09-07
23:12
Integrated the language example tests into the main. Added the language example parsers to the `remeta` tool to ensure that they are updated after runtime API changes too, not just the system parsers. Dropped the replicated support files, redirected test suites to the main support as the only support. Note: The json example has issues, major testsuite fail. Bisect where this started and fix. - Looks to be lexeme location information differences between rtC and rtTcl. - Might be fixed in the parse-event branch. Leaf check-in: 67d5a8317b user: andreask tags: mistake, example-test-integration
19:05
Fixed handling of `args` parameter in wrong#args error messages. The text is dependent on core version. -- There is more going on -- Critcl differences, Core differences -- Try later again -- Closed-Leaf check-in: 7dbbfd79f5 user: andreask tags: mistake
04:42
The code generating symbol names for literals was still subject on the exact content of the [:control:] charclass, causing differences in output depending on the version of Tcl used (seen between 8.5.18 and 8.5.19). Now ensured version-independent quoting in all the relevant places. Fixed order of conditions too. Cross-referenced these places. Regenerated the internal parsers (slif, literals). Updated tests. check-in: e71840b49a user: aku tags: trunk

Changes to bootstrap/remeta.

1
2
3
4
5
6
7
8
9




10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32



33

34
35







36
37
38
39


40
41
42
43
44
45
46
47
#!/usr/bin/env tclsh
# -*- tcl -*- tcl.tk//DSL tcltest//EN//2.0 tcl.tk//DSL tcltest//EN//2.0
##
# (c) 2017-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                  http://core.tcl.tk/akupries/
#
# # ## ### ##### ######## ############# #####################
## Regenerate the SLIF boot parser
## Regenerate the LITERAL parser





package require Tcl 8.5
package require marpa::slif::parser
package require marpa::slif::container
package require marpa::slif::semantics
package require marpa::gen
package require marpa::gen::format::cparse-critcl

package require fileutil

#debug on util/benchmarking

if {[llength $argv] > 1} {
    puts "Usage: $argv0 ?/path/to/main/destination/directory?"
    puts "Results are written to:"
    puts " - DST/slif-parser/parser.tcl"
    puts " - DST/slif-literal/lparser.tcl"

    puts ""
    exit 1
}

# Default: Current working directory.
if {![llength $argv]} { lappend argv [pwd] }




set selfdir  [file dirname [file normalize [info script]]]

set meta     [file join $selfdir marpa-tcl-slif slif]
set literals [file join $selfdir marpa-tcl-slif literals]







set dst      [lindex $argv 0]

proc F {n} { format "%.2f" $n }



proc Make {name src dst authors} {
    # _ __ ___ _____ ________ _____________ _____________________
    # Process the grammar
    set sz [file size $src]
    puts "Processing $src ($sz bytes) ..."
    marpa::slif::container create GC
    marpa::slif::semantics create SEMA GC
    marpa::slif::parser    create BOOT









>
>
>
>







>









>







>
>
>

>


>
>
>
>
>
>
>




>
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env tclsh
# -*- tcl -*- tcl.tk//DSL tcltest//EN//2.0 tcl.tk//DSL tcltest//EN//2.0
##
# (c) 2017-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                  http://core.tcl.tk/akupries/
#
# # ## ### ##### ######## ############# #####################
## Regenerate the SLIF boot parser
## Regenerate the LITERAL parser
## Regenerate the example language parsers
## - json
## - heredoc
## - min-dt

package require Tcl 8.5
package require marpa::slif::parser
package require marpa::slif::container
package require marpa::slif::semantics
package require marpa::gen
package require marpa::gen::format::cparse-critcl
package require marpa::gen::format::tparse
package require fileutil

#debug on util/benchmarking

if {[llength $argv] > 1} {
    puts "Usage: $argv0 ?/path/to/main/destination/directory?"
    puts "Results are written to:"
    puts " - DST/slif-parser/parser.tcl"
    puts " - DST/slif-literal/lparser.tcl"
    puts " - DST/languages/*/*-{c,tcl}.tcl"
    puts ""
    exit 1
}

# Default: Current working directory.
if {![llength $argv]} { lappend argv [pwd] }

set a  {Andreas Kupries}
set ja {Jeffrey Kegler + Andreas Kupries}

set selfdir  [file dirname [file normalize [info script]]]
set topdir   [file dirname $selfdir]
set meta     [file join $selfdir marpa-tcl-slif slif]
set literals [file join $selfdir marpa-tcl-slif literals]

set lang     [file join $topdir languages]
set json     [file join $lang json    g json.slif]
set heredoc  [file join $lang heredoc g heredoc.slif]
set mindt    [file join $lang min-dt  g min-dt.slif]
set mindtsf  [file join $lang min-dt  g sf.slif]

set dst      [lindex $argv 0]

proc F {n} { format "%.2f" $n }

proc Make {authors name src dst {format cparse-critcl}} {
    file mkdir [file dirname $dst]

    # _ __ ___ _____ ________ _____________ _____________________
    # Process the grammar
    set sz [file size $src]
    puts "Processing $src ($sz bytes) ..."
    marpa::slif::container create GC
    marpa::slif::semantics create SEMA GC
    marpa::slif::parser    create BOOT
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

86
87


88
89
90

91


92
93

94


95


96


97
98
    puts "Generating ..."
    marpa::gen config! version  0
    marpa::gen config! writer   $authors
    marpa::gen config! year     [clock format [clock seconds] -format %Y]
    marpa::gen config! name     $name
    marpa::gen config! operator $::tcl_platform(user)@[info hostname]
    marpa::gen config! tool     [file tail [info script]]
    set parser [marpa::gen::format::cparse-critcl container GC]
    GC destroy

    # _ __ ___ _____ ________ _____________ _____________________
    # Write to file for debugging.
    puts "Saving to $dst ..."
    fileutil::writeFile $dst $parser

    puts {... OK}
    return
}

# _ __ ___ _____ ________ _____________ _____________________
# Process the slif meta grammar


file mkdir $dst/slif-parser $dst/slif-literal-parser



Make marpa::slif::parser \
    $meta \
    $dst/slif-parser/parser.tcl \

    {Jeffrey Kegler + Andreas Kupries}



Make marpa::slif::literal::parser \

    $literals \


    $dst/slif-literal/lparser.tcl \


    {Andreas Kupries}



exit







|












|

>
|

>
>
|
<
|
>
|
>
>

|
>
|
>
>
|
>
>
|
>
>


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
    puts "Generating ..."
    marpa::gen config! version  0
    marpa::gen config! writer   $authors
    marpa::gen config! year     [clock format [clock seconds] -format %Y]
    marpa::gen config! name     $name
    marpa::gen config! operator $::tcl_platform(user)@[info hostname]
    marpa::gen config! tool     [file tail [info script]]
    set parser [marpa::gen::format::$format container GC]
    GC destroy

    # _ __ ___ _____ ________ _____________ _____________________
    # Write to file for debugging.
    puts "Saving to $dst ..."
    fileutil::writeFile $dst $parser

    puts {... OK}
    return
}

# _ __ ___ _____ ________ _____________ _____________________
# Process the slif grammars (meta & literal)

Make $ja marpa::slif::parser          $meta     $dst/slif-parser/parser.tcl
Make $a  marpa::slif::literal::parser $literals $dst/slif-literal/lparser.tcl

# _ __ ___ _____ ________ _____________ _____________________
# Process the example json grammar


Make $a json::parser::c   $json $dst/languages/json/json-c.tcl
Make $a json::parser::tcl $json $dst/languages/json/json-tcl.tcl tparse

# _ __ ___ _____ ________ _____________ _____________________
# Process the example heredoc grammar

Make $a heredoc::parser::c   $heredoc $dst/languages/heredoc/heredoc-c.tcl
Make $a heredoc::parser::tcl $heredoc $dst/languages/heredoc/heredoc-tcl.tcl tparse

# _ __ ___ _____ ________ _____________ _____________________
# Process the example min-dt grammars

Make $a mindt::parser::c   $mindt $dst/languages/min-dt/mindt-lang-c.tcl
Make $a mindt::parser::tcl $mindt $dst/languages/min-dt/mindt-lang-tcl.tcl tparse

Make $a mindt::parser::sf::c   $mindtsf $dst/languages/min-dt/mindt-sf-c.tcl
Make $a mindt::parser::sf::tcl $mindtsf $dst/languages/min-dt/mindt-sf-tcl.tcl tparse

exit

Changes to languages/heredoc/heredoc-c.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar heredoc::parser::c 1 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "heredoc::parser::c".
##	Generated On Wed Aug 08 12:05:14 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen
##
#* Space taken: 5704 bytes
##
#* Statistics
#* L0
#* - #Symbols:   276
#* - #Lexemes:   5
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 22 (+2: setup, start-sym)
#* - #Rules:     73 (>= insn, brange)
#* G1
#* - #Symbols:   11
#* - #Rule Insn: 7 (+2: setup, start-sym)
#* - #Rules:     7 (match insn)

package provide heredoc::parser::c 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1







|


|
|
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar heredoc::parser::c 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "heredoc::parser::c".
##	Generated On Fri Sep 07 15:24:33 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 5704 bytes
##
#* Statistics
#* L0
#* - #Symbols:   276
#* - #Lexemes:   5
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 22 (+2: setup, start-sym)
#* - #Rules:     73 (>= insn, brange)
#* G1
#* - #Symbols:   11
#* - #Rule Insn: 7 (+2: setup, start-sym)
#* - #Rules:     7 (match insn)

package provide heredoc::parser::c 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1

686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723

724
725
726
727
728
729
730
731
732
733
734
735
736



















737
738
739
740
741
742
743
	/* Post body. Save the FQN for use in the callbacks */
	instance->ehstate.self = fqn;
        Tcl_IncrRefCount (fqn);
        instance->name = Tcl_NewStringObj (Tcl_GetCommandName (interp, instance->cmd), -1);
        Tcl_IncrRefCount (instance->name);
    }

    method process-file proc {Tcl_Interp* ip Tcl_Obj* path object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }

	int res, got;
	char* buf;
	Tcl_Channel in = Tcl_FSOpenFileChannel (ip, path, "r", 0666);

	if (!in) {
	    return TCL_ERROR;
	}
	Tcl_SetChannelBufferSize (in, 4096);
	Tcl_SetChannelOption (ip, in, "-translation", "binary");
	Tcl_SetChannelOption (ip, in, "-encoding",    "utf-8");
	// TODO: abort on failed set-channel-option

	Tcl_Obj* cbuf = Tcl_NewObj();
	Tcl_Obj* ebuf = Tcl_NewObj();
	while (!Tcl_Eof(in)) {
	    got = Tcl_ReadChars (in, cbuf, 4096, 0);
	    if (got < 0) {
		Tcl_DecrRefCount (cbuf);
		Tcl_DecrRefCount (ebuf);
		return TCL_ERROR;
	    }
	    if (!got) continue; /* Pass the buck to next Tcl_Eof */
	    Tcl_AppendObjToObj (ebuf, cbuf);
	}
	Tcl_DecrRefCount (cbuf);
	(void) Tcl_Close (ip, in);


	buf = Tcl_GetStringFromObj (ebuf, &got);
	marpatcl_rtc_enter (instance->state, buf, got, from, to);
	Tcl_DecrRefCount (ebuf);

	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method process proc {Tcl_Interp* ip pstring string object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }
	marpatcl_rtc_enter (instance->state, string.s, string.len, from, to);
	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }




















    support {
	/*
	** Stem:  @stem@
	** Pkg:   @package@
	** Class: @class@
	** IType: @instancetype@







|



<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
|
|
<
<
|
<
<

>
|












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







686
687
688
689
690
691
692
693
694
695
696













697


698


699
700


701


702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
	/* Post body. Save the FQN for use in the callbacks */
	instance->ehstate.self = fqn;
        Tcl_IncrRefCount (fqn);
        instance->name = Tcl_NewStringObj (Tcl_GetCommandName (interp, instance->cmd), -1);
        Tcl_IncrRefCount (instance->name);
    }

    method process-file proc {Tcl_Interp* ip object path object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }














	Tcl_Obj* ebuf;


	if (marpatcl_rtc_fget (ip, instance->state, path, &ebuf) != TCL_OK) {


	    return TCL_ERROR;
	}






	int got;
	char* buf = Tcl_GetStringFromObj (ebuf, &got);
	marpatcl_rtc_enter (instance->state, buf, got, from, to);
	Tcl_DecrRefCount (ebuf);

	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method process proc {Tcl_Interp* ip pstring string object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }
	marpatcl_rtc_enter (instance->state, string.s, string.len, from, to);
	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method extend proc {Tcl_Interp* ip pstring string} int {
	return marpatcl_rtc_enter_more (instance->state, string.s, string.len);
    }

    method extend-file proc {Tcl_Interp* ip object path} ok {
	Tcl_Obj* ebuf;
	if (marpatcl_rtc_fget (ip, instance->state, path, &ebuf) != TCL_OK) {
	    return TCL_ERROR;
	}

	int got;
	char* buf = Tcl_GetStringFromObj (ebuf, &got);
	int offset = marpatcl_rtc_enter_more (instance->state, buf, got);
	Tcl_DecrRefCount (ebuf);

	Tcl_SetObjResult (ip, Tcl_NewIntObj (offset));
	return TCL_OK;
    }

    support {
	/*
	** Stem:  @stem@
	** Pkg:   @package@
	** Class: @class@
	** IType: @instancetype@

Changes to languages/heredoc/heredoc-tcl.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar heredoc::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "heredoc::parser::tcl".
##	Generated On Wed Aug 08 12:05:14 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen

package provide heredoc::parser::tcl 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing









|
|
|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar heredoc::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "heredoc::parser::tcl".
##	Generated On Fri Sep 07 15:24:33 PDT 2018
##		  By andreask@ten
##		 Via remeta

package provide heredoc::parser::tcl 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing

Changes to languages/heredoc/tests/common/hd-core.testsuite.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source support/ast.tcl
kt source support/dirs.tcl
kt source support/textutils.tcl

# # ## ### ##### ######## ############# #####################
## (xx)

kt local testing heredoc::parser
kt local support [cl]








|
|
|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source ../../../tests/support/ast.tcl
kt source ../../../tests/support/dirs.tcl
kt source ../../../tests/support/textutils.tcl

# # ## ### ##### ######## ############# #####################
## (xx)

kt local testing heredoc::parser
kt local support [cl]

Deleted languages/heredoc/tests/support/ast.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support marpa::util

# Test suite support.
# # ## ### ##### ######## #############
## Pretty printing an AST coming out of the SLIF parser

proc ast-format {ast {step {  }}} {
    set lines {}
    ast-format-acc $ast {} $step
    return [join $lines \n]
}

proc ast-format-acc {ast indent step} {
    upvar 1 lines lines

    if {[string is integer [lindex $ast 0]]} {
	# Terminal, Data is offset, length, and lexeme value.
	lappend lines ${indent}@[marpa location show $ast]
	return
    }

    lassign $ast symbol children

    lappend lines $indent$symbol
    append indent $step
    foreach child $children {
	ast-format-acc $child $indent $step
    }
    return
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































Deleted languages/heredoc/tests/support/dirs.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- tcl -*-
##
# (c) 2018-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

# Test suite support.
# # ## ### ##### ######## #############
## Quick access to common directories of the testsuite.

proc td {} {
    return [file normalize $::tcltest::testsDirectory]
}

proc indir {args} {
    return [file normalize [file join [td] input {*}$args]]
}

proc redir {args} {
    return [file normalize [file join [td] result {*}$args]]
}

proc locate {base args} {
    foreach file $args {
	set path [file join $base $file]
	if {![file exists $path]} continue
	return $path
    }
    return -code error "Unable to find any of [join $args {, }] for $base"
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































Deleted languages/heredoc/tests/support/textutils.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support fileutil

# Test suite support.
# # ## ### ##### ######## #############

proc fget  {path}     { fileutil::cat $path }
proc fgetc {path enc} { fileutil::cat -encoding $enc $path }

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































Changes to languages/json/json-c.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017 Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                     http://core.tcl.tk/akupries/
##
# (c) 2018-present Grammar json::parser::c 1 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "json::parser::c".
##	Generated On Tue Mar 20 20:43:56 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen
##
#* Space taken: 4899 bytes
##
#* Statistics
#* L0
#* - #Symbols:   318
#* - #Lexemes:   12
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 89 (+2: setup, start-sym)
#* - #Rules:     344 (>= insn, brange)
#* G1
#* - #Symbols:   24
#* - #Rule Insn: 18 (+2: setup, start-sym)
#* - #Rules:     18 (match insn)

package provide json::parser::c 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1

critcl::buildrequirement {
    package require critcl::class
    package require critcl::cutil
}

if {![critcl::compiling]} {
    error "Unable to build json::parser::c, no compiler found."



|
|

|


|
|
|

|














|






>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar json::parser::c 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "json::parser::c".
##	Generated On Fri Sep 07 15:24:32 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 4903 bytes
##
#* Statistics
#* L0
#* - #Symbols:   318
#* - #Lexemes:   12
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 89 (+2: setup, start-sym)
#* - #Rules:     344 (>= insn, brange)
#* G1
#* - #Symbols:   24
#* - #Rule Insn: 18 (+2: setup, start-sym)
#* - #Rules:     18 (match insn)

package provide json::parser::c 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1

critcl::buildrequirement {
    package require critcl::class
    package require critcl::cutil
}

if {![critcl::compiling]} {
    error "Unable to build json::parser::c, no compiler found."
50
51
52
53
54
55
56

57
58
59
60
61
62
63
#critcl::debug memory
#critcl::debug symbols memory

# # ## ### ##### ######## ############# #####################
## Requirements

critcl::api import marpa::runtime::c 0


# # ## ### ##### ######## ############# #####################
## Static data structures declaring the grammar

critcl::ccode {
    /*
    ** Shared string pool (626 bytes lengths over 313 entries)







>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#critcl::debug memory
#critcl::debug symbols memory

# # ## ### ##### ######## ############# #####################
## Requirements

critcl::api import marpa::runtime::c 0
critcl::api import critcl::callback  1

# # ## ### ##### ######## ############# #####################
## Static data structures declaring the grammar

critcl::ccode {
    /*
    ** Shared string pool (626 bytes lengths over 313 entries)
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
	/* --- (1) --- --- --- Discard
	 */
	303,

	/* --- (36) --- --- --- Internal
	 */
	 33,  39,  35,  43,  47,  32,  55, 198, 272, 295, 183, 188, 189, 190, 192, 195,
	199, 204, 254, 281, 282, 304,  29,  30,  34,  36,  37,  44,  38,  40,  41,  42,
	 45,  46,  31,  28
    };

    static marpatcl_rtc_sym json_parser_c_l0_rule_definitions [261] = { /* 522 bytes */
	MARPATCL_RCMD_SETUP (6),
	MARPATCL_RCMD_PRIO  (1), 269, 58,                           /* <colon>                 ::= <@CHR:<:>> */
	MARPATCL_RCMD_PRIO  (1), 270, 44,                           /* <comma>                 ::= <@CHR:<,>> */







|







470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
	/* --- (1) --- --- --- Discard
	 */
	303,

	/* --- (36) --- --- --- Internal
	 */
	 33,  39,  35,  43,  47,  32,  55, 198, 272, 295, 183, 188, 189, 190, 192, 195,
	199, 204, 254, 281, 282, 304,  29,  30,  34,  36,  37,  38,  40,  41,  42,  44,
	 45,  46,  31,  28
    };

    static marpatcl_rtc_sym json_parser_c_l0_rule_definitions [261] = { /* 522 bytes */
	MARPATCL_RCMD_SETUP (6),
	MARPATCL_RCMD_PRIO  (1), 269, 58,                           /* <colon>                 ::= <@CHR:<:>> */
	MARPATCL_RCMD_PRIO  (1), 270, 44,                           /* <comma>                 ::= <@CHR:<,>> */
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
	MARPATCL_RCMD_PRIO  (1), 278, 34,                           /* <quote>                 ::= <@BYTE:<\42>> */
	MARPATCL_RCMD_PRIO  (1), 279, 125,                          /* <rbrace>                ::= <@CHR:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 280, 93,                           /* <rbracket>              ::= <@CHR:<\135>> */
	MARPATCL_RCMD_QUP   (281), 285,                             /* <whitespace>            ::= <@CLS:<\t-\n\r\40>> + */
	MARPATCL_RCMD_PRIO  (1), 282, 306,                          /* <@^CLS:<\0-\37\42\134>> ::= <@BRAN:<\40!>> */
	MARPATCL_RCMD_PRIS  (1)     , 304,                          /*                         |   <@BRAN:<#\133>> */
	MARPATCL_RCMD_PRIS  (1)     , 307,                          /*                         |   <@BRAN:<\135\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 312, 308,                     /*                         |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 283, 308,                /*                         |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 313, 308, 308,                /*                         |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 310, 308, 237, 311, 308, /*                         |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 283, 310,                          /* <@BRAN:<\u00a0\u00bf>>  ::= <@BRAN:<\u00a0\u00af>> */
	MARPATCL_RCMD_PRIS  (1)     , 311,                          /*                         |   <@BRAN:<\u00b0\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 284, 34,                           /* <@CLS:<\42/\134bfnrt>>  ::= <@BYTE:<\42>> */
	MARPATCL_RCMD_PRIS  (1)     , 47,                           /*                         |   <@BYTE:</>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                           /*                         |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 98,                           /*                         |   <@BYTE:<b>> */
	MARPATCL_RCMD_PRIS  (1)     , 102,                          /*                         |   <@BYTE:<f>> */
	MARPATCL_RCMD_PRIS  (1)     , 110,                          /*                         |   <@BYTE:<n>> */
	MARPATCL_RCMD_PRIS  (1)     , 114,                          /*                         |   <@BYTE:<r>> */
	MARPATCL_RCMD_PRIS  (1)     , 116,                          /*                         |   <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 285, 309,                          /* <@CLS:<\t-\n\r\40>>     ::= <@BRAN:<\t\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                           /*                         |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                           /*                         |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (1), 286, 69,                           /* <@CLS:<Ee>>             ::= <@BYTE:<E>> */
	MARPATCL_RCMD_PRIS  (1)     , 101,                          /*                         |   <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (1), 287, 305,                          /* <@NCC:<[:xdigit:]>>     ::= <@BRAN:<09>> */
	MARPATCL_RCMD_PRIS  (1)     , 314,                          /*                         |   <@BRAN:<AF>> */
	MARPATCL_RCMD_PRIS  (1)     , 315,                          /*                         |   <@BRAN:<af>> */







|
|
|
|
|
|








|







495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
	MARPATCL_RCMD_PRIO  (1), 278, 34,                           /* <quote>                 ::= <@BYTE:<\42>> */
	MARPATCL_RCMD_PRIO  (1), 279, 125,                          /* <rbrace>                ::= <@CHR:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 280, 93,                           /* <rbracket>              ::= <@CHR:<\135>> */
	MARPATCL_RCMD_QUP   (281), 285,                             /* <whitespace>            ::= <@CLS:<\t-\n\r\40>> + */
	MARPATCL_RCMD_PRIO  (1), 282, 306,                          /* <@^CLS:<\0-\37\42\134>> ::= <@BRAN:<\40!>> */
	MARPATCL_RCMD_PRIS  (1)     , 304,                          /*                         |   <@BRAN:<#\133>> */
	MARPATCL_RCMD_PRIS  (1)     , 307,                          /*                         |   <@BRAN:<\135\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 311, 308,                     /*                         |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 283, 308,                /*                         |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 312, 308, 308,                /*                         |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 309, 308, 237, 310, 308, /*                         |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (1), 283, 309,                          /* <@BRAN:<\240\277>>      ::= <@BRAN:<\240\257>> */
	MARPATCL_RCMD_PRIS  (1)     , 310,                          /*                         |   <@BRAN:<\260\277>> */
	MARPATCL_RCMD_PRIO  (1), 284, 34,                           /* <@CLS:<\42/\134bfnrt>>  ::= <@BYTE:<\42>> */
	MARPATCL_RCMD_PRIS  (1)     , 47,                           /*                         |   <@BYTE:</>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                           /*                         |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 98,                           /*                         |   <@BYTE:<b>> */
	MARPATCL_RCMD_PRIS  (1)     , 102,                          /*                         |   <@BYTE:<f>> */
	MARPATCL_RCMD_PRIS  (1)     , 110,                          /*                         |   <@BYTE:<n>> */
	MARPATCL_RCMD_PRIS  (1)     , 114,                          /*                         |   <@BYTE:<r>> */
	MARPATCL_RCMD_PRIS  (1)     , 116,                          /*                         |   <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 285, 313,                          /* <@CLS:<\t-\n\r\40>>     ::= <@BRAN:<\t\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                           /*                         |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                           /*                         |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (1), 286, 69,                           /* <@CLS:<Ee>>             ::= <@BYTE:<E>> */
	MARPATCL_RCMD_PRIS  (1)     , 101,                          /*                         |   <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (1), 287, 305,                          /* <@NCC:<[:xdigit:]>>     ::= <@BRAN:<09>> */
	MARPATCL_RCMD_PRIS  (1)     , 314,                          /*                         |   <@BRAN:<AF>> */
	MARPATCL_RCMD_PRIS  (1)     , 315,                          /*                         |   <@BRAN:<af>> */
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
	MARPATCL_RCMD_PRIO  (2), 302, 316, 295,                     /* <positive>              ::= <@RAN:<19>> <digitz> */
	MARPATCL_RCMD_PRIO  (1), 303, 48,                           /* <whole>                 ::= <@CHR:<0>> */
	MARPATCL_RCMD_PRIS  (1)     , 302,                          /*                         |   <positive> */
	MARPATCL_RCMD_BRAN  (304), MARPATCL_RCMD_BOXR ( 35, 91),    /* <@BRAN:<#\133>>         brange (35 - 91) */
	MARPATCL_RCMD_BRAN  (305), MARPATCL_RCMD_BOXR ( 48, 57),    /* <@BRAN:<09>>            brange (48 - 57) */
	MARPATCL_RCMD_BRAN  (306), MARPATCL_RCMD_BOXR ( 32, 33),    /* <@BRAN:<\40!>>          brange (32 - 33) */
	MARPATCL_RCMD_BRAN  (307), MARPATCL_RCMD_BOXR ( 93,127),    /* <@BRAN:<\135\177>>      brange (93 - 127) */
	MARPATCL_RCMD_BRAN  (308), MARPATCL_RCMD_BOXR (128,191),    /* <@BRAN:<\200\u00bf>>    brange (128 - 191) */
	MARPATCL_RCMD_BRAN  (309), MARPATCL_RCMD_BOXR (  9, 10),    /* <@BRAN:<\t\n>>          brange (9 - 10) */
	MARPATCL_RCMD_BRAN  (310), MARPATCL_RCMD_BOXR (160,175),    /* <@BRAN:<\u00a0\u00af>>  brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (311), MARPATCL_RCMD_BOXR (176,191),    /* <@BRAN:<\u00b0\u00bf>>  brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (312), MARPATCL_RCMD_BOXR (194,223),    /* <@BRAN:<\u00c2\u00df>>  brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (313), MARPATCL_RCMD_BOXR (225,239),    /* <@BRAN:<\u00e1\u00ef>>  brange (225 - 239) */
	MARPATCL_RCMD_BRAN  (314), MARPATCL_RCMD_BOXR ( 65, 70),    /* <@BRAN:<AF>>            brange (65 - 70) */
	MARPATCL_RCMD_BRAN  (315), MARPATCL_RCMD_BOXR ( 97,102),    /* <@BRAN:<af>>            brange (97 - 102) */
	MARPATCL_RCMD_BRAN  (316), MARPATCL_RCMD_BOXR ( 49, 57),    /* <@RAN:<19>>             brange (49 - 57) */
	MARPATCL_RCMD_PRIO  (2), 317, 256, 269,                     /* <@L0:START>             ::= <@ACS:colon> <colon> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 270,                     /*                         |   <@ACS:comma> <comma> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 271,                     /*                         |   <@ACS:lbrace> <lbrace> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 272,                     /*                         |   <@ACS:lbracket> <lbracket> */







|
|
|
|
|
|







543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
	MARPATCL_RCMD_PRIO  (2), 302, 316, 295,                     /* <positive>              ::= <@RAN:<19>> <digitz> */
	MARPATCL_RCMD_PRIO  (1), 303, 48,                           /* <whole>                 ::= <@CHR:<0>> */
	MARPATCL_RCMD_PRIS  (1)     , 302,                          /*                         |   <positive> */
	MARPATCL_RCMD_BRAN  (304), MARPATCL_RCMD_BOXR ( 35, 91),    /* <@BRAN:<#\133>>         brange (35 - 91) */
	MARPATCL_RCMD_BRAN  (305), MARPATCL_RCMD_BOXR ( 48, 57),    /* <@BRAN:<09>>            brange (48 - 57) */
	MARPATCL_RCMD_BRAN  (306), MARPATCL_RCMD_BOXR ( 32, 33),    /* <@BRAN:<\40!>>          brange (32 - 33) */
	MARPATCL_RCMD_BRAN  (307), MARPATCL_RCMD_BOXR ( 93,127),    /* <@BRAN:<\135\177>>      brange (93 - 127) */
	MARPATCL_RCMD_BRAN  (308), MARPATCL_RCMD_BOXR (128,191),    /* <@BRAN:<\200\277>>      brange (128 - 191) */
	MARPATCL_RCMD_BRAN  (309), MARPATCL_RCMD_BOXR (160,175),    /* <@BRAN:<\240\257>>      brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (310), MARPATCL_RCMD_BOXR (176,191),    /* <@BRAN:<\260\277>>      brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (311), MARPATCL_RCMD_BOXR (194,223),    /* <@BRAN:<\302\337>>      brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (312), MARPATCL_RCMD_BOXR (225,239),    /* <@BRAN:<\341\357>>      brange (225 - 239) */
	MARPATCL_RCMD_BRAN  (313), MARPATCL_RCMD_BOXR (  9, 10),    /* <@BRAN:<\t\n>>          brange (9 - 10) */
	MARPATCL_RCMD_BRAN  (314), MARPATCL_RCMD_BOXR ( 65, 70),    /* <@BRAN:<AF>>            brange (65 - 70) */
	MARPATCL_RCMD_BRAN  (315), MARPATCL_RCMD_BOXR ( 97,102),    /* <@BRAN:<af>>            brange (97 - 102) */
	MARPATCL_RCMD_BRAN  (316), MARPATCL_RCMD_BOXR ( 49, 57),    /* <@RAN:<19>>             brange (49 - 57) */
	MARPATCL_RCMD_PRIO  (2), 317, 256, 269,                     /* <@L0:START>             ::= <@ACS:colon> <colon> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 270,                     /*                         |   <@ACS:comma> <comma> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 271,                     /*                         |   <@ACS:lbrace> <lbrace> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 272,                     /*                         |   <@ACS:lbracket> <lbracket> */
572
573
574
575
576
577
578
579

580
581
582
583
584
585
586

    static marpatcl_rtc_rules json_parser_c_l0 = { /* 48 */
	/* .sname   */  &json_parser_c_pool,
	/* .symbols */  { 318, json_parser_c_l0_sym_name },
	/* .rules   */  { 0, NULL },
	/* .lhs     */  { 0, NULL },
	/* .rcode   */  json_parser_c_l0_rule_definitions,
	0

    };

    static marpatcl_rtc_sym json_parser_c_l0semantics [3] = { /* 6 bytes */
	 MARPATCL_SV_START, MARPATCL_SV_LENGTH,  MARPATCL_SV_VALUE
    };

    /*







<
>







574
575
576
577
578
579
580

581
582
583
584
585
586
587
588

    static marpatcl_rtc_rules json_parser_c_l0 = { /* 48 */
	/* .sname   */  &json_parser_c_pool,
	/* .symbols */  { 318, json_parser_c_l0_sym_name },
	/* .rules   */  { 0, NULL },
	/* .lhs     */  { 0, NULL },
	/* .rcode   */  json_parser_c_l0_rule_definitions,

	/* .events  */  0
    };

    static marpatcl_rtc_sym json_parser_c_l0semantics [3] = { /* 6 bytes */
	 MARPATCL_SV_START, MARPATCL_SV_LENGTH,  MARPATCL_SV_VALUE
    };

    /*
632
633
634
635
636
637
638
639

640
641
642
643
644
645
646

    static marpatcl_rtc_rules json_parser_c_g1 = { /* 48 */
	/* .sname   */  &json_parser_c_pool,
	/* .symbols */  { 24, json_parser_c_g1_sym_name },
	/* .rules   */  { 18, json_parser_c_g1_rule_name },
	/* .lhs     */  { 18, json_parser_c_g1_rule_lhs },
	/* .rcode   */  json_parser_c_g1_rule_definitions,
	0

    };

    static marpatcl_rtc_sym json_parser_c_g1semantics [4] = { /* 8 bytes */
	/* --- (1) --- --- --- Tag
	 */
	MARPATCL_S_SINGLE,








<
>







634
635
636
637
638
639
640

641
642
643
644
645
646
647
648

    static marpatcl_rtc_rules json_parser_c_g1 = { /* 48 */
	/* .sname   */  &json_parser_c_pool,
	/* .symbols */  { 24, json_parser_c_g1_sym_name },
	/* .rules   */  { 18, json_parser_c_g1_rule_name },
	/* .lhs     */  { 18, json_parser_c_g1_rule_lhs },
	/* .rcode   */  json_parser_c_g1_rule_definitions,

	/* .events  */  0
    };

    static marpatcl_rtc_sym json_parser_c_g1semantics [4] = { /* 8 bytes */
	/* --- (1) --- --- --- Tag
	 */
	MARPATCL_S_SINGLE,

688
689
690
691
692
693
694

695
696
697
698
699
700
701
702



703
704
705
706
707
708
709
710
711
712








































713
714
715
716
717
718
719
720
721
722
723
724
725





726

727
728

729
730
731
732
733
734
735
736




737


738





739
740



741


742
743
744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762

763
764
765
766
767
768




769
770
771
772
773
774
775
    /* --- end of generated data structures --- */
}

# # ## ### ##### ######## ############# #####################
## Class exposing the grammar engine.

critcl::class def json::parser::c {

    insvariable marpatcl_rtc_sv_p result {
	Parse result
    } {
	instance->result = 0;
    } {
	if (instance->result) marpatcl_rtc_sv_unref (instance->result);
    }




    insvariable marpatcl_rtc_p state {
	C-level engine, RTC structures.
    } {
	instance->state = marpatcl_rtc_cons (&json_parser_c_spec,
					     NULL /* actions - TODO FUTURE */,
					     @stem@_result, (void*) instance,
					     0, 0 );
    } {
	marpatcl_rtc_destroy (instance->state);
    }









































    constructor {
        /*
	 * Syntax:                          ... []
         * skip == 2: <class> new           ...
         *      == 3: <class> create <name> ...
         */

	if (objc > 0) {
	    Tcl_WrongNumArgs (interp, objcskip, objv-objcskip, 0);
	    goto error;
	}
    } {}







    method process-file proc {Tcl_Interp* ip Tcl_Obj* path} ok {
	int res, got;

	char* buf;
	Tcl_Obj* cbuf = Tcl_NewObj();
	Tcl_Channel in = Tcl_FSOpenFileChannel (ip, path, "r", 0666);
	if (!in) {
	    return TCL_ERROR;
	}
	Tcl_SetChannelBufferSize (in, 4096);
	Tcl_SetChannelOption (ip, in, "-translation", "binary");




	Tcl_SetChannelOption (ip, in, "-encoding",    "utf-8");


	// TODO: abort on failed set-channel-option






	while (!Tcl_Eof(in)) {



	    got = Tcl_ReadChars (in, cbuf, 4096, 0);


	    if (got < 0) {
		return TCL_ERROR;
	    }
	    if (!got) continue; /* Pass the buck to next Tcl_Eof */

	    buf = Tcl_GetStringFromObj (cbuf, &got);
	    marpatcl_rtc_enter (instance->state, buf, got, 0, -1);
	    if (marpatcl_rtc_failed (instance->state)) break;
	}
	Tcl_DecrRefCount (cbuf);

	(void) Tcl_Close (ip, in);
	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method process proc {Tcl_Interp* ip pstring string} ok {
	marpatcl_rtc_enter (instance->state, string.s, string.len, 0, -1);
	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    support {
	/* Helper function capturing parse results (semantic values of the parser)

	** Stem:  @stem@
	** Pkg:   @package@
	** Class: @class@
	** IType: @instancetype@
	** CType: @classtype@
	*/





	static void
	@stem@_result (void* cdata, marpatcl_rtc_sv_p sv)
	{
	    @instancetype@ instance = (@instancetype@) cdata;
	    if (instance->result) marpatcl_rtc_sv_unref (instance->result);
	    if (sv) marpatcl_rtc_sv_ref (sv);







>








>
>
>




|

|



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












|
>
>
>
>
>
|
>
|
|
>
|
|
<
|


|
|
>
>
>
>
|
>
>
|
>
>
>
>
>
|
|
>
>
>
|
>
>
|
|
|
|
>
|
|
<
<
|

|
<
<
|
<
<
<



<
>






>
>
>
>







690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783

784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816


817
818
819


820



821
822
823

824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
    /* --- end of generated data structures --- */
}

# # ## ### ##### ######## ############# #####################
## Class exposing the grammar engine.

critcl::class def json::parser::c {

    insvariable marpatcl_rtc_sv_p result {
	Parse result
    } {
	instance->result = 0;
    } {
	if (instance->result) marpatcl_rtc_sv_unref (instance->result);
    }

    # Note how `rtc` is declared before `pedesc`. We need it
    # initalized to be able to feed it into the construction of the
    # PE descriptor facade.
    insvariable marpatcl_rtc_p state {
	C-level engine, RTC structures.
    } {
	instance->state = marpatcl_rtc_cons (&json_parser_c_spec,
					     NULL, /* No actions */
					     @stem@_result, (void*) instance,
					     marpatcl_rtc_eh_report, (void*) &instance->ehstate );
    } {
	marpatcl_rtc_destroy (instance->state);
    }

    insvariable marpatcl_rtc_pedesc_p pedesc {
	Facade to the parse event descriptor structures.
	Maintained only when we have parse events declared, i.e. possible.
    } {
	// Feed our RTC structure into the facade class so that its constructor has access to it.
	marpatcl_rtc_pedesc_rtc_set (interp, instance->state);
	instance->pedesc = marpatcl_rtc_pedesc_new (interp, 0, 0);
	ASSERT (!marpatcl_rtc_pedesc_rtc_get (interp), "Constructor failed to take rtc structure");
    } {
	marpatcl_rtc_pedesc_destroy (instance->pedesc);
    }

    insvariable marpatcl_ehandlers ehstate {
	Handler for parse events
    } {
	marpatcl_rtc_eh_init (&instance->ehstate, interp,
			      (marpatcl_events_to_names) 0);
	/* See on-event above for further setup */
    } {
	marpatcl_rtc_eh_clear (&instance->ehstate);
	Tcl_DecrRefCount (instance->ehstate.self);
	instance->ehstate.self = 0;
    }

    insvariable Tcl_Obj* name {
	Object name, tail
    } { /* Initialized in the post constructor */ } {
	Tcl_DecrRefCount (instance->name);
    }

    method on-event proc {object args} void {
	marpatcl_rtc_eh_setup (&instance->ehstate, args.c, args.v);
    }

    method match proc {Tcl_Interp* ip object args} ok {
	/* -- Delegate to the parse event descriptor facade */
	return marpatcl_rtc_pe_match (instance->pedesc, ip, instance->name,
				      args.c, args.v);
    }

    constructor {
        /*
	 * Syntax:                          ... []
         * skip == 2: <class> new           ...
         *      == 3: <class> create <name> ...
         */

	if (objc > 0) {
	    Tcl_WrongNumArgs (interp, objcskip, objv-objcskip, 0);
	    goto error;
	}
    } {
	/* Post body. Save the FQN for use in the callbacks */
	instance->ehstate.self = fqn;
        Tcl_IncrRefCount (fqn);
        instance->name = Tcl_NewStringObj (Tcl_GetCommandName (interp, instance->cmd), -1);
        Tcl_IncrRefCount (instance->name);
    }

    method process-file proc {Tcl_Interp* ip object path object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }

	Tcl_Obj* ebuf;

	if (marpatcl_rtc_fget (ip, instance->state, path, &ebuf) != TCL_OK) {
	    return TCL_ERROR;
	}


	int got;
	char* buf = Tcl_GetStringFromObj (ebuf, &got);
	marpatcl_rtc_enter (instance->state, buf, got, from, to);
	Tcl_DecrRefCount (ebuf);

	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method process proc {Tcl_Interp* ip pstring string object args} ok {
	int from, to;
	if (!marpatcl_rtc_pe_range (ip, args.c, args.v, &from, &to)) { return TCL_ERROR; }
	marpatcl_rtc_enter (instance->state, string.s, string.len, from, to);
	return marpatcl_rtc_sv_complete (ip, instance->result, instance->state);
    }

    method extend proc {Tcl_Interp* ip pstring string} int {
	return marpatcl_rtc_enter_more (instance->state, string.s, string.len);
    }

    method extend-file proc {Tcl_Interp* ip object path} ok {
	Tcl_Obj* ebuf;
	if (marpatcl_rtc_fget (ip, instance->state, path, &ebuf) != TCL_OK) {
	    return TCL_ERROR;
	}

	int got;
	char* buf = Tcl_GetStringFromObj (ebuf, &got);
	int offset = marpatcl_rtc_enter_more (instance->state, buf, got);


	Tcl_DecrRefCount (ebuf);

	Tcl_SetObjResult (ip, Tcl_NewIntObj (offset));


	return TCL_OK;



    }

    support {

	/*
	** Stem:  @stem@
	** Pkg:   @package@
	** Class: @class@
	** IType: @instancetype@
	** CType: @classtype@
	*/

	/*
	** Helper function capturing parse results (semantic values of the parser)
	*/

	static void
	@stem@_result (void* cdata, marpatcl_rtc_sv_p sv)
	{
	    @instancetype@ instance = (@instancetype@) cdata;
	    if (instance->result) marpatcl_rtc_sv_unref (instance->result);
	    if (sv) marpatcl_rtc_sv_ref (sv);

Changes to languages/json/json-tcl.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017 Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                     http://core.tcl.tk/akupries/
##
# (c) 2018-present Grammar json::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "json::parser::tcl".
##	Generated On Tue Mar 13 08:05:02 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen

package provide json::parser::tcl 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing



|
|

|


|
|
|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar json::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "json::parser::tcl".
##	Generated On Fri Sep 07 15:24:33 PDT 2018
##		  By andreask@ten
##		 Via remeta

package provide json::parser::tcl 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing
189
190
191
192
193
194
195









196
197
198
199
200
201
202

    method L0.Semantics {} {
	debug.json/parser/tcl
	# NOTE. This is currently limited to array semantics.
	# NOTE. No support for command semantics in the lexer yet.
	return {start length value}
    }










    method G1.Symbols {} {
	# Structural symbols
	debug.json/parser/tcl
	return {
	    array
	    element







>
>
>
>
>
>
>
>
>







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211

    method L0.Semantics {} {
	debug.json/parser/tcl
	# NOTE. This is currently limited to array semantics.
	# NOTE. No support for command semantics in the lexer yet.
	return {start length value}
    }

    method L0.Events {} {
	debug.json/parser/tcl
	# L0 parse event definitions (pre-, post-lexeme, discard)
	# events = dict (symbol -> (e-type -> (e-name -> boolean)))
	# Due to the nature of SLIF syntax we can only associate one
	# event per type with each symbol, for a maximum of three.
	return {}
    }

    method G1.Symbols {} {
	# Structural symbols
	debug.json/parser/tcl
	return {
	    array
	    element
234
235
236
237
238
239
240








241
242
243
244
245
246
247
248
249
250
	    {value := null}
	    {value := number}
	    {value := object}
	    {value := string}
	    {value := true}
	}
    }









    method Start {} {
	debug.json/parser/tcl
	# G1 start symbol
	return {value}
    }
}

# # ## ### ##### ######## #############
return







>
>
>
>
>
>
>
>










243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	    {value := null}
	    {value := number}
	    {value := object}
	    {value := string}
	    {value := true}
	}
    }

    method G1.Events {} {
	debug.json/parser/tcl
	# G1 parse event definitions (predicted, nulled, completed)
	# events = dict (symbol -> (e-type -> (e-name -> boolean)))
	# Each symbol can have more than one event per type.
	return {}
    }

    method Start {} {
	debug.json/parser/tcl
	# G1 start symbol
	return {value}
    }
}

# # ## ### ##### ######## #############
return

Changes to languages/json/tests/common/json-core.testsuite.

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source support/ast.tcl
kt source support/dirs.tcl
kt source support/textutils.tcl

# # ## ### ##### ######## ############# #####################

kt local support [cl]

# # ## ### ##### ######## ############# #####################
##  1 constructor/0







|
|
|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source ../../../tests/support/ast.tcl
kt source ../../../tests/support/dirs.tcl
kt source ../../../tests/support/textutils.tcl

# # ## ### ##### ######## ############# #####################

kt local support [cl]

# # ## ### ##### ######## ############# #####################
##  1 constructor/0

Deleted languages/json/tests/support/ast.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support marpa::util

# Test suite support.
# # ## ### ##### ######## #############
## Pretty printing an AST coming out of the SLIF parser

proc ast-format {ast {step {  }}} {
    set lines {}
    ast-format-acc $ast {} $step
    return [join $lines \n]
}

proc ast-format-acc {ast indent step} {
    upvar 1 lines lines

    if {[string is integer [lindex $ast 0]]} {
	# Terminal, Data is offset, length, and lexeme value.
	lappend lines ${indent}@[marpa location show $ast]
	return
    }

    lassign $ast symbol children

    lappend lines $indent$symbol
    append indent $step
    foreach child $children {
	ast-format-acc $child $indent $step
    }
    return
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































Deleted languages/json/tests/support/dirs.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- tcl -*-
##
# (c) 2018-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

# Test suite support.
# # ## ### ##### ######## #############
## Quick access to common directories of the testsuite.

proc td {} {
    return [file normalize $::tcltest::testsDirectory]
}

proc indir {args} {
    return [file normalize [file join [td] input {*}$args]]
}

proc redir {args} {
    return [file normalize [file join [td] result {*}$args]]
}

proc locate {base args} {
    foreach file $args {
	set path [file join $base $file]
	if {![file exists $path]} continue
	return $path
    }
    return -code error "Unable to find any of [join $args {, }] for $base"
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































Deleted languages/json/tests/support/textutils.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support fileutil

# Test suite support.
# # ## ### ##### ######## #############

proc fget  {path}     { fileutil::cat $path }
proc fgetc {path enc} { fileutil::cat -encoding $enc $path }

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































Changes to languages/min-dt/mindt-lang-c.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::c 1 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "mindt::parser::c".
##	Generated On Wed Aug 15 21:14:01 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen
##
#* Space taken: 5613 bytes
##
#* Statistics
#* L0
#* - #Symbols:   343
#* - #Lexemes:   10
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 129 (+2: setup, start-sym)
#* - #Rules:     529 (>= insn, brange)
#* G1
#* - #Symbols:   30
#* - #Rule Insn: 32 (+2: setup, start-sym)
#* - #Rules:     32 (match insn)

package provide mindt::parser::c 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1







|


|
|
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::c 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "mindt::parser::c".
##	Generated On Fri Sep 07 15:24:34 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 5613 bytes
##
#* Statistics
#* L0
#* - #Symbols:   343
#* - #Lexemes:   10
#* - #Discards:  1
#* - #Always:    1
#* - #Rule Insn: 129 (+2: setup, start-sym)
#* - #Rules:     529 (>= insn, brange)
#* G1
#* - #Symbols:   30
#* - #Rule Insn: 32 (+2: setup, start-sym)
#* - #Rules:     32 (match insn)

package provide mindt::parser::c 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1

521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
	337,

	/* --- (65) --- --- --- Internal
	 */
	 34,  42,  43,  32,  37,  41,  44,  83,  84, 202, 232, 270, 313, 331, 209, 212,
	213, 214, 215, 218, 219, 220, 221, 225, 228, 230, 231, 233, 234, 269, 282, 283,
	284, 285, 292, 295, 297, 299, 305, 308, 311, 312, 319, 321, 327, 328, 334, 335,
	336, 338, 341,  29,  30,  31,  33,  35,  45,  36,  38,  39,  40,  46,  47, 222,
	 28
    };

    static marpatcl_rtc_sym mindt_parser_c_l0_rule_definitions [418] = { /* 836 bytes */
	MARPATCL_RCMD_SETUP (9),
	MARPATCL_RCMD_PRIO  (1), 267, 296,                                         /* <Braced>                      ::= <BRACED> */
	MARPATCL_RCMD_PRIO  (1), 268, 306,                                         /* <CDone>                       ::= <CR> */
	MARPATCL_RCMD_PRIO  (1), 269, 307,                                         /* <CInclude>                    ::= <INCLUDE> */
	MARPATCL_RCMD_PRIO  (1), 270, 302,                                         /* <Cl>                          ::= <CL> */
	MARPATCL_RCMD_PRIO  (1), 271, 301,                                         /* <CStrong>                     ::= <C_STRONG> */
	MARPATCL_RCMD_PRIO  (1), 272, 322,                                         /* <CVdef>                       ::= <VAR_DEF> */
	MARPATCL_RCMD_PRIO  (1), 273, 323,                                         /* <CVref>                       ::= <VAR_REF> */
	MARPATCL_RCMD_PRIO  (1), 274, 312,                                         /* <Quote>                       ::= <QUOTE> */
	MARPATCL_RCMD_PRIO  (1), 275, 316,                                         /* <Simple>                      ::= <SIMPLE> */
	MARPATCL_RCMD_PRIO  (1), 276, 319,                                         /* <Space>                       ::= <SPACE1> */
	MARPATCL_RCMD_PRIO  (1), 277, 326,                                         /* <Whitespace>                  ::= <WHITE1> */
	MARPATCL_RCMD_PRIO  (2), 278, 192, 128,                                    /* <@^CLS:<\173\175>>            ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 281,                                         /*                               |   <@BRAN:<\1z>> */
	MARPATCL_RCMD_PRIS  (1)     , 124,                                         /*                               |   <@BYTE:<|>> */
	MARPATCL_RCMD_PRIS  (1)     , 340,                                         /*                               |   <@BRAN:<~\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 337, 333,                                    /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 338, 333, 333,                               /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 335, 333, 237, 336, 333,                /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (2), 279, 192, 128,                                    /* <@^CLS:<\t-\r\40\42\133\135>> ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 331,                                         /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 332,                                         /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 33,                                          /*                               |   <@BYTE:<!>> */
	MARPATCL_RCMD_PRIS  (1)     , 330,                                         /*                               |   <@BRAN:<#Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                          /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 339,                                         /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 337, 333,                                    /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 338, 333, 333,                               /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 335, 333, 237, 336, 333,                /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (2), 280, 192, 128,                                    /* <@^CLS:<\t-\r\40\133\135>>    ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 331,                                         /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 332,                                         /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 329,                                         /*                               |   <@BRAN:<!Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                          /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 339,                                         /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 337, 333,                                    /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 338, 333, 333,                               /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 335, 333, 237, 336, 333,                /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 281, 331,                                         /* <@BRAN:<\1z>>                 ::= <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 299,                                         /*                               |   <BRAN<d9-d122>> */
	MARPATCL_RCMD_PRIO  (1), 282, 335,                                         /* <@BRAN:<\u00a0\u00bf>>        ::= <@BRAN:<\u00a0\u00af>> */
	MARPATCL_RCMD_PRIS  (1)     , 336,                                         /*                               |   <@BRAN:<\u00b0\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 283, 10,                                          /* <@CLS:<\n\r>>                 ::= <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                                          /*                               |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIO  (1), 284, 334,                                         /* <@CLS:<\t-\r\40>>             ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                                          /*                               |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (2), 285, 92, 123,                                     /* <@STR:<\134\173>>             ::= <@BYTE:<\134>> <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (2), 286, 92, 125,                                     /* <@STR:<\134\175>>             ::= <@BYTE:<\134>> <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (2), 287, 13, 10,                                      /* <@STR:<\r\n>>                 ::= <@BYTE:<\r>> <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIO  (7), 288, 99, 111, 109, 109, 101, 110, 116,            /* <@STR:<comment>>              ::= <@BYTE:<c>> <@BYTE:<o>> <@BYTE:<m>> <@BYTE:<m>> <@BYTE:<e>> <@BYTE:<n>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (7), 289, 105, 110, 99, 108, 117, 100, 101,            /* <@STR:<include>>              ::= <@BYTE:<i>> <@BYTE:<n>> <@BYTE:<c>> <@BYTE:<l>> <@BYTE:<u>> <@BYTE:<d>> <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (6), 290, 115, 116, 114, 111, 110, 103,                /* <@STR:<strong>>               ::= <@BYTE:<s>> <@BYTE:<t>> <@BYTE:<r>> <@BYTE:<o>> <@BYTE:<n>> <@BYTE:<g>> */
	MARPATCL_RCMD_PRIO  (4), 291, 118, 115, 101, 116,                          /* <@STR:<vset>>                 ::= <@BYTE:<v>> <@BYTE:<s>> <@BYTE:<e>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 292, 278,                                         /* <ANY_UNBRACED>                ::= <@^CLS:<\173\175>> */
	MARPATCL_RCMD_PRIO  (1), 293, 123,                                         /* <BL>                          ::= <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (1), 294, 125,                                         /* <BR>                          ::= <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 295, 285,                                         /* <BRACE_ESCAPED>               ::= <@STR:<\134\173>> */
	MARPATCL_RCMD_PRIS  (1)     , 286,                                         /*                               |   <@STR:<\134\175>> */
	MARPATCL_RCMD_PRIO  (3), 296, 293, 298, 294,                               /* <BRACED>                      ::= <BL> <BRACED_ELEMS> <BR> */
	MARPATCL_RCMD_PRIO  (1), 297, 292,                                         /* <BRACED_ELEM>                 ::= <ANY_UNBRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 296,                                         /*                               |   <BRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 295,                                         /*                               |   <BRACE_ESCAPED> */
	MARPATCL_RCMD_QUN   (298), 297,                                            /* <BRACED_ELEMS>                ::= <BRACED_ELEM> * */
	MARPATCL_RCMD_PRIO  (1), 299, 334,                                         /* <BRAN<d9-d122>>               ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 300,                                         /*                               |   <BRAN<d14-d122>> */
	MARPATCL_RCMD_PRIO  (1), 300, 332,                                         /* <BRAN<d14-d122>>              ::= <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 341,                                         /*                               |   <BRAN<d32-d122>> */
	MARPATCL_RCMD_PRIO  (1), 301, 290,                                         /* <C_STRONG>                    ::= <@STR:<strong>> */
	MARPATCL_RCMD_PRIO  (1), 302, 91,                                          /* <CL>                          ::= <@CHR:<\133>> */
	MARPATCL_RCMD_PRIO  (5), 303, 302, 325, 328, 325, 306,                     /* <COMMAND>                     ::= <CL> <WHITE0> <WORDS1> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (7), 304, 302, 325, 288, 326, 327, 325, 306,           /* <COMMENT>                     ::= <CL> <WHITE0> <@STR:<comment>> <WHITE1> <WORD> <WHITE0> <CR> */







|
















|



|
|
|
|
|






|
|
|
|
|





|
|
|
|


|
|


|


















|







521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
	337,

	/* --- (65) --- --- --- Internal
	 */
	 34,  42,  43,  32,  37,  41,  44,  83,  84, 202, 232, 270, 313, 331, 209, 212,
	213, 214, 215, 218, 219, 220, 221, 225, 228, 230, 231, 233, 234, 269, 282, 283,
	284, 285, 292, 295, 297, 299, 305, 308, 311, 312, 319, 321, 327, 328, 334, 335,
	336, 338, 341,  29,  30,  31,  33,  35,  36,  38,  39,  40,  45,  46,  47, 222,
	 28
    };

    static marpatcl_rtc_sym mindt_parser_c_l0_rule_definitions [418] = { /* 836 bytes */
	MARPATCL_RCMD_SETUP (9),
	MARPATCL_RCMD_PRIO  (1), 267, 296,                                         /* <Braced>                      ::= <BRACED> */
	MARPATCL_RCMD_PRIO  (1), 268, 306,                                         /* <CDone>                       ::= <CR> */
	MARPATCL_RCMD_PRIO  (1), 269, 307,                                         /* <CInclude>                    ::= <INCLUDE> */
	MARPATCL_RCMD_PRIO  (1), 270, 302,                                         /* <Cl>                          ::= <CL> */
	MARPATCL_RCMD_PRIO  (1), 271, 301,                                         /* <CStrong>                     ::= <C_STRONG> */
	MARPATCL_RCMD_PRIO  (1), 272, 322,                                         /* <CVdef>                       ::= <VAR_DEF> */
	MARPATCL_RCMD_PRIO  (1), 273, 323,                                         /* <CVref>                       ::= <VAR_REF> */
	MARPATCL_RCMD_PRIO  (1), 274, 312,                                         /* <Quote>                       ::= <QUOTE> */
	MARPATCL_RCMD_PRIO  (1), 275, 316,                                         /* <Simple>                      ::= <SIMPLE> */
	MARPATCL_RCMD_PRIO  (1), 276, 319,                                         /* <Space>                       ::= <SPACE1> */
	MARPATCL_RCMD_PRIO  (1), 277, 326,                                         /* <Whitespace>                  ::= <WHITE1> */
	MARPATCL_RCMD_PRIO  (2), 278, 192, 128,                                    /* <@^CLS:<\173\175>>            ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 281,                                         /*                               |   <@BRAN:<\1z>> */
	MARPATCL_RCMD_PRIS  (1)     , 124,                                         /*                               |   <@BYTE:<|>> */
	MARPATCL_RCMD_PRIS  (1)     , 340,                                         /*                               |   <@BRAN:<~\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 336, 333,                                    /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 337, 333, 333,                               /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 334, 333, 237, 335, 333,                /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (2), 279, 192, 128,                                    /* <@^CLS:<\t-\r\40\42\133\135>> ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 331,                                         /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 332,                                         /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 33,                                          /*                               |   <@BYTE:<!>> */
	MARPATCL_RCMD_PRIS  (1)     , 330,                                         /*                               |   <@BRAN:<#Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                          /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 339,                                         /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 336, 333,                                    /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 337, 333, 333,                               /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 334, 333, 237, 335, 333,                /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (2), 280, 192, 128,                                    /* <@^CLS:<\t-\r\40\133\135>>    ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 331,                                         /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 332,                                         /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 329,                                         /*                               |   <@BRAN:<!Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                          /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 339,                                         /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 336, 333,                                    /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 282, 333,                               /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 337, 333, 333,                               /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 334, 333, 237, 335, 333,                /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (1), 281, 331,                                         /* <@BRAN:<\1z>>                 ::= <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 299,                                         /*                               |   <BRAN<d9-d122>> */
	MARPATCL_RCMD_PRIO  (1), 282, 334,                                         /* <@BRAN:<\240\277>>            ::= <@BRAN:<\240\257>> */
	MARPATCL_RCMD_PRIS  (1)     , 335,                                         /*                               |   <@BRAN:<\260\277>> */
	MARPATCL_RCMD_PRIO  (1), 283, 10,                                          /* <@CLS:<\n\r>>                 ::= <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                                          /*                               |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIO  (1), 284, 338,                                         /* <@CLS:<\t-\r\40>>             ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                                          /*                               |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (2), 285, 92, 123,                                     /* <@STR:<\134\173>>             ::= <@BYTE:<\134>> <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (2), 286, 92, 125,                                     /* <@STR:<\134\175>>             ::= <@BYTE:<\134>> <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (2), 287, 13, 10,                                      /* <@STR:<\r\n>>                 ::= <@BYTE:<\r>> <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIO  (7), 288, 99, 111, 109, 109, 101, 110, 116,            /* <@STR:<comment>>              ::= <@BYTE:<c>> <@BYTE:<o>> <@BYTE:<m>> <@BYTE:<m>> <@BYTE:<e>> <@BYTE:<n>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (7), 289, 105, 110, 99, 108, 117, 100, 101,            /* <@STR:<include>>              ::= <@BYTE:<i>> <@BYTE:<n>> <@BYTE:<c>> <@BYTE:<l>> <@BYTE:<u>> <@BYTE:<d>> <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (6), 290, 115, 116, 114, 111, 110, 103,                /* <@STR:<strong>>               ::= <@BYTE:<s>> <@BYTE:<t>> <@BYTE:<r>> <@BYTE:<o>> <@BYTE:<n>> <@BYTE:<g>> */
	MARPATCL_RCMD_PRIO  (4), 291, 118, 115, 101, 116,                          /* <@STR:<vset>>                 ::= <@BYTE:<v>> <@BYTE:<s>> <@BYTE:<e>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 292, 278,                                         /* <ANY_UNBRACED>                ::= <@^CLS:<\173\175>> */
	MARPATCL_RCMD_PRIO  (1), 293, 123,                                         /* <BL>                          ::= <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (1), 294, 125,                                         /* <BR>                          ::= <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 295, 285,                                         /* <BRACE_ESCAPED>               ::= <@STR:<\134\173>> */
	MARPATCL_RCMD_PRIS  (1)     , 286,                                         /*                               |   <@STR:<\134\175>> */
	MARPATCL_RCMD_PRIO  (3), 296, 293, 298, 294,                               /* <BRACED>                      ::= <BL> <BRACED_ELEMS> <BR> */
	MARPATCL_RCMD_PRIO  (1), 297, 292,                                         /* <BRACED_ELEM>                 ::= <ANY_UNBRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 296,                                         /*                               |   <BRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 295,                                         /*                               |   <BRACE_ESCAPED> */
	MARPATCL_RCMD_QUN   (298), 297,                                            /* <BRACED_ELEMS>                ::= <BRACED_ELEM> * */
	MARPATCL_RCMD_PRIO  (1), 299, 338,                                         /* <BRAN<d9-d122>>               ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 300,                                         /*                               |   <BRAN<d14-d122>> */
	MARPATCL_RCMD_PRIO  (1), 300, 332,                                         /* <BRAN<d14-d122>>              ::= <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 341,                                         /*                               |   <BRAN<d32-d122>> */
	MARPATCL_RCMD_PRIO  (1), 301, 290,                                         /* <C_STRONG>                    ::= <@STR:<strong>> */
	MARPATCL_RCMD_PRIO  (1), 302, 91,                                          /* <CL>                          ::= <@CHR:<\133>> */
	MARPATCL_RCMD_PRIO  (5), 303, 302, 325, 328, 325, 306,                     /* <COMMAND>                     ::= <CL> <WHITE0> <WORDS1> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (7), 304, 302, 325, 288, 326, 327, 325, 306,           /* <COMMENT>                     ::= <CL> <WHITE0> <@STR:<comment>> <WHITE1> <WORD> <WHITE0> <CR> */
636
637
638
639
640
641
642
643
644
645
646
647
648

649
650
651
652
653
654
655
	MARPATCL_RCMD_PRIS  (1)     , 313,                                         /*                               |   <QUOTED> */
	MARPATCL_RCMD_PRIS  (1)     , 320,                                         /*                               |   <UNQUOTED> */
	MARPATCL_RCMD_QUPS  (328), 327, MARPATCL_RCMD_SEP (326),                   /* <WORDS1>                      ::= <WORD> + (<WHITE1>) */
	MARPATCL_RCMD_BRAN  (329), MARPATCL_RCMD_BOXR ( 33, 90),                   /* <@BRAN:<!Z>>                  brange (33 - 90) */
	MARPATCL_RCMD_BRAN  (330), MARPATCL_RCMD_BOXR ( 35, 90),                   /* <@BRAN:<#Z>>                  brange (35 - 90) */
	MARPATCL_RCMD_BRAN  (331), MARPATCL_RCMD_BOXR (  1,  8),                   /* <@BRAN:<\1\10>>               brange (1 - 8) */
	MARPATCL_RCMD_BRAN  (332), MARPATCL_RCMD_BOXR ( 14, 31),                   /* <@BRAN:<\16\37>>              brange (14 - 31) */
	MARPATCL_RCMD_BRAN  (333), MARPATCL_RCMD_BOXR (128,191),                   /* <@BRAN:<\200\u00bf>>          brange (128 - 191) */
	MARPATCL_RCMD_BRAN  (334), MARPATCL_RCMD_BOXR (  9, 13),                   /* <@BRAN:<\t\r>>                brange (9 - 13) */
	MARPATCL_RCMD_BRAN  (335), MARPATCL_RCMD_BOXR (160,175),                   /* <@BRAN:<\u00a0\u00af>>        brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (336), MARPATCL_RCMD_BOXR (176,191),                   /* <@BRAN:<\u00b0\u00bf>>        brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (337), MARPATCL_RCMD_BOXR (194,223),                   /* <@BRAN:<\u00c2\u00df>>        brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (338), MARPATCL_RCMD_BOXR (225,239),                   /* <@BRAN:<\u00e1\u00ef>>        brange (225 - 239) */

	MARPATCL_RCMD_BRAN  (339), MARPATCL_RCMD_BOXR ( 94,127),                   /* <@BRAN:<^\177>>               brange (94 - 127) */
	MARPATCL_RCMD_BRAN  (340), MARPATCL_RCMD_BOXR (126,127),                   /* <@BRAN:<~\177>>               brange (126 - 127) */
	MARPATCL_RCMD_BRAN  (341), MARPATCL_RCMD_BOXR ( 32,122),                   /* <BRAN<d32-d122>>              brange (32 - 122) */
	MARPATCL_RCMD_PRIO  (2), 342, 256, 267,                                    /* <@L0:START>                   ::= <@ACS:Braced> <Braced> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 268,                                    /*                               |   <@ACS:CDone> <CDone> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 269,                                    /*                               |   <@ACS:CInclude> <CInclude> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 270,                                    /*                               |   <@ACS:Cl> <Cl> */







|
<
|
|
|
|
>







636
637
638
639
640
641
642
643

644
645
646
647
648
649
650
651
652
653
654
655
	MARPATCL_RCMD_PRIS  (1)     , 313,                                         /*                               |   <QUOTED> */
	MARPATCL_RCMD_PRIS  (1)     , 320,                                         /*                               |   <UNQUOTED> */
	MARPATCL_RCMD_QUPS  (328), 327, MARPATCL_RCMD_SEP (326),                   /* <WORDS1>                      ::= <WORD> + (<WHITE1>) */
	MARPATCL_RCMD_BRAN  (329), MARPATCL_RCMD_BOXR ( 33, 90),                   /* <@BRAN:<!Z>>                  brange (33 - 90) */
	MARPATCL_RCMD_BRAN  (330), MARPATCL_RCMD_BOXR ( 35, 90),                   /* <@BRAN:<#Z>>                  brange (35 - 90) */
	MARPATCL_RCMD_BRAN  (331), MARPATCL_RCMD_BOXR (  1,  8),                   /* <@BRAN:<\1\10>>               brange (1 - 8) */
	MARPATCL_RCMD_BRAN  (332), MARPATCL_RCMD_BOXR ( 14, 31),                   /* <@BRAN:<\16\37>>              brange (14 - 31) */
	MARPATCL_RCMD_BRAN  (333), MARPATCL_RCMD_BOXR (128,191),                   /* <@BRAN:<\200\277>>            brange (128 - 191) */

	MARPATCL_RCMD_BRAN  (334), MARPATCL_RCMD_BOXR (160,175),                   /* <@BRAN:<\240\257>>            brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (335), MARPATCL_RCMD_BOXR (176,191),                   /* <@BRAN:<\260\277>>            brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (336), MARPATCL_RCMD_BOXR (194,223),                   /* <@BRAN:<\302\337>>            brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (337), MARPATCL_RCMD_BOXR (225,239),                   /* <@BRAN:<\341\357>>            brange (225 - 239) */
	MARPATCL_RCMD_BRAN  (338), MARPATCL_RCMD_BOXR (  9, 13),                   /* <@BRAN:<\t\r>>                brange (9 - 13) */
	MARPATCL_RCMD_BRAN  (339), MARPATCL_RCMD_BOXR ( 94,127),                   /* <@BRAN:<^\177>>               brange (94 - 127) */
	MARPATCL_RCMD_BRAN  (340), MARPATCL_RCMD_BOXR (126,127),                   /* <@BRAN:<~\177>>               brange (126 - 127) */
	MARPATCL_RCMD_BRAN  (341), MARPATCL_RCMD_BOXR ( 32,122),                   /* <BRAN<d32-d122>>              brange (32 - 122) */
	MARPATCL_RCMD_PRIO  (2), 342, 256, 267,                                    /* <@L0:START>                   ::= <@ACS:Braced> <Braced> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 268,                                    /*                               |   <@ACS:CDone> <CDone> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 269,                                    /*                               |   <@ACS:CInclude> <CInclude> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 270,                                    /*                               |   <@ACS:Cl> <Cl> */

Changes to languages/min-dt/mindt-lang-tcl.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "mindt::parser::tcl".
##	Generated On Wed Aug 15 21:14:02 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen

package provide mindt::parser::tcl 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing









|
|
|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "mindt::parser::tcl".
##	Generated On Fri Sep 07 15:24:35 PDT 2018
##		  By andreask@ten
##		 Via remeta

package provide mindt::parser::tcl 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing

Changes to languages/min-dt/mindt-sf-c.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::sf::c 1 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "mindt::parser::sf::c".
##	Generated On Wed Aug 15 21:14:04 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen
##
#* Space taken: 5800 bytes
##
#* Statistics
#* L0
#* - #Symbols:   338
#* - #Lexemes:   10
#* - #Discards:  0
#* - #Always:    0
#* - #Rule Insn: 124 (+2: setup, start-sym)
#* - #Rules:     524 (>= insn, brange)
#* G1
#* - #Symbols:   30
#* - #Rule Insn: 37 (+2: setup, start-sym)
#* - #Rules:     37 (match insn)

package provide mindt::parser::sf::c 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1







|


|
|
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::sf::c 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "mindt::parser::sf::c".
##	Generated On Fri Sep 07 15:24:36 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 5800 bytes
##
#* Statistics
#* L0
#* - #Symbols:   338
#* - #Lexemes:   10
#* - #Discards:  0
#* - #Always:    0
#* - #Rule Insn: 124 (+2: setup, start-sym)
#* - #Rules:     524 (>= insn, brange)
#* G1
#* - #Symbols:   30
#* - #Rule Insn: 37 (+2: setup, start-sym)
#* - #Rules:     37 (match insn)

package provide mindt::parser::sf::c 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5 ;# apply, lassign, ...
package require critcl 3.1

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
	216, 263, 289, 301, 304, 308, 309, 328, 333, 337,

	/* --- (62) --- --- --- Internal
	 */
	 34,  42,  43,  32,  37,  41,  44,  83,  84, 202, 228, 264, 329, 209, 212, 213,
	214, 215, 218, 219, 220, 221, 225, 226, 227, 229, 230, 262, 275, 276, 277, 278,
	288, 291, 293, 294, 300, 303, 306, 307, 315, 316, 327, 332, 334, 335, 336, 338,
	 29,  30,  31,  33,  35,  45,  36,  38,  39,  40,  46,  47, 222,  28
    };

    static marpatcl_rtc_sym mindt_parser_sf_c_l0_rule_definitions [378] = { /* 756 bytes */
	MARPATCL_RCMD_SETUP (7),
	MARPATCL_RCMD_PRIO  (1), 266, 293,                               /* <Braced>                      ::= <BRACED> */
	MARPATCL_RCMD_PRIO  (1), 267, 303,                               /* <Include>                     ::= <INCLUDE> */
	MARPATCL_RCMD_PRIO  (1), 268, 308,                               /* <Quote>                       ::= <QUOTE> */
	MARPATCL_RCMD_PRIO  (1), 269, 312,                               /* <Simple>                      ::= <SIMPLE> */
	MARPATCL_RCMD_PRIO  (1), 270, 315,                               /* <Space>                       ::= <SPACE1> */
	MARPATCL_RCMD_PRIO  (1), 271, 298,                               /* <Start>                       ::= <CL> */
	MARPATCL_RCMD_PRIO  (1), 272, 302,                               /* <Stop>                        ::= <CR> */
	MARPATCL_RCMD_PRIO  (1), 273, 318,                               /* <Vset>                        ::= <VSET> */
	MARPATCL_RCMD_PRIO  (1), 274, 321,                               /* <White>                       ::= <WHITE1> */
	MARPATCL_RCMD_PRIO  (1), 275, 322,                               /* <Word>                        ::= <WORD> */
	MARPATCL_RCMD_PRIO  (2), 276, 192, 128,                          /* <@^CLS:<\173\175>>            ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 279,                               /*                               |   <@BRAN:<\1z>> */
	MARPATCL_RCMD_PRIS  (1)     , 124,                               /*                               |   <@BYTE:<|>> */
	MARPATCL_RCMD_PRIS  (1)     , 335,                               /*                               |   <@BRAN:<~\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 332, 328,                          /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 333, 328, 328,                     /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 330, 328, 237, 331, 328,      /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (2), 277, 192, 128,                          /* <@^CLS:<\t-\r\40\42\133\135>> ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 326,                               /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 327,                               /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 33,                                /*                               |   <@BYTE:<!>> */
	MARPATCL_RCMD_PRIS  (1)     , 325,                               /*                               |   <@BRAN:<#Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 334,                               /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 332, 328,                          /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 333, 328, 328,                     /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 330, 328, 237, 331, 328,      /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (2), 278, 192, 128,                          /* <@^CLS:<\t-\r\40\133\135>>    ::= <@BYTE:<\u00c0>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 326,                               /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 327,                               /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 324,                               /*                               |   <@BRAN:<!Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 334,                               /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 332, 328,                          /*                               |   <@BRAN:<\u00c2\u00df>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\u00e0>> <@BRAN:<\u00a0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (3)     , 333, 328, 328,                     /*                               |   <@BRAN:<\u00e1\u00ef>> <@BRAN:<\200\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 330, 328, 237, 331, 328,      /*                               |   <@BYTE:<\u00ed>> <@BRAN:<\u00a0\u00af>> <@BRAN:<\200\u00bf>> <@BYTE:<\u00ed>> <@BRAN:<\u00b0\u00bf>> <@BRAN:<\200\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 279, 326,                               /* <@BRAN:<\1z>>                 ::= <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 296,                               /*                               |   <BRAN<d9-d122>> */
	MARPATCL_RCMD_PRIO  (1), 280, 330,                               /* <@BRAN:<\u00a0\u00bf>>        ::= <@BRAN:<\u00a0\u00af>> */
	MARPATCL_RCMD_PRIS  (1)     , 331,                               /*                               |   <@BRAN:<\u00b0\u00bf>> */
	MARPATCL_RCMD_PRIO  (1), 281, 10,                                /* <@CLS:<\n\r>>                 ::= <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                                /*                               |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIO  (1), 282, 329,                               /* <@CLS:<\t-\r\40>>             ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                                /*                               |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (2), 283, 92, 123,                           /* <@STR:<\134\173>>             ::= <@BYTE:<\134>> <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (2), 284, 92, 125,                           /* <@STR:<\134\175>>             ::= <@BYTE:<\134>> <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (2), 285, 13, 10,                            /* <@STR:<\r\n>>                 ::= <@BYTE:<\r>> <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIO  (7), 286, 99, 111, 109, 109, 101, 110, 116,  /* <@STR:<comment>>              ::= <@BYTE:<c>> <@BYTE:<o>> <@BYTE:<m>> <@BYTE:<m>> <@BYTE:<e>> <@BYTE:<n>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (7), 287, 105, 110, 99, 108, 117, 100, 101,  /* <@STR:<include>>              ::= <@BYTE:<i>> <@BYTE:<n>> <@BYTE:<c>> <@BYTE:<l>> <@BYTE:<u>> <@BYTE:<d>> <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (4), 288, 118, 115, 101, 116,                /* <@STR:<vset>>                 ::= <@BYTE:<v>> <@BYTE:<s>> <@BYTE:<e>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 289, 276,                               /* <ANY_UNBRACED>                ::= <@^CLS:<\173\175>> */
	MARPATCL_RCMD_PRIO  (1), 290, 123,                               /* <BL>                          ::= <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (1), 291, 125,                               /* <BR>                          ::= <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 292, 283,                               /* <BRACE_ESCAPED>               ::= <@STR:<\134\173>> */
	MARPATCL_RCMD_PRIS  (1)     , 284,                               /*                               |   <@STR:<\134\175>> */
	MARPATCL_RCMD_PRIO  (3), 293, 290, 295, 291,                     /* <BRACED>                      ::= <BL> <BRACED_ELEMS> <BR> */
	MARPATCL_RCMD_PRIO  (1), 294, 289,                               /* <BRACED_ELEM>                 ::= <ANY_UNBRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 293,                               /*                               |   <BRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 292,                               /*                               |   <BRACE_ESCAPED> */
	MARPATCL_RCMD_QUN   (295), 294,                                  /* <BRACED_ELEMS>                ::= <BRACED_ELEM> * */
	MARPATCL_RCMD_PRIO  (1), 296, 329,                               /* <BRAN<d9-d122>>               ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 297,                               /*                               |   <BRAN<d14-d122>> */
	MARPATCL_RCMD_PRIO  (1), 297, 327,                               /* <BRAN<d14-d122>>              ::= <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 336,                               /*                               |   <BRAN<d32-d122>> */
	MARPATCL_RCMD_PRIO  (1), 298, 91,                                /* <CL>                          ::= <@CHR:<\133>> */
	MARPATCL_RCMD_PRIO  (5), 299, 298, 320, 323, 320, 302,           /* <COMMAND>                     ::= <CL> <WHITE0> <WORDS1> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (7), 300, 298, 320, 286, 321, 322, 320, 302, /* <COMMENT>                     ::= <CL> <WHITE0> <@STR:<comment>> <WHITE1> <WORD> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (4), 301, 314, 92, 304, 314,                 /* <CONTINUATION>                ::= <SPACE0> <@BYTE:<\134>> <NEWLINE> <SPACE0> */







|














|



|
|
|
|
|






|
|
|
|
|





|
|
|
|


|
|


|

















|







502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
	216, 263, 289, 301, 304, 308, 309, 328, 333, 337,

	/* --- (62) --- --- --- Internal
	 */
	 34,  42,  43,  32,  37,  41,  44,  83,  84, 202, 228, 264, 329, 209, 212, 213,
	214, 215, 218, 219, 220, 221, 225, 226, 227, 229, 230, 262, 275, 276, 277, 278,
	288, 291, 293, 294, 300, 303, 306, 307, 315, 316, 327, 332, 334, 335, 336, 338,
	 29,  30,  31,  33,  35,  36,  38,  39,  40,  45,  46,  47, 222,  28
    };

    static marpatcl_rtc_sym mindt_parser_sf_c_l0_rule_definitions [378] = { /* 756 bytes */
	MARPATCL_RCMD_SETUP (7),
	MARPATCL_RCMD_PRIO  (1), 266, 293,                               /* <Braced>                      ::= <BRACED> */
	MARPATCL_RCMD_PRIO  (1), 267, 303,                               /* <Include>                     ::= <INCLUDE> */
	MARPATCL_RCMD_PRIO  (1), 268, 308,                               /* <Quote>                       ::= <QUOTE> */
	MARPATCL_RCMD_PRIO  (1), 269, 312,                               /* <Simple>                      ::= <SIMPLE> */
	MARPATCL_RCMD_PRIO  (1), 270, 315,                               /* <Space>                       ::= <SPACE1> */
	MARPATCL_RCMD_PRIO  (1), 271, 298,                               /* <Start>                       ::= <CL> */
	MARPATCL_RCMD_PRIO  (1), 272, 302,                               /* <Stop>                        ::= <CR> */
	MARPATCL_RCMD_PRIO  (1), 273, 318,                               /* <Vset>                        ::= <VSET> */
	MARPATCL_RCMD_PRIO  (1), 274, 321,                               /* <White>                       ::= <WHITE1> */
	MARPATCL_RCMD_PRIO  (1), 275, 322,                               /* <Word>                        ::= <WORD> */
	MARPATCL_RCMD_PRIO  (2), 276, 192, 128,                          /* <@^CLS:<\173\175>>            ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 279,                               /*                               |   <@BRAN:<\1z>> */
	MARPATCL_RCMD_PRIS  (1)     , 124,                               /*                               |   <@BYTE:<|>> */
	MARPATCL_RCMD_PRIS  (1)     , 335,                               /*                               |   <@BRAN:<~\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 331, 328,                          /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 332, 328, 328,                     /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 329, 328, 237, 330, 328,      /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (2), 277, 192, 128,                          /* <@^CLS:<\t-\r\40\42\133\135>> ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 326,                               /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 327,                               /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 33,                                /*                               |   <@BYTE:<!>> */
	MARPATCL_RCMD_PRIS  (1)     , 325,                               /*                               |   <@BRAN:<#Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 334,                               /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 331, 328,                          /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 332, 328, 328,                     /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 329, 328, 237, 330, 328,      /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (2), 278, 192, 128,                          /* <@^CLS:<\t-\r\40\133\135>>    ::= <@BYTE:<\300>> <@BYTE:<\200>> */
	MARPATCL_RCMD_PRIS  (1)     , 326,                               /*                               |   <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 327,                               /*                               |   <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 324,                               /*                               |   <@BRAN:<!Z>> */
	MARPATCL_RCMD_PRIS  (1)     , 92,                                /*                               |   <@BYTE:<\134>> */
	MARPATCL_RCMD_PRIS  (1)     , 334,                               /*                               |   <@BRAN:<^\177>> */
	MARPATCL_RCMD_PRIS  (2)     , 331, 328,                          /*                               |   <@BRAN:<\302\337>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 224, 280, 328,                     /*                               |   <@BYTE:<\340>> <@BRAN:<\240\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (3)     , 332, 328, 328,                     /*                               |   <@BRAN:<\341\357>> <@BRAN:<\200\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIS  (6)     , 237, 329, 328, 237, 330, 328,      /*                               |   <@BYTE:<\355>> <@BRAN:<\240\257>> <@BRAN:<\200\277>> <@BYTE:<\355>> <@BRAN:<\260\277>> <@BRAN:<\200\277>> */
	MARPATCL_RCMD_PRIO  (1), 279, 326,                               /* <@BRAN:<\1z>>                 ::= <@BRAN:<\1\10>> */
	MARPATCL_RCMD_PRIS  (1)     , 296,                               /*                               |   <BRAN<d9-d122>> */
	MARPATCL_RCMD_PRIO  (1), 280, 329,                               /* <@BRAN:<\240\277>>            ::= <@BRAN:<\240\257>> */
	MARPATCL_RCMD_PRIS  (1)     , 330,                               /*                               |   <@BRAN:<\260\277>> */
	MARPATCL_RCMD_PRIO  (1), 281, 10,                                /* <@CLS:<\n\r>>                 ::= <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIS  (1)     , 13,                                /*                               |   <@BYTE:<\r>> */
	MARPATCL_RCMD_PRIO  (1), 282, 333,                               /* <@CLS:<\t-\r\40>>             ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 32,                                /*                               |   <@BYTE:<\40>> */
	MARPATCL_RCMD_PRIO  (2), 283, 92, 123,                           /* <@STR:<\134\173>>             ::= <@BYTE:<\134>> <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (2), 284, 92, 125,                           /* <@STR:<\134\175>>             ::= <@BYTE:<\134>> <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (2), 285, 13, 10,                            /* <@STR:<\r\n>>                 ::= <@BYTE:<\r>> <@BYTE:<\n>> */
	MARPATCL_RCMD_PRIO  (7), 286, 99, 111, 109, 109, 101, 110, 116,  /* <@STR:<comment>>              ::= <@BYTE:<c>> <@BYTE:<o>> <@BYTE:<m>> <@BYTE:<m>> <@BYTE:<e>> <@BYTE:<n>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (7), 287, 105, 110, 99, 108, 117, 100, 101,  /* <@STR:<include>>              ::= <@BYTE:<i>> <@BYTE:<n>> <@BYTE:<c>> <@BYTE:<l>> <@BYTE:<u>> <@BYTE:<d>> <@BYTE:<e>> */
	MARPATCL_RCMD_PRIO  (4), 288, 118, 115, 101, 116,                /* <@STR:<vset>>                 ::= <@BYTE:<v>> <@BYTE:<s>> <@BYTE:<e>> <@BYTE:<t>> */
	MARPATCL_RCMD_PRIO  (1), 289, 276,                               /* <ANY_UNBRACED>                ::= <@^CLS:<\173\175>> */
	MARPATCL_RCMD_PRIO  (1), 290, 123,                               /* <BL>                          ::= <@BYTE:<\173>> */
	MARPATCL_RCMD_PRIO  (1), 291, 125,                               /* <BR>                          ::= <@BYTE:<\175>> */
	MARPATCL_RCMD_PRIO  (1), 292, 283,                               /* <BRACE_ESCAPED>               ::= <@STR:<\134\173>> */
	MARPATCL_RCMD_PRIS  (1)     , 284,                               /*                               |   <@STR:<\134\175>> */
	MARPATCL_RCMD_PRIO  (3), 293, 290, 295, 291,                     /* <BRACED>                      ::= <BL> <BRACED_ELEMS> <BR> */
	MARPATCL_RCMD_PRIO  (1), 294, 289,                               /* <BRACED_ELEM>                 ::= <ANY_UNBRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 293,                               /*                               |   <BRACED> */
	MARPATCL_RCMD_PRIS  (1)     , 292,                               /*                               |   <BRACE_ESCAPED> */
	MARPATCL_RCMD_QUN   (295), 294,                                  /* <BRACED_ELEMS>                ::= <BRACED_ELEM> * */
	MARPATCL_RCMD_PRIO  (1), 296, 333,                               /* <BRAN<d9-d122>>               ::= <@BRAN:<\t\r>> */
	MARPATCL_RCMD_PRIS  (1)     , 297,                               /*                               |   <BRAN<d14-d122>> */
	MARPATCL_RCMD_PRIO  (1), 297, 327,                               /* <BRAN<d14-d122>>              ::= <@BRAN:<\16\37>> */
	MARPATCL_RCMD_PRIS  (1)     , 336,                               /*                               |   <BRAN<d32-d122>> */
	MARPATCL_RCMD_PRIO  (1), 298, 91,                                /* <CL>                          ::= <@CHR:<\133>> */
	MARPATCL_RCMD_PRIO  (5), 299, 298, 320, 323, 320, 302,           /* <COMMAND>                     ::= <CL> <WHITE0> <WORDS1> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (7), 300, 298, 320, 286, 321, 322, 320, 302, /* <COMMENT>                     ::= <CL> <WHITE0> <@STR:<comment>> <WHITE1> <WORD> <WHITE0> <CR> */
	MARPATCL_RCMD_PRIO  (4), 301, 314, 92, 304, 314,                 /* <CONTINUATION>                ::= <SPACE0> <@BYTE:<\134>> <NEWLINE> <SPACE0> */
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
	MARPATCL_RCMD_PRIS  (1)     , 309,                               /*                               |   <QUOTED> */
	MARPATCL_RCMD_PRIS  (1)     , 316,                               /*                               |   <UNQUOTED> */
	MARPATCL_RCMD_QUPS  (323), 322, MARPATCL_RCMD_SEP (321),         /* <WORDS1>                      ::= <WORD> + (<WHITE1>) */
	MARPATCL_RCMD_BRAN  (324), MARPATCL_RCMD_BOXR ( 33, 90),         /* <@BRAN:<!Z>>                  brange (33 - 90) */
	MARPATCL_RCMD_BRAN  (325), MARPATCL_RCMD_BOXR ( 35, 90),         /* <@BRAN:<#Z>>                  brange (35 - 90) */
	MARPATCL_RCMD_BRAN  (326), MARPATCL_RCMD_BOXR (  1,  8),         /* <@BRAN:<\1\10>>               brange (1 - 8) */
	MARPATCL_RCMD_BRAN  (327), MARPATCL_RCMD_BOXR ( 14, 31),         /* <@BRAN:<\16\37>>              brange (14 - 31) */
	MARPATCL_RCMD_BRAN  (328), MARPATCL_RCMD_BOXR (128,191),         /* <@BRAN:<\200\u00bf>>          brange (128 - 191) */
	MARPATCL_RCMD_BRAN  (329), MARPATCL_RCMD_BOXR (  9, 13),         /* <@BRAN:<\t\r>>                brange (9 - 13) */
	MARPATCL_RCMD_BRAN  (330), MARPATCL_RCMD_BOXR (160,175),         /* <@BRAN:<\u00a0\u00af>>        brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (331), MARPATCL_RCMD_BOXR (176,191),         /* <@BRAN:<\u00b0\u00bf>>        brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (332), MARPATCL_RCMD_BOXR (194,223),         /* <@BRAN:<\u00c2\u00df>>        brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (333), MARPATCL_RCMD_BOXR (225,239),         /* <@BRAN:<\u00e1\u00ef>>        brange (225 - 239) */
	MARPATCL_RCMD_BRAN  (334), MARPATCL_RCMD_BOXR ( 94,127),         /* <@BRAN:<^\177>>               brange (94 - 127) */
	MARPATCL_RCMD_BRAN  (335), MARPATCL_RCMD_BOXR (126,127),         /* <@BRAN:<~\177>>               brange (126 - 127) */
	MARPATCL_RCMD_BRAN  (336), MARPATCL_RCMD_BOXR ( 32,122),         /* <BRAN<d32-d122>>              brange (32 - 122) */
	MARPATCL_RCMD_PRIO  (2), 337, 256, 266,                          /* <@L0:START>                   ::= <@ACS:Braced> <Braced> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 267,                          /*                               |   <@ACS:Include> <Include> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 268,                          /*                               |   <@ACS:Quote> <Quote> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 269,                          /*                               |   <@ACS:Simple> <Simple> */







|
|
|
|
|
|







612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
	MARPATCL_RCMD_PRIS  (1)     , 309,                               /*                               |   <QUOTED> */
	MARPATCL_RCMD_PRIS  (1)     , 316,                               /*                               |   <UNQUOTED> */
	MARPATCL_RCMD_QUPS  (323), 322, MARPATCL_RCMD_SEP (321),         /* <WORDS1>                      ::= <WORD> + (<WHITE1>) */
	MARPATCL_RCMD_BRAN  (324), MARPATCL_RCMD_BOXR ( 33, 90),         /* <@BRAN:<!Z>>                  brange (33 - 90) */
	MARPATCL_RCMD_BRAN  (325), MARPATCL_RCMD_BOXR ( 35, 90),         /* <@BRAN:<#Z>>                  brange (35 - 90) */
	MARPATCL_RCMD_BRAN  (326), MARPATCL_RCMD_BOXR (  1,  8),         /* <@BRAN:<\1\10>>               brange (1 - 8) */
	MARPATCL_RCMD_BRAN  (327), MARPATCL_RCMD_BOXR ( 14, 31),         /* <@BRAN:<\16\37>>              brange (14 - 31) */
	MARPATCL_RCMD_BRAN  (328), MARPATCL_RCMD_BOXR (128,191),         /* <@BRAN:<\200\277>>            brange (128 - 191) */
	MARPATCL_RCMD_BRAN  (329), MARPATCL_RCMD_BOXR (160,175),         /* <@BRAN:<\240\257>>            brange (160 - 175) */
	MARPATCL_RCMD_BRAN  (330), MARPATCL_RCMD_BOXR (176,191),         /* <@BRAN:<\260\277>>            brange (176 - 191) */
	MARPATCL_RCMD_BRAN  (331), MARPATCL_RCMD_BOXR (194,223),         /* <@BRAN:<\302\337>>            brange (194 - 223) */
	MARPATCL_RCMD_BRAN  (332), MARPATCL_RCMD_BOXR (225,239),         /* <@BRAN:<\341\357>>            brange (225 - 239) */
	MARPATCL_RCMD_BRAN  (333), MARPATCL_RCMD_BOXR (  9, 13),         /* <@BRAN:<\t\r>>                brange (9 - 13) */
	MARPATCL_RCMD_BRAN  (334), MARPATCL_RCMD_BOXR ( 94,127),         /* <@BRAN:<^\177>>               brange (94 - 127) */
	MARPATCL_RCMD_BRAN  (335), MARPATCL_RCMD_BOXR (126,127),         /* <@BRAN:<~\177>>               brange (126 - 127) */
	MARPATCL_RCMD_BRAN  (336), MARPATCL_RCMD_BOXR ( 32,122),         /* <BRAN<d32-d122>>              brange (32 - 122) */
	MARPATCL_RCMD_PRIO  (2), 337, 256, 266,                          /* <@L0:START>                   ::= <@ACS:Braced> <Braced> */
	MARPATCL_RCMD_PRIS  (2)     , 257, 267,                          /*                               |   <@ACS:Include> <Include> */
	MARPATCL_RCMD_PRIS  (2)     , 258, 268,                          /*                               |   <@ACS:Quote> <Quote> */
	MARPATCL_RCMD_PRIS  (2)     , 259, 269,                          /*                               |   <@ACS:Simple> <Simple> */

Changes to languages/min-dt/mindt-sf-tcl.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::sf::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "mindt::parser::sf::tcl".
##	Generated On Wed Aug 15 21:14:06 PDT 2018
##		  By aku@hephaistos
##		 Via marpa-gen

package provide mindt::parser::sf::tcl 1

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing









|
|
|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                          http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar mindt::parser::sf::tcl By Andreas Kupries
##
##	`marpa::runtime::tcl`-derived Parser for grammar "mindt::parser::sf::tcl".
##	Generated On Fri Sep 07 15:24:37 PDT 2018
##		  By andreask@ten
##		 Via remeta

package provide mindt::parser::sf::tcl 0

# # ## ### ##### ######## #############
## Requisites

package require Tcl 8.5             ;# -- Foundation
package require TclOO               ;# -- Implies Tcl 8.5 requirement.
package require debug               ;# Tracing
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	}
    }

    method Discards {} {
	debug.mindt/parser/sf/tcl
	# Discarded symbols (whitespace)
	return {

	}
    }

    method L0.Symbols {} {
	# Non-lexeme, non-literal symbols
	debug.mindt/parser/sf/tcl
	return {







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	}
    }

    method Discards {} {
	debug.mindt/parser/sf/tcl
	# Discarded symbols (whitespace)
	return {
	    
	}
    }

    method L0.Symbols {} {
	# Non-lexeme, non-literal symbols
	debug.mindt/parser/sf/tcl
	return {

Changes to languages/min-dt/tests/common/mdt-core.testsuite.

1
2

3
4
5
6
7
8
9
# -*- tcl -*-
## (c) 2018-present Andreas Kupries

# # ## ### ##### ######## ############# #####################
## Execution core for testing the mini-doctools parser on top of
## different runtimes.
## Configured by the caller with procedures.
## - overall initialization and finalization
## - parser creation and destruction
## - AST result selection

|
>







1
2
3
4
5
6
7
8
9
10
# -*- tcl -*-
## (c) 2018-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                   http://core.tcl.tk/akupries/
# # ## ### ##### ######## ############# #####################
## Execution core for testing the mini-doctools parser on top of
## different runtimes.
## Configured by the caller with procedures.
## - overall initialization and finalization
## - parser creation and destruction
## - AST result selection
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56




57
58
59
60
61
62
63
kt check tcltest 2

kt require support debug
kt require support debug::caller
kt require support oo::util
kt require support TclOO
kt require support fileutil ;# cat

kt require support marpa::util
kt require support marpa::multi-stop

# Parser packages - See (xx)

# # ## ### ##### ######## ############# #####################
## Local shorthands

proc tnp      {} { return lang-mindt-rt_[rt]  }
proc lo       {} { return mindt::parser::[rt] }
proc hi       {} { return mindt::[rt] }
proc setup-lo {} { [lo] create PARSE }
proc setup-hi {} { [hi]   create PARSE }
proc cleanup  {} { PARSE destroy }

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source support/ast.tcl
kt source support/dirs.tcl
kt source support/textutils.tcl





# # ## ### ##### ######## ############# #####################
## (xx)

kt local testing mindt::base
kt local testing mindt::[rt]
kt local testing mindt::parser::[rt]







>
|
|



















|
|
|
>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
kt check tcltest 2

kt require support debug
kt require support debug::caller
kt require support oo::util
kt require support TclOO
kt require support fileutil ;# cat

kt l-require support marpa::util
kt l-require support marpa::multi-stop

# Parser packages - See (xx)

# # ## ### ##### ######## ############# #####################
## Local shorthands

proc tnp      {} { return lang-mindt-rt_[rt]  }
proc lo       {} { return mindt::parser::[rt] }
proc hi       {} { return mindt::[rt] }
proc setup-lo {} { [lo] create PARSE }
proc setup-hi {} { [hi]   create PARSE }
proc cleanup  {} { PARSE destroy }

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source ../../../tests/support/ast.tcl
kt source ../../../tests/support/dirs.tcl
kt source ../../../tests/support/textutils.tcl

if {([rt] eq "c") && [args-map]} {
    proc args x { string map {... {?args...?}} $x }
}

# # ## ### ##### ######## ############# #####################
## (xx)

kt local testing mindt::base
kt local testing mindt::[rt]
kt local testing mindt::parser::[rt]
96
97
98
99
100
101
102
103



104
105
106
107
108
109
110
    ## process - argument checking

    test [tnp]-process-1.1.$l "[$level] :: process, wrong args, not enough" -body {
	PARSE process
    }   -setup   setup-$level \
	-cleanup cleanup \
	-returnCodes error \
	-result {wrong # args: should be "PARSE process string ..."}




    # # ## ### ##### ######## ############# #####################
    ## process - Actual processing - Id formatting prep

    # # ## ### ##### ######## ############# #####################

    set inputs [lsort -dict [glob -directory [td]/dt/input *]]







|
>
>
>







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
    ## process - argument checking

    test [tnp]-process-1.1.$l "[$level] :: process, wrong args, not enough" -body {
	PARSE process
    }   -setup   setup-$level \
	-cleanup cleanup \
	-returnCodes error \
	-result [args {wrong # args: should be "PARSE process string ..."}]

    # Reset to regular for high-level interface.
    proc args {x} { set x }

    # # ## ### ##### ######## ############# #####################
    ## process - Actual processing - Id formatting prep

    # # ## ### ##### ######## ############# #####################

    set inputs [lsort -dict [glob -directory [td]/dt/input *]]

Changes to languages/min-dt/tests/common/sf-core.testsuite.

1
2

3
4
5
6
7
8
9
# -*- tcl -*-
## (c) 2018-present Andreas Kupries

# # ## ### ##### ######## ############# #####################
## Execution core for testing the mini-doctools parser on top of
## different runtimes.
## Configured by the caller with procedures.
## - overall initialization and finalization
## - parser creation and destruction
## - AST result selection

|
>







1
2
3
4
5
6
7
8
9
10
# -*- tcl -*-
## (c) 2018-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                   http://core.tcl.tk/akupries/
# # ## ### ##### ######## ############# #####################
## Execution core for testing the mini-doctools parser on top of
## different runtimes.
## Configured by the caller with procedures.
## - overall initialization and finalization
## - parser creation and destruction
## - AST result selection
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49




50
51
52
53
54
55
56
kt check tcltest 2

kt require support debug
kt require support debug::caller
kt require support oo::util
kt require support TclOO
kt require support fileutil ;# cat

kt require support marpa::util

# Parser packages - See (xx)

# # ## ### ##### ######## ############# #####################
## Local shorthands

proc tnp     {} { return lang-mindtsf-rt_[rt]  }
proc base    {} { return mindt::parser::sf }
proc cl      {} { return [base]::[rt] }
proc setup   {} { [cl] create PARSE }
proc cleanup {} { PARSE destroy }

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source support/ast.tcl
kt source support/dirs.tcl
kt source support/textutils.tcl





# # ## ### ##### ######## ############# #####################
## (xx)

kt local support [cl]

# # ## ### ##### ######## ############# #####################







>
|


















|
|
|
>
>
>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
kt check tcltest 2

kt require support debug
kt require support debug::caller
kt require support oo::util
kt require support TclOO
kt require support fileutil ;# cat

kt l-require support marpa::util

# Parser packages - See (xx)

# # ## ### ##### ######## ############# #####################
## Local shorthands

proc tnp     {} { return lang-mindtsf-rt_[rt]  }
proc base    {} { return mindt::parser::sf }
proc cl      {} { return [base]::[rt] }
proc setup   {} { [cl] create PARSE }
proc cleanup {} { PARSE destroy }

# # ## ### ##### ######## ############# #####################
## No method sequence checking for the parser.
## Methods can be called in any order.

# # ## ### ##### ######## ############# #####################

kt source ../../../tests/support/ast.tcl
kt source ../../../tests/support/dirs.tcl
kt source ../../../tests/support/textutils.tcl

if {([rt] eq "c") && [args-map]} {
    proc args x { string map {... {?args...?}} $x }
}

# # ## ### ##### ######## ############# #####################
## (xx)

kt local support [cl]

# # ## ### ##### ######## ############# #####################
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
## process - argument checking

test [tnp]-process-1.0 "[cl] :: process, wrong args, not enough" -body {
    PARSE process
}   -setup   setup     \
    -cleanup cleanup   \
    -returnCodes error \
    -result {wrong # args: should be "PARSE process string ..."}

# # ## ### ##### ######## ############# #####################
## process - Actual processing - Id formatting prep

# # ## ### ##### ######## ############# #####################

set inputs [lsort -dict [glob -directory [td]/sf/input *]]







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
## process - argument checking

test [tnp]-process-1.0 "[cl] :: process, wrong args, not enough" -body {
    PARSE process
}   -setup   setup     \
    -cleanup cleanup   \
    -returnCodes error \
    -result [args {wrong # args: should be "PARSE process string ..."}]

# # ## ### ##### ######## ############# #####################
## process - Actual processing - Id formatting prep

# # ## ### ##### ######## ############# #####################

set inputs [lsort -dict [glob -directory [td]/sf/input *]]

Deleted languages/min-dt/tests/support/ast.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support marpa::util

# Test suite support.
# # ## ### ##### ######## #############
## Pretty printing an AST coming out of the SLIF parser

proc ast-format {ast {step {  }}} {
    set lines {}
    ast-format-acc $ast {} $step
    return [join $lines \n]
}

proc ast-format-acc {ast indent step} {
    upvar 1 lines lines

    if {[string is integer [lindex $ast 0]]} {
	# Terminal, Data is offset, length, and lexeme value.
	lappend lines ${indent}@[marpa location show $ast]
	return
    }

    lassign $ast symbol children

    lappend lines $indent$symbol
    append indent $step
    foreach child $children {
	ast-format-acc $child $indent $step
    }
    return
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































Deleted languages/min-dt/tests/support/dirs.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- tcl -*-
##
# (c) 2018-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

# Test suite support.
# # ## ### ##### ######## #############
## Quick access to common directories of the testsuite.

proc td {} {
    return [file normalize $::tcltest::testsDirectory]
}

proc indir {args} {
    return [file normalize [file join [td] input {*}$args]]
}

proc redir {args} {
    return [file normalize [file join [td] result {*}$args]]
}

proc locate {base args} {
    foreach file $args {
	set path [file join $base $file]
	if {![file exists $path]} continue
	return $path
    }
    return -code error "Unable to find any of [join $args {, }] for $base"
}

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































Deleted languages/min-dt/tests/support/textutils.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- tcl -*-
##
# (c) 2017 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                          http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt require support fileutil

# Test suite support.
# # ## ### ##### ######## #############

proc fget  {path}     { fileutil::cat $path }
proc fgetc {path enc} { fileutil::cat -encoding $enc $path }

# # ## ### ##### ######## #############
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































Changes to slif-literal/lparser.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar marpa::slif::literal::parser 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "marpa::slif::literal::parser".
##	Generated On Thu Sep 06 20:46:28 PDT 2018
##		  By aku@hephaistos
##		 Via remeta
##
#* Space taken: 24956 bytes
##
#* Statistics
#* L0
#* - #Symbols:   772









|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar marpa::slif::literal::parser 0 By Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "marpa::slif::literal::parser".
##	Generated On Fri Sep 07 15:24:31 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 24956 bytes
##
#* Statistics
#* L0
#* - #Symbols:   772

Changes to slif-parser/parser.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar marpa::slif::parser 0 By Jeffrey Kegler + Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "marpa::slif::parser".
##	Generated On Thu Sep 06 20:46:26 PDT 2018
##		  By aku@hephaistos
##		 Via remeta
##
#* Space taken: 53372 bytes
##
#* Statistics
#* L0
#* - #Symbols:   999









|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- tcl -*-
##
# This template is BSD-licensed.
# (c) 2017-present Template - Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                                             http://core.tcl.tk/akupries/
##
# (c) 2018 Grammar marpa::slif::parser 0 By Jeffrey Kegler + Andreas Kupries
##
##	`marpa::runtime::c`-derived Parser for grammar "marpa::slif::parser".
##	Generated On Fri Sep 07 15:24:29 PDT 2018
##		  By andreask@ten
##		 Via remeta
##
#* Space taken: 53372 bytes
##
#* Statistics
#* L0
#* - #Symbols:   999

Added tests/lang-heredoc-rtc.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/heredoc/tests {
    kt::source heredoc-rtc.test
}

Added tests/lang-heredoc-tcl.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/heredoc/tests {
    kt::source heredoc-tcl.test
}

Added tests/lang-json-rtc.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/json/tests {
    kt::source json-rtc.test
}

Added tests/lang-json-tcl.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/json/tests {
    kt::source json-tcl.test
}

Added tests/lang-mindt-rtc.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/min-dt/tests {
    kt::source mindt-rtc.test
}

Added tests/lang-mindt-sf-rtc.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/min-dt/tests {
    kt::source mindt-sf-rtc.test
}

Added tests/lang-mindt-sf-tcl.test.











>
>
>
>
>
1
2
3
4
5
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/min-dt/tests {
    kt::source mindt-sf-tcl.test
}

Added tests/lang-mindt-tcl.test.









>
>
>
>
1
2
3
4
# -*- tcl -*- tcl.tk//DSL tcltest//EN//
kt::in ../languages/min-dt/tests {
    kt::source mindt-tcl.test
}

Changes to tests/support/ast.tcl.

1
2
3
4
5
6


7
8
9
10
11
12
13
# -*- tcl -*-
##
# (c) 2017-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                               http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.



# Test suite support.
# # ## ### ##### ######## #############
## Pretty printing an AST coming out of the SLIF parser

proc ast-format {ast {step {  }}} { ;#return $ast ; # RAW
    set lines {}






>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- tcl -*-
##
# (c) 2017-present Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#                               http://core.tcl.tk/akupries/
##
# This code is BSD-licensed.

kt l-require support marpa::util

# Test suite support.
# # ## ### ##### ######## #############
## Pretty printing an AST coming out of the SLIF parser

proc ast-format {ast {step {  }}} { ;#return $ast ; # RAW
    set lines {}

Changes to tests/support/textutils.tcl.

39
40
41
42
43
44
45


46
47
48
49
50
51
52
}

proc 2lines {path} {
    split [string trimright [fget $path]] \n
}

proc fget {path} { fileutil::cat $path }



proc strip-gc-comments {lines} {
    lmap line $lines {
	if {[string match {*GC comment*} $line]} continue
	set line
    }
}







>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
}

proc 2lines {path} {
    split [string trimright [fget $path]] \n
}

proc fget {path} { fileutil::cat $path }

proc fgetc {path enc} { fileutil::cat -encoding $enc $path }

proc strip-gc-comments {lines} {
    lmap line $lines {
	if {[string match {*GC comment*} $line]} continue
	set line
    }
}