Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch pt-work Excluding Merge-Ins
This is equivalent to a diff from 5e04b0e29a to af55e30def
2014-07-21
| ||
18:57 | Merged work on the parsetools into trunk. Very extended testsuite, and lots of bugfixes, especially in the area of error handling. Also fixes in the C runtime and generated code where long/void* size mismatches caused crashing. check-in: 598ddec2b2 user: andreask tags: trunk | |
2014-06-28
| ||
21:41 | Bring examples up to date with latest parser fixes and changes. check-in: 75d8a9a9c7 user: aku tags: pt-examples | |
21:18 | pt::parse::peg (C) - Updated with the fixes to the C generator. Updated all testsuite results with the same fixes. Closed-Leaf check-in: af55e30def user: aku tags: pt-work | |
21:17 | pt::rdengine (C) - Fixed the generation of error messages by the dynamic C runtime, i.e. made it generate proper lists. check-in: 5eca9d6009 user: aku tags: pt-work | |
2014-06-23
| ||
19:19 | amazon-s3, xsxp [2974624fff] Fixed bad example in documentation. check-in: 749a54b5ef user: andreask tags: trunk | |
2014-06-21
| ||
00:14 | Got latest changes from trunk check-in: 4689b3f226 user: andreask tags: pt-work | |
00:05 | Updated the embedded documentation for today's changes check-in: 5e04b0e29a user: andreask tags: trunk | |
2014-06-20
| ||
22:37 | fileutil :: [659fec4826]. Simplified TempFile a bit more Dropped bogus use of TRUNC. Removed superflous check implied by EXCL. Removed irrelevant loop delay. check-in: 9520c7d9d7 user: andreask tags: trunk | |
Changes to apps/pt.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 # activate commands below for execution from within the pt directory set self [file normalize [info script]] set selfdir [file dirname $self] lappend auto_path $selfdir [file dirname $selfdir] # When debugging package loading trouble, show the search paths #puts [join $auto_path \n] # # ## ### ##### ######## ############# ##################### | | > > | | 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 | #!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 # activate commands below for execution from within the pt directory set self [file normalize [info script]] set selfdir [file dirname $self] lappend auto_path $selfdir [file dirname $selfdir] # When debugging package loading trouble, show the search paths #puts [join $auto_path \n] # # ## ### ##### ######## ############# ##################### package require pt::pgen 1.0.3 package require pt::util package require fileutil package require try namespace eval ::pt::app { namespace export generate help namespace ensemble create } # # ## ### ##### ######## ############# ##################### proc main {} { global argv argv0 errorInfo if {![llength $argv]} { lappend argv help } if {[catch { set status [::pt::app {*}$argv] } msg]} { set elines [split $errorInfo \n] if {[llength $elines] == 3} { if {[string match *unknown* $msg]} { #puts stderr "$argv0 $msg" ::pt::app help exit 1 |
︙ | ︙ | |||
44 45 46 47 48 49 50 | exit 1 } } set prefix {INTERNAL ERROR :: } puts ${prefix}[join $elines \n$prefix] exit 1 } | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | exit 1 } } set prefix {INTERNAL ERROR :: } puts ${prefix}[join $elines \n$prefix] exit 1 } exit $status } # # ## ### ##### ######## ############# ##################### proc ::pt::app::helpHelp {} { return { @ help ?TOPIC? |
︙ | ︙ | |||
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | puts stderr "$argv0: Unknown help topic '$topic'" puts stderr "\tUse one of [linsert [join [Topics] {, }] end-1 or]" puts stderr "" } else { puts stderr \t[join [split [string map [list @ $argv0] [string trim [::pt::app::${topic}Help]]] \n] \n\t] puts stderr "" } } proc ::pt::app::Topics {} { namespace eval ::TEMP { namespace import ::pt::app::* } set commands [info commands ::TEMP::*] namespace delete ::TEMP | > | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | puts stderr "$argv0: Unknown help topic '$topic'" puts stderr "\tUse one of [linsert [join [Topics] {, }] end-1 or]" puts stderr "" } else { puts stderr \t[join [split [string map [list @ $argv0] [string trim [::pt::app::${topic}Help]]] \n] \n\t] puts stderr "" } return 0 } proc ::pt::app::Topics {} { namespace eval ::TEMP { namespace import ::pt::app::* } set commands [info commands ::TEMP::*] namespace delete ::TEMP |
︙ | ︙ | |||
107 108 109 110 111 112 113 | if {[llength $args] < 4} { # Just enough that the help code can extract the method name return -code error "wrong # args, should be \"@ generate ...\"" } set args [lassign $args parserformat] | | > < | | > > > | > > | > > > > > > > | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | if {[llength $args] < 4} { # Just enough that the help code can extract the method name return -code error "wrong # args, should be \"@ generate ...\"" } set args [lassign $args parserformat] lassign [lrange $args end-2 end] \ parserfile grammarformat grammarfile set args [Template [lrange $args 0 end-3]] lappend args -file $grammarfile puts "Reading $grammarformat $grammarfile ..." set grammar [fileutil::cat $grammarfile] puts "Generating a $parserformat parser ..." try { set parser [::pt::pgen $grammarformat $grammar $parserformat {*}$args] } trap {PT RDE SYNTAX} {e o} { puts [pt::util error2readable $e $grammar] return 1 } puts "Saving to $parserfile ..." fileutil::writeFile $parserfile $parser puts OK return 0 } # Lift template specifications from file paths to the file's contents. proc ::pt::app::Template {optiondict} { set res {} foreach {option value} $optiondict { |
︙ | ︙ |
Changes to embedded/man/files/apps/pt.n.
︙ | ︙ | |||
546 547 548 549 550 551 552 553 554 555 556 557 558 559 | For a simple value \fBX\fR without colons, like CLASS, the parser command will be \fBX\fR::\fBX\fR\&. Whereas for a namespaced value \fBX::Y\fR the parser command will be \fBX::Y\fR\&. .TP \fB-package\fR string The value of this option is the name of the package to generate\&. The default value is \fBPACKAGE\fR\&. .PP .SH "C PARSER" The \fBc\fR format is executable code, a parser for the grammar\&. The parser implementation is written in C and can be tweaked to the users' needs through a multitude of options\&. .PP The \fBcritcl\fR format, for example, is implemented as a canned | > > > > | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | For a simple value \fBX\fR without colons, like CLASS, the parser command will be \fBX\fR::\fBX\fR\&. Whereas for a namespaced value \fBX::Y\fR the parser command will be \fBX::Y\fR\&. .TP \fB-package\fR string The value of this option is the name of the package to generate\&. The default value is \fBPACKAGE\fR\&. .TP \fB-version\fR string The value of this option is the version of the package to generate\&. The default value is \fB1\fR\&. .PP .SH "C PARSER" The \fBc\fR format is executable code, a parser for the grammar\&. The parser implementation is written in C and can be tweaked to the users' needs through a multitude of options\&. .PP The \fBcritcl\fR format, for example, is implemented as a canned |
︙ | ︙ | |||
706 707 708 709 710 711 712 713 714 715 716 717 718 719 | .TP \fB-package\fR string The value of this option is the name of the package to generate, without leading colons\&. Note, it serves double-duty as the name of the class to generate too, if option \fB-class\fR is not specified, see above\&. The default value is \fBPACKAGE\fR, applying if neither option \fB-package\fR nor \fB-class\fR were specified\&. .PP .SH "TCLOO PARSER" The \fBoo\fR format is executable code, a parser for the grammar\&. It is a Tcl package holding a \fBTclOO\fR class, whose instances are parsers for the input grammar\&. .PP This result-format supports the following options: | > > > > | 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 | .TP \fB-package\fR string The value of this option is the name of the package to generate, without leading colons\&. Note, it serves double-duty as the name of the class to generate too, if option \fB-class\fR is not specified, see above\&. The default value is \fBPACKAGE\fR, applying if neither option \fB-package\fR nor \fB-class\fR were specified\&. .TP \fB-version\fR string The value of this option is the version of the package to generate\&. The default value is \fB1\fR\&. .PP .SH "TCLOO PARSER" The \fBoo\fR format is executable code, a parser for the grammar\&. It is a Tcl package holding a \fBTclOO\fR class, whose instances are parsers for the input grammar\&. .PP This result-format supports the following options: |
︙ | ︙ | |||
740 741 742 743 744 745 746 747 748 749 750 751 752 753 | .TP \fB-package\fR string The value of this option is the name of the package to generate, without leading colons\&. Note, it serves double-duty as the name of the class to generate too, if option \fB-class\fR is not specified, see above\&. The default value is \fBPACKAGE\fR, applying if neither option \fB-package\fR nor \fB-class\fR were specified\&. .PP .SH "GRAMMAR CONTAINER" The \fBcontainer\fR format is another form of describing parsing expression grammars\&. While data in this format is executable it does not constitute a parser for the grammar\&. It always has to be used in conjunction with the package \fBpt::peg::interp\fR, a grammar interpreter\&. | > > > > | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | .TP \fB-package\fR string The value of this option is the name of the package to generate, without leading colons\&. Note, it serves double-duty as the name of the class to generate too, if option \fB-class\fR is not specified, see above\&. The default value is \fBPACKAGE\fR, applying if neither option \fB-package\fR nor \fB-class\fR were specified\&. .TP \fB-version\fR string The value of this option is the version of the package to generate\&. The default value is \fB1\fR\&. .PP .SH "GRAMMAR CONTAINER" The \fBcontainer\fR format is another form of describing parsing expression grammars\&. While data in this format is executable it does not constitute a parser for the grammar\&. It always has to be used in conjunction with the package \fBpt::peg::interp\fR, a grammar interpreter\&. |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_cparam_config_critcl.n.
1 2 3 4 | '\" '\" Generated from file 'pt_cparam_config_critcl\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_cparam_config_critcl\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::cparam::configuration::critcl" n 1\&.0\&.2 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::cparam::configuration::critcl \- C/PARAM, Canned configuration, Critcl .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | .. .BS .SH NAME pt::cparam::configuration::critcl \- C/PARAM, Canned configuration, Critcl .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::cparam::configuration::critcl ?1\&.0\&.2?\fR .sp \fB::pt::cparam::configuration::critcl\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the |
︙ | ︙ | |||
297 298 299 300 301 302 303 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP | | | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP \fB::pt::cparam::configuration::critcl\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR The command applies the configuration provided by this package to the \fIcmdprefix\fR, causing the creation of \fBcritcl\fR-based parsers whose class is \fIname\fR, in package \fIpkg\fR with \fIversion\fR\&. .sp The use of a command prefix as API allows application of the configuration to not only \fBpt::peg::to::cparam\fR (\fBpt::peg::to::cparam configure\fR), but also export manager instances and PEG containers (\fB$export configuration set\fR and \fB[$container exporter] configuration set\fR respectively)\&. .sp |
︙ | ︙ |
Added embedded/man/files/modules/pt/pt_cparam_config_tea.n.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | '\" '\" Generated from file 'pt_cparam_config_tea\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::cparam::configuration::tea" n 0\&.1 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, .\" and indent is equivalent to second arg of .IP (shouldn't ever be .\" needed; use .AS below instead) .\" .\" .AS ?type? ?name? .\" Give maximum sizes of arguments for setting tab stops. Type and .\" name are examples of largest possible arguments that will be passed .\" to .AP later. If args are omitted, default tab stops are used. .\" .\" .BS .\" Start box enclosure. From here until next .BE, everything will be .\" enclosed in one large box. .\" .\" .BE .\" End of box enclosure. .\" .\" .CS .\" Begin code excerpt. .\" .\" .CE .\" End code excerpt. .\" .\" .VS ?version? ?br? .\" Begin vertical sidebar, for use in marking newly-changed parts .\" of man pages. The first argument is ignored and used for recording .\" the version when the .VS was added, so that the sidebars can be .\" found and removed when they reach a certain age. If another argument .\" is present, then a line break is forced before starting the sidebar. .\" .\" .VE .\" End of vertical sidebar. .\" .\" .DS .\" Begin an indented unfilled display. .\" .\" .DE .\" End of indented unfilled display. .\" .\" .SO ?manpage? .\" Start of list of standard options for a Tk widget. The manpage .\" argument defines where to look up the standard options; if .\" omitted, defaults to "options". The options follow on successive .\" lines, in three columns separated by tabs. .\" .\" .SE .\" End of list of standard options for a Tk widget. .\" .\" .OP cmdName dbName dbClass .\" Start of description of a specific option. cmdName gives the .\" option's name as specified in the class command, dbName gives .\" the option's name in the option database, and dbClass gives .\" the option's class in the option database. .\" .\" .UL arg1 arg2 .\" Print arg1 underlined, then print arg2 normally. .\" .\" .QW arg1 ?arg2? .\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). .\" .\" .PQ arg1 ?arg2? .\" Print an open parenthesis, arg1 in quotes, then arg2 normally .\" (for trailing punctuation) and then a closing parenthesis. .\" .\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .\" # Start an argument description .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .\" # define tabbing values for .AP .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .\" # BS - start boxed text .\" # ^y = starting y location .\" # ^b = 1 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .\" # BE - end boxed text (draw box now) .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .\" # VS - start vertical sidebar .\" # ^Y = starting y location .\" # ^v = 1 (for troff; for nroff this doesn't matter) .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .\" # VE - end of vertical sidebar .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .\" # Special macro to handle page bottom: finish off current .\" # box/sidebar if in box/sidebar mode, then invoked standard .\" # page bottom macro. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .\" # SO - start of list of standard options .de SO 'ie '\\$1'' .ds So \\fBoptions\\fR 'el .ds So \\fB\\$1\\fR .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .\" # SE - end of list of standard options .de SE .fi .ft R .LP See the \\*(So manual entry for details on the standard options. .. .\" # OP - start of full description for a single option .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .\" # CS - begin code excerpt .de CS .RS .nf .ta .25i .5i .75i 1i .. .\" # CE - end code excerpt .de CE .fi .RE .. .\" # UL - underline word .de UL \\$1\l'|0\(ul'\\$2 .. .\" # QW - apply quotation marks to word .de QW .ie '\\*(lq'"' ``\\$1''\\$2 .\"" fix emacs highlighting .el \\*(lq\\$1\\*(rq\\$2 .. .\" # PQ - apply parens and quotation marks to word .de PQ .ie '\\*(lq'"' (``\\$1''\\$2)\\$3 .\"" fix emacs highlighting .el (\\*(lq\\$1\\*(rq\\$2)\\$3 .. .\" # QR - quoted range .de QR .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 .\"" fix emacs highlighting .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 .. .\" # MT - "empty" string .de MT .QW "" .. .BS .SH NAME pt::cparam::configuration::tea \- C/PARAM, Canned configuration, TEA .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::cparam::configuration::tea ?0\&.1?\fR .sp \fB::pt::cparam::configuration::tea\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the \fIIntroduction to Parser Tools\fR\&. This document is the entrypoint to the whole system the current package is a part of\&. .PP This package is an adjunct to \fBpt::peg::to::cparam\fR, to make the use of this highly configurable package easier by providing a canned configuration\&. When applied this configuration causes the package \fBpt::peg::to::cparam\fR to generate plain parser code ready for inclusion into a \fITEA\fR-based C extension\&. .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP \fB::pt::cparam::configuration::tea\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR The command applies the configuration provided by this package to the \fIcmdprefix\fR, causing the creation of \fBtea\fR-based parsers whose class is \fIname\fR, in package \fIpkg\fR with \fIversion\fR\&. .sp The use of a command prefix as API allows application of the configuration to not only \fBpt::peg::to::cparam\fR (\fBpt::peg::to::cparam configure\fR), but also export manager instances and PEG containers (\fB$export configuration set\fR and \fB[$container exporter] configuration set\fR respectively)\&. .sp Or anything other command prefix accepting two arguments, option and value\&. .PP .SH "BUGS, IDEAS, FEEDBACK" This document, and the package it describes, will undoubtedly contain bugs and other problems\&. Please report such in the category \fIpt\fR of the \fITcllib Trackers\fR [http://core\&.tcl\&.tk/tcllib/reportlist]\&. Please also report any ideas for enhancements you may have for either package and/or documentation\&. .SH KEYWORDS EBNF, LL(k), PEG, TDPL, context-free languages, expression, grammar, matching, parser, parsing expression, parsing expression grammar, push down automaton, recursive descent, state, top-down parsing languages, transducer .SH CATEGORY Parsing and Grammars .SH COPYRIGHT .nf Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> .fi |
Changes to embedded/man/files/modules/pt/pt_peg_export_peg.n.
︙ | ︙ | |||
404 405 406 407 408 409 410 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\\\" [nrt'"\\[\\]\\\\] ; leaf: CharOctalFull <- "\\\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\\\" \&. ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value\&. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals\&. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_from_peg.n.
1 2 3 4 | '\" '\" Generated from file 'from\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'from\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::peg::from::peg" n 1\&.0\&.3 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::peg::from::peg \- PEG Conversion\&. Read PEG format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::peg::from::peg \- PEG Conversion\&. Read PEG format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::peg::from::peg ?1\&.0\&.3?\fR .sp \fBpt::peg::from::peg\fR \fBconvert\fR \fItext\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? |
︙ | ︙ | |||
354 355 356 357 358 359 360 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\\\" [nrt'"\\[\\]\\\\] ; leaf: CharOctalFull <- "\\\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\\\" \&. ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value\&. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals\&. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_import_peg.n.
︙ | ︙ | |||
367 368 369 370 371 372 373 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\\\" [nrt'"\\[\\]\\\\] ; leaf: CharOctalFull <- "\\\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\\\" \&. ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value\&. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals\&. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_interp.n.
1 2 3 4 | '\" '\" Generated from file 'pt_peg_interp\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_peg_interp\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::peg::interp" n 1\&.0\&.1 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::peg::interp \- Interpreter for parsing expression grammars .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::peg::interp \- Interpreter for parsing expression grammars .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::peg::interp ?1\&.0\&.1?\fR .sp package require \fBpt::rde ?1?\fR .sp package require \fBsnit \fR .sp \fB::pt::peg::interp\fR \fIobjectName\fR \fIgrammar\fR .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_language.n.
︙ | ︙ | |||
631 632 633 634 635 636 637 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\\\" [nrt'"\\[\\]\\\\] ; leaf: CharOctalFull <- "\\\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\\\" \&. ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value\&. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals\&. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_to_cparam.n.
1 2 3 4 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::peg::to::cparam" n 1\&.1\&.2 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::peg::to::cparam \- PEG Conversion\&. Write CPARAM format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::peg::to::cparam \- PEG Conversion\&. Write CPARAM format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::peg::to::cparam ?1\&.1\&.2?\fR .sp \fBpt::peg::to::cparam\fR \fBreset\fR .sp \fBpt::peg::to::cparam\fR \fBconfigure\fR .sp \fBpt::peg::to::cparam\fR \fBconfigure\fR \fIoption\fR .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_to_peg.n.
1 2 3 4 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::peg::to::peg" n 1\&.0\&.2 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::peg::to::peg \- PEG Conversion\&. Write PEG format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::peg::to::peg \- PEG Conversion\&. Write PEG format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::peg::to::peg ?1\&.0\&.2?\fR .sp package require \fBpt::peg \fR .sp package require \fBpt::pe \fR .sp package require \fBtext::write \fR .sp |
︙ | ︙ | |||
426 427 428 429 430 431 432 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\\\" [nrt'"\\[\\]\\\\] ; leaf: CharOctalFull <- "\\\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\\\" \&. ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value\&. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals\&. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_peg_to_tclparam.n.
1 2 3 4 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'to\&.inc' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::peg::to::tclparam" n 1\&.0\&.1 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::peg::to::tclparam \- PEG Conversion\&. Write TCLPARAM format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::peg::to::tclparam \- PEG Conversion\&. Write TCLPARAM format .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::peg::to::tclparam ?1\&.0\&.1?\fR .sp \fBpt::peg::to::tclparam\fR \fBreset\fR .sp \fBpt::peg::to::tclparam\fR \fBconfigure\fR .sp \fBpt::peg::to::tclparam\fR \fBconfigure\fR \fIoption\fR .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_pexpression.n.
1 2 3 4 | '\" '\" Generated from file 'pt_pexpression\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_pexpression\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::pe" n 1\&.0\&.1 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::pe \- Parsing Expression Serialization .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::pe \- Parsing Expression Serialization .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::pe ?1\&.0\&.1?\fR .sp package require \fBchar \fR .sp \fB::pt::pe\fR \fBverify\fR \fIserial\fR ?\fIcanonvar\fR? .sp \fB::pt::pe\fR \fBverify-as-canonical\fR \fIserial\fR .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_rdengine.n.
1 2 3 4 | '\" '\" Generated from file 'pt_rdengine\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_rdengine\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::rde" n 1\&.0\&.3 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::rde \- Parsing Runtime Support, PARAM based .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .. .BS .SH NAME pt::rde \- Parsing Runtime Support, PARAM based .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::rde ?1\&.0\&.3?\fR .sp package require \fBsnit \fR .sp package require \fBstruct::stack 1\&.4\fR .sp package require \fBpt::ast 1\&.1\fR .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_tclparam_config_snit.n.
1 2 3 4 | '\" '\" Generated from file 'pt_tclparam_config_snit\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_tclparam_config_snit\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::tclparam::configuration::snit" n 1\&.0\&.2 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::tclparam::configuration::snit \- Tcl/PARAM, Canned configuration, Snit .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | .. .BS .SH NAME pt::tclparam::configuration::snit \- Tcl/PARAM, Canned configuration, Snit .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::tclparam::configuration::snit ?1\&.0\&.2?\fR .sp \fB::pt::tclparam::configuration::snit\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the |
︙ | ︙ | |||
297 298 299 300 301 302 303 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP | | | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP \fB::pt::tclparam::configuration::snit\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR The command applies the configuration provided by this package to the \fIcmdprefix\fR, causing the creation of \fBsnit\fR-based parsers whose class is \fIname\fR, in package \fIpkg\fR with \fIversion\fR\&. .sp The use of a command prefix as API allows application of the configuration to not only \fBpt::peg::to::tclparam\fR (\fBpt::peg::to::tclparam configure\fR), but also export manager instances and PEG containers (\fB$export configuration set\fR and \fB[$container exporter] configuration set\fR respectively)\&. .sp |
︙ | ︙ |
Changes to embedded/man/files/modules/pt/pt_tclparam_config_tcloo.n.
1 2 3 4 | '\" '\" Generated from file 'pt_tclparam_config_tcloo\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" | | | 1 2 3 4 5 6 7 8 9 10 11 12 | '\" '\" Generated from file 'pt_tclparam_config_tcloo\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::tclparam::configuration::tcloo" n 1\&.0\&.4 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, |
︙ | ︙ | |||
272 273 274 275 276 277 278 | .. .BS .SH NAME pt::tclparam::configuration::tcloo \- Tcl/PARAM, Canned configuration, Tcloo .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp | | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | .. .BS .SH NAME pt::tclparam::configuration::tcloo \- Tcl/PARAM, Canned configuration, Tcloo .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::tclparam::configuration::tcloo ?1\&.0\&.4?\fR .sp \fB::pt::tclparam::configuration::tcloo\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the |
︙ | ︙ | |||
297 298 299 300 301 302 303 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP | | | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | .PP It is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP \fB::pt::tclparam::configuration::tcloo\fR \fBdef\fR \fIname\fR \fIpkg\fR \fIversion\fR \fIcmdprefix\fR The command applies the configuration provided by this package to the \fIcmdprefix\fR, causing the creation of \fBOO\fR-based parsers whose class is \fIname\fR, in package \fIpkg\fR with \fIversion\fR\&. .sp The use of a command prefix as API allows application of the configuration to not only \fBpt::peg::to::tclparam\fR (\fBpt::peg::to::tclparam configure\fR), but also export manager instances and PEG containers (\fB$export configuration set\fR and \fB[$container exporter] configuration set\fR respectively)\&. .sp |
︙ | ︙ |
Added embedded/man/files/modules/pt/pt_util.n.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | '\" '\" Generated from file 'pt_util\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> '\" .TH "pt::util" n 1 tcllib "Parser Tools" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. .\" type is type of argument (int, etc.), in/out is either "in", "out", .\" or "in/out" to describe whether procedure reads or modifies arg, .\" and indent is equivalent to second arg of .IP (shouldn't ever be .\" needed; use .AS below instead) .\" .\" .AS ?type? ?name? .\" Give maximum sizes of arguments for setting tab stops. Type and .\" name are examples of largest possible arguments that will be passed .\" to .AP later. If args are omitted, default tab stops are used. .\" .\" .BS .\" Start box enclosure. From here until next .BE, everything will be .\" enclosed in one large box. .\" .\" .BE .\" End of box enclosure. .\" .\" .CS .\" Begin code excerpt. .\" .\" .CE .\" End code excerpt. .\" .\" .VS ?version? ?br? .\" Begin vertical sidebar, for use in marking newly-changed parts .\" of man pages. The first argument is ignored and used for recording .\" the version when the .VS was added, so that the sidebars can be .\" found and removed when they reach a certain age. If another argument .\" is present, then a line break is forced before starting the sidebar. .\" .\" .VE .\" End of vertical sidebar. .\" .\" .DS .\" Begin an indented unfilled display. .\" .\" .DE .\" End of indented unfilled display. .\" .\" .SO ?manpage? .\" Start of list of standard options for a Tk widget. The manpage .\" argument defines where to look up the standard options; if .\" omitted, defaults to "options". The options follow on successive .\" lines, in three columns separated by tabs. .\" .\" .SE .\" End of list of standard options for a Tk widget. .\" .\" .OP cmdName dbName dbClass .\" Start of description of a specific option. cmdName gives the .\" option's name as specified in the class command, dbName gives .\" the option's name in the option database, and dbClass gives .\" the option's class in the option database. .\" .\" .UL arg1 arg2 .\" Print arg1 underlined, then print arg2 normally. .\" .\" .QW arg1 ?arg2? .\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). .\" .\" .PQ arg1 ?arg2? .\" Print an open parenthesis, arg1 in quotes, then arg2 normally .\" (for trailing punctuation) and then a closing parenthesis. .\" .\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .\" # Start an argument description .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .\" # define tabbing values for .AP .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .\" # BS - start boxed text .\" # ^y = starting y location .\" # ^b = 1 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .\" # BE - end boxed text (draw box now) .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .\" # VS - start vertical sidebar .\" # ^Y = starting y location .\" # ^v = 1 (for troff; for nroff this doesn't matter) .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .\" # VE - end of vertical sidebar .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .\" # Special macro to handle page bottom: finish off current .\" # box/sidebar if in box/sidebar mode, then invoked standard .\" # page bottom macro. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .\" # SO - start of list of standard options .de SO 'ie '\\$1'' .ds So \\fBoptions\\fR 'el .ds So \\fB\\$1\\fR .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .\" # SE - end of list of standard options .de SE .fi .ft R .LP See the \\*(So manual entry for details on the standard options. .. .\" # OP - start of full description for a single option .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .\" # CS - begin code excerpt .de CS .RS .nf .ta .25i .5i .75i 1i .. .\" # CE - end code excerpt .de CE .fi .RE .. .\" # UL - underline word .de UL \\$1\l'|0\(ul'\\$2 .. .\" # QW - apply quotation marks to word .de QW .ie '\\*(lq'"' ``\\$1''\\$2 .\"" fix emacs highlighting .el \\*(lq\\$1\\*(rq\\$2 .. .\" # PQ - apply parens and quotation marks to word .de PQ .ie '\\*(lq'"' (``\\$1''\\$2)\\$3 .\"" fix emacs highlighting .el (\\*(lq\\$1\\*(rq\\$2)\\$3 .. .\" # QR - quoted range .de QR .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 .\"" fix emacs highlighting .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 .. .\" # MT - "empty" string .de MT .QW "" .. .BS .SH NAME pt::util \- General utilities .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBpt::ast ?1?\fR .sp \fB::pt::util\fR \fBerror2readable\fR \fIerror\fR \fItext\fR .sp \fB::pt::util\fR \fBerror2position\fR \fIerror\fR \fItext\fR .sp \fB::pt::util\fR \fBerror2text\fR \fIerror\fR .sp .BE .SH DESCRIPTION .PP Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the \fIIntroduction to Parser Tools\fR\&. This document is the entrypoint to the whole system the current package is a part of\&. .PP This package provides general utility commands\&. .PP This is a supporting package in the Core Layer of Parser Tools\&. .PP IMAGE: arch_core_support .PP .SH API .TP \fB::pt::util\fR \fBerror2readable\fR \fIerror\fR \fItext\fR This command takes the structured form of a syntax \fIerror\fR as thrown by parser runtimes and the input \fItext\fR to the parser which caused that error and returns a string describing the error in a human-readable form\&. .sp The input \fItext\fR is required to convert the character position of the error into a more readable line/column format, and to provide excerpts of the input around the error position\&. .TP \fB::pt::util\fR \fBerror2position\fR \fIerror\fR \fItext\fR This command takes the structured form of a syntax \fIerror\fR as thrown by parser runtimes and the input \fItext\fR to the parser which caused that error and returns a 2-element list containing the line number and column index for the error's character position in the input, in this order\&. .TP \fB::pt::util\fR \fBerror2text\fR \fIerror\fR This command takes the structured form of a syntax \fIerror\fR as thrown by parser runtimes and returns a list of strings, each describing a possible expected input in a human-readable form\&. .PP .SH "BUGS, IDEAS, FEEDBACK" This document, and the package it describes, will undoubtedly contain bugs and other problems\&. Please report such in the category \fIpt\fR of the \fITcllib Trackers\fR [http://core\&.tcl\&.tk/tcllib/reportlist]\&. Please also report any ideas for enhancements you may have for either package and/or documentation\&. .SH KEYWORDS EBNF, LL(k), PEG, TDPL, context-free languages, expression, grammar, matching, parser, parsing expression, parsing expression grammar, push down automaton, recursive descent, state, top-down parsing languages, transducer .SH CATEGORY Parsing and Grammars .SH COPYRIGHT .nf Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net> .fi |
Changes to embedded/man/index.n.
︙ | ︙ | |||
1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ | |||
10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP | > > > | 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 | pt .TP \fBfiles/modules/pt/pt_astree\&.n\fR pt::ast .TP \fBfiles/modules/pt/pt_cparam_config_critcl\&.n\fR pt::cparam::configuration::critcl .TP \fBfiles/modules/pt/pt_cparam_config_tea\&.n\fR pt::cparam::configuration::tea .TP \fBfiles/modules/pt/pt_json_language\&.n\fR pt::json_language .TP \fBfiles/modules/pt/pt_param\&.n\fR pt::param .TP |
︙ | ︙ | |||
10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP | > > > | 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 | pt::rde .TP \fBfiles/modules/pt/pt_tclparam_config_snit\&.n\fR pt::tclparam::configuration::snit .TP \fBfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR pt::tclparam::configuration::tcloo .TP \fBfiles/modules/pt/pt_util\&.n\fR pt::util .TP \fBfiles/modules/pt/pt_to_api\&.n\fR pt_export_api .TP \fBfiles/modules/pt/pt_from_api\&.n\fR pt_import_api .TP |
︙ | ︙ |
Changes to embedded/man/toc.n.
︙ | ︙ | |||
944 945 946 947 948 949 950 951 952 953 954 955 956 957 | .TP \fBpt::ast\fR \fIfiles/modules/pt/pt_astree\&.n\fR: Abstract Syntax Tree Serialization .TP \fBpt::cparam::configuration::critcl\fR \fIfiles/modules/pt/pt_cparam_config_critcl\&.n\fR: C/PARAM, Canned configuration, Critcl .TP \fBpt::json_language\fR \fIfiles/modules/pt/pt_json_language\&.n\fR: The JSON Grammar Exchange Format .TP \fBpt::param\fR \fIfiles/modules/pt/pt_param\&.n\fR: PackRat Machine Specification .TP \fBpt::pe\fR | > > > | 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | .TP \fBpt::ast\fR \fIfiles/modules/pt/pt_astree\&.n\fR: Abstract Syntax Tree Serialization .TP \fBpt::cparam::configuration::critcl\fR \fIfiles/modules/pt/pt_cparam_config_critcl\&.n\fR: C/PARAM, Canned configuration, Critcl .TP \fBpt::cparam::configuration::tea\fR \fIfiles/modules/pt/pt_cparam_config_tea\&.n\fR: C/PARAM, Canned configuration, TEA .TP \fBpt::json_language\fR \fIfiles/modules/pt/pt_json_language\&.n\fR: The JSON Grammar Exchange Format .TP \fBpt::param\fR \fIfiles/modules/pt/pt_param\&.n\fR: PackRat Machine Specification .TP \fBpt::pe\fR |
︙ | ︙ | |||
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 | .TP \fBpt::tclparam::configuration::snit\fR \fIfiles/modules/pt/pt_tclparam_config_snit\&.n\fR: Tcl/PARAM, Canned configuration, Snit .TP \fBpt::tclparam::configuration::tcloo\fR \fIfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR: Tcl/PARAM, Canned configuration, Tcloo .TP \fBpt_export_api\fR \fIfiles/modules/pt/pt_to_api\&.n\fR: Parser Tools Export API .TP \fBpt_import_api\fR \fIfiles/modules/pt/pt_from_api\&.n\fR: Parser Tools Import API .TP \fBpt_introduction\fR | > > > | 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | .TP \fBpt::tclparam::configuration::snit\fR \fIfiles/modules/pt/pt_tclparam_config_snit\&.n\fR: Tcl/PARAM, Canned configuration, Snit .TP \fBpt::tclparam::configuration::tcloo\fR \fIfiles/modules/pt/pt_tclparam_config_tcloo\&.n\fR: Tcl/PARAM, Canned configuration, Tcloo .TP \fBpt::util\fR \fIfiles/modules/pt/pt_util\&.n\fR: General utilities .TP \fBpt_export_api\fR \fIfiles/modules/pt/pt_to_api\&.n\fR: Parser Tools Export API .TP \fBpt_import_api\fR \fIfiles/modules/pt/pt_from_api\&.n\fR: Parser Tools Import API .TP \fBpt_introduction\fR |
︙ | ︙ |
Changes to embedded/www/index.html.
︙ | ︙ | |||
746 747 748 749 750 751 752 | <td class="#idxleft" width="35%"><a name="key23"> context-free grammar </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key4"> context-free languages </a></td> <td class="#idxright" width="65%"> | | | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | <td class="#idxleft" width="35%"><a name="key23"> context-free grammar </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key4"> context-free languages </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key95"> control </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/control/control.html"> control </a> · <a href="tcllib/files/modules/term/term.html"> term </a> · <a href="tcllib/files/modules/term/ansi_code.html"> term::ansi::code </a> · <a href="tcllib/files/modules/term/ansi_cattr.html"> term::ansi::code::attr </a> · <a href="tcllib/files/modules/term/ansi_cctrl.html"> term::ansi::code::ctrl </a> · <a href="tcllib/files/modules/term/ansi_cmacros.html"> term::ansi::code::macros </a> · <a href="tcllib/files/modules/term/ansi_ctrlu.html"> term::ansi::ctrl::unix </a> · <a href="tcllib/files/modules/term/ansi_send.html"> term::ansi::send </a> · <a href="tcllib/files/modules/term/imenu.html"> term::interact::menu </a> · <a href="tcllib/files/modules/term/ipager.html"> term::interact::pager </a> · <a href="tcllib/files/modules/term/receive.html"> term::receive </a> · <a href="tcllib/files/modules/term/term_bind.html"> term::receive::bind </a> · <a href="tcllib/files/modules/term/term_send.html"> term::send </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
1212 1213 1214 1215 1216 1217 1218 | <td class="#idxleft" width="35%"><a name="key816"> earley </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key3"> EBNF </a></td> <td class="#idxright" width="65%"> | | | 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | <td class="#idxleft" width="35%"><a name="key816"> earley </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key3"> EBNF </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key496"> eccentricity </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/struct/graphops.html"> struct::graph::op </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
1352 1353 1354 1355 1356 1357 1358 | <td class="#idxleft" width="35%"><a name="key256"> export </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/doctools2base/html_cssdefaults.html"> doctools::html::cssdefaults </a> · <a href="tcllib/files/modules/doctools2idx/idx_export.html"> doctools::idx::export </a> · <a href="tcllib/files/modules/doctools2idx/export_docidx.html"> doctools::idx::export::docidx </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_html.html"> doctools::idx::export::html </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_json.html"> doctools::idx::export::json </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_nroff.html"> doctools::idx::export::nroff </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_text.html"> doctools::idx::export::text </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_wiki.html"> doctools::idx::export::wiki </a> · <a href="tcllib/files/modules/doctools2base/nroff_manmacros.html"> doctools::nroff::man_macros </a> · <a href="tcllib/files/modules/doctools2toc/toc_export.html"> doctools::toc::export </a> · <a href="tcllib/files/modules/doctools2toc/export_doctoc.html"> doctools::toc::export::doctoc </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_html.html"> doctools::toc::export::html </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_json.html"> doctools::toc::export::json </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_nroff.html"> doctools::toc::export::nroff </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_text.html"> doctools::toc::export::text </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_wiki.html"> doctools::toc::export::wiki </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key0"> expression </a></td> <td class="#idxright" width="65%"> | | | 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 | <td class="#idxleft" width="35%"><a name="key256"> export </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/doctools2base/html_cssdefaults.html"> doctools::html::cssdefaults </a> · <a href="tcllib/files/modules/doctools2idx/idx_export.html"> doctools::idx::export </a> · <a href="tcllib/files/modules/doctools2idx/export_docidx.html"> doctools::idx::export::docidx </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_html.html"> doctools::idx::export::html </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_json.html"> doctools::idx::export::json </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_nroff.html"> doctools::idx::export::nroff </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_text.html"> doctools::idx::export::text </a> · <a href="tcllib/files/modules/doctools2idx/idx_export_wiki.html"> doctools::idx::export::wiki </a> · <a href="tcllib/files/modules/doctools2base/nroff_manmacros.html"> doctools::nroff::man_macros </a> · <a href="tcllib/files/modules/doctools2toc/toc_export.html"> doctools::toc::export </a> · <a href="tcllib/files/modules/doctools2toc/export_doctoc.html"> doctools::toc::export::doctoc </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_html.html"> doctools::toc::export::html </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_json.html"> doctools::toc::export::json </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_nroff.html"> doctools::toc::export::nroff </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_text.html"> doctools::toc::export::text </a> · <a href="tcllib/files/modules/doctools2toc/toc_export_wiki.html"> doctools::toc::export::wiki </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key0"> expression </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key87"> extended namespace </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/namespacex/namespacex.html"> namespacex </a> </td></tr> <tr class="#idxheader"><th colspan="2"> |
︙ | ︙ | |||
1623 1624 1625 1626 1627 1628 1629 | <td class="#idxleft" width="35%"><a name="key662"> gpx </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/gpx/gpx.html"> gpx </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key11"> grammar </a></td> <td class="#idxright" width="65%"> | | | 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 | <td class="#idxleft" width="35%"><a name="key662"> gpx </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/gpx/gpx.html"> gpx </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key11"> grammar </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> · <a href="tcllib/files/modules/grammar_fa/fa.html"> grammar::fa </a> · <a href="tcllib/files/modules/grammar_fa/dacceptor.html"> grammar::fa::dacceptor </a> · <a href="tcllib/files/modules/grammar_fa/dexec.html"> grammar::fa::dexec </a> · <a href="tcllib/files/modules/grammar_fa/faop.html"> grammar::fa::op </a> · <a href="tcllib/files/modules/grammar_me/me_cpu.html"> grammar::me::cpu </a> · <a href="tcllib/files/modules/grammar_me/me_cpucore.html"> grammar::me::cpu::core </a> · <a href="tcllib/files/modules/grammar_me/gasm.html"> grammar::me::cpu::gasm </a> · <a href="tcllib/files/modules/grammar_me/me_tcl.html"> grammar::me::tcl </a> · <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_me/me_vm.html"> grammar::me_vm </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key301"> graph </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/gasm.html"> grammar::me::cpu::gasm </a> · <a href="tcllib/files/modules/struct/graph.html"> struct::graph </a> · <a href="tcllib/files/modules/struct/graphops.html"> struct::graph::op </a> · <a href="tcllib/files/modules/struct/graph1.html"> struct::graph_v1 </a> · <a href="tcllib/files/modules/struct/queue.html"> struct::queue </a> · <a href="tcllib/files/modules/struct/stack.html"> struct::stack </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ | |||
2123 2124 2125 2126 2127 2128 2129 | <td class="#idxleft" width="35%"><a name="key432"> literate programming </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/docstrip/docstrip.html"> docstrip </a> · <a href="tcllib/files/modules/docstrip/docstrip_util.html"> docstrip_util </a> · <a href="tcllib/files/apps/tcldocstrip.html"> tcldocstrip </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key15"> LL(k) </a></td> <td class="#idxright" width="65%"> | | | 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 | <td class="#idxleft" width="35%"><a name="key432"> literate programming </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/docstrip/docstrip.html"> docstrip </a> · <a href="tcllib/files/modules/docstrip/docstrip_util.html"> docstrip_util </a> · <a href="tcllib/files/apps/tcldocstrip.html"> tcldocstrip </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key15"> LL(k) </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key477"> local searching </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/struct/graphops.html"> struct::graph::op </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
2226 2227 2228 2229 2230 2231 2232 | <td class="#idxleft" width="35%"><a name="key663"> MasterCard </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/valtype/cc_mastercard.html"> valtype::creditcard::mastercard </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key5"> matching </a></td> <td class="#idxright" width="65%"> | | | 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 | <td class="#idxleft" width="35%"><a name="key663"> MasterCard </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/valtype/cc_mastercard.html"> valtype::creditcard::mastercard </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key5"> matching </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> · <a href="tcllib/files/modules/struct/graphops.html"> struct::graph::op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key71"> math </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/math/math.html"> math </a> · <a href="tcllib/files/modules/math/bigfloat.html"> math::bigfloat </a> · <a href="tcllib/files/modules/math/bignum.html"> math::bignum </a> · <a href="tcllib/files/modules/math/calculus.html"> math::calculus </a> · <a href="tcllib/files/modules/math/qcomplex.html"> math::complexnumbers </a> · <a href="tcllib/files/modules/math/constants.html"> math::constants </a> · <a href="tcllib/files/modules/math/decimal.html"> math::decimal </a> · <a href="tcllib/files/modules/math/fuzzy.html"> math::fuzzy </a> · <a href="tcllib/files/modules/math/math_geometry.html"> math::geometry </a> · <a href="tcllib/files/modules/math/interpolate.html"> math::interpolate </a> · <a href="tcllib/files/modules/math/linalg.html"> math::linearalgebra </a> · <a href="tcllib/files/modules/math/optimize.html"> math::optimize </a> · <a href="tcllib/files/modules/math/polynomials.html"> math::polynomials </a> · <a href="tcllib/files/modules/math/rational_funcs.html"> math::rationalfunctions </a> · <a href="tcllib/files/modules/math/special.html"> math::special </a> · <a href="tcllib/files/modules/simulation/annealing.html"> simulation::annealing </a> · <a href="tcllib/files/modules/simulation/montecarlo.html"> simulation::montecarlo </a> · <a href="tcllib/files/modules/simulation/simulation_random.html"> simulation::random </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
2630 2631 2632 2633 2634 2635 2636 | <td class="#idxleft" width="35%"><a name="key399"> parameter entry form </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/tepam/tepam_introduction.html"> tepam </a> · <a href="tcllib/files/modules/tepam/tepam_argument_dialogbox.html"> tepam::argument_dialogbox </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key9"> parser </a></td> <td class="#idxright" width="65%"> | | | | | 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 | <td class="#idxleft" width="35%"><a name="key399"> parameter entry form </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/tepam/tepam_introduction.html"> tepam </a> · <a href="tcllib/files/modules/tepam/tepam_argument_dialogbox.html"> tepam::argument_dialogbox </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key9"> parser </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/doctools2idx/idx_parse.html"> doctools::idx::parse </a> · <a href="tcllib/files/modules/doctools2base/tcl_parse.html"> doctools::tcl::parse </a> · <a href="tcllib/files/modules/doctools2toc/toc_parse.html"> doctools::toc::parse </a> · <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> · <a href="tcllib/files/modules/amazon-s3/xsxp.html"> xsxp </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key187"> parser generator </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/apps/page.html"> page </a> · <a href="tcllib/files/modules/page/page_intro.html"> page_intro </a> · <a href="tcllib/files/modules/page/page_pluginmgr.html"> page_pluginmgr </a> · <a href="tcllib/files/modules/page/page_util_flow.html"> page_util_flow </a> · <a href="tcllib/files/modules/page/page_util_norm_lemon.html"> page_util_norm_lemon </a> · <a href="tcllib/files/modules/page/page_util_norm_peg.html"> page_util_norm_peg </a> · <a href="tcllib/files/modules/page/page_util_peg.html"> page_util_peg </a> · <a href="tcllib/files/modules/page/page_util_quote.html"> page_util_quote </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key26"> parsing </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/bench/bench_read.html"> bench::in </a> · <a href="tcllib/files/modules/bibtex/bibtex.html"> bibtex </a> · <a href="tcllib/files/modules/doctools2idx/idx_introduction.html"> doctools2idx_introduction </a> · <a href="tcllib/files/modules/doctools2toc/toc_introduction.html"> doctools2toc_introduction </a> · <a href="tcllib/files/modules/doctools2idx/idx_container.html"> doctools::idx </a> · <a href="tcllib/files/modules/doctools2idx/idx_import.html"> doctools::idx::import </a> · <a href="tcllib/files/modules/doctools2toc/toc_container.html"> doctools::toc </a> · <a href="tcllib/files/modules/doctools2toc/toc_import.html"> doctools::toc::import </a> · <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> · <a href="tcllib/files/modules/grammar_fa/fa.html"> grammar::fa </a> · <a href="tcllib/files/modules/grammar_fa/dacceptor.html"> grammar::fa::dacceptor </a> · <a href="tcllib/files/modules/grammar_fa/dexec.html"> grammar::fa::dexec </a> · <a href="tcllib/files/modules/grammar_fa/faop.html"> grammar::fa::op </a> · <a href="tcllib/files/modules/grammar_me/me_cpu.html"> grammar::me::cpu </a> · <a href="tcllib/files/modules/grammar_me/me_cpucore.html"> grammar::me::cpu::core </a> · <a href="tcllib/files/modules/grammar_me/gasm.html"> grammar::me::cpu::gasm </a> · <a href="tcllib/files/modules/grammar_me/me_tcl.html"> grammar::me::tcl </a> · <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_me/me_vm.html"> grammar::me_vm </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/modules/htmlparse/htmlparse.html"> htmlparse </a> · <a href="tcllib/files/modules/yaml/huddle.html"> huddle </a> · <a href="tcllib/files/modules/string/token_shell.html"> string::token::shell </a> · <a href="tcllib/files/modules/yaml/yaml.html"> yaml </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key8"> parsing expression </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key14"> parsing expression grammar </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/modules/page/page_util_peg.html"> page_util_peg </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key587"> partial application </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/lambda/lambda.html"> lambda </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ | |||
2690 2691 2692 2693 2694 2695 2696 | <td class="#idxleft" width="35%"><a name="key629"> patching </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/rcs/rcs.html"> rcs </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key6"> PEG </a></td> <td class="#idxright" width="65%"> | | | 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 | <td class="#idxleft" width="35%"><a name="key629"> patching </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/rcs/rcs.html"> rcs </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key6"> PEG </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/page/page_util_norm_peg.html"> page_util_norm_peg </a> · <a href="tcllib/files/modules/page/page_util_peg.html"> page_util_peg </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key100"> performance </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/bench/bench.html"> bench </a> · <a href="tcllib/files/modules/bench/bench_read.html"> bench::in </a> · <a href="tcllib/files/modules/bench/bench_wcsv.html"> bench::out::csv </a> · <a href="tcllib/files/modules/bench/bench_wtext.html"> bench::out::text </a> · <a href="tcllib/files/modules/bench/bench_intro.html"> bench_intro </a> · <a href="tcllib/files/modules/bench/bench_lang_intro.html"> bench_lang_intro </a> · <a href="tcllib/files/modules/bench/bench_lang_spec.html"> bench_lang_spec </a> · <a href="tcllib/files/modules/profiler/profiler.html"> profiler </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ | |||
2860 2861 2862 2863 2864 2865 2866 | <td class="#idxleft" width="35%"><a name="key674"> publisher </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/hook/hook.html"> hook </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key1"> push down automaton </a></td> <td class="#idxright" width="65%"> | | | 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 | <td class="#idxleft" width="35%"><a name="key674"> publisher </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/hook/hook.html"> hook </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key1"> push down automaton </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxheader"><th colspan="2"> <a name="c20">Keywords: Q</a> </th></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key50"> queue </a></td> <td class="#idxright" width="65%"> |
︙ | ︙ | |||
2956 2957 2958 2959 2960 2961 2962 | <td class="#idxleft" width="35%"><a name="key303"> record </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/struct/queue.html"> struct::queue </a> · <a href="tcllib/files/modules/struct/record.html"> struct::record </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key10"> recursive descent </a></td> <td class="#idxright" width="65%"> | | | 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 | <td class="#idxleft" width="35%"><a name="key303"> record </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/struct/queue.html"> struct::queue </a> · <a href="tcllib/files/modules/struct/record.html"> struct::record </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key10"> recursive descent </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key215"> reduce </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/generator/generator.html"> generator </a> · <a href="tcllib/files/modules/struct/struct_list.html"> struct::list </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ | |||
3499 3500 3501 3502 3503 3504 3505 | <td class="#idxleft" width="35%"><a name="key818"> standard io </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/virtchannel_base/std.html"> tcl::chan::std </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key2"> state </a></td> <td class="#idxright" width="65%"> | | | 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 | <td class="#idxleft" width="35%"><a name="key818"> standard io </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/virtchannel_base/std.html"> tcl::chan::std </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key2"> state </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_fa/fa.html"> grammar::fa </a> · <a href="tcllib/files/modules/grammar_fa/dacceptor.html"> grammar::fa::dacceptor </a> · <a href="tcllib/files/modules/grammar_fa/dexec.html"> grammar::fa::dexec </a> · <a href="tcllib/files/modules/grammar_fa/faop.html"> grammar::fa::op </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key84"> state (de)serialization </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/namespacex/namespacex.html"> namespacex </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ | |||
3707 3708 3709 3710 3711 3712 3713 | <td class="#idxleft" width="35%"><a name="key108"> TCLPARAM </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key7"> TDPL </a></td> <td class="#idxright" width="65%"> | | | 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 | <td class="#idxleft" width="35%"><a name="key108"> TCLPARAM </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key7"> TDPL </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key311"> temp file </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/fileutil/fileutil.html"> fileutil </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
3887 3888 3889 3890 3891 3892 3893 | <td class="#idxleft" width="35%"><a name="key688"> tokenization </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/string/token.html"> string::token </a> · <a href="tcllib/files/modules/string/token_shell.html"> string::token::shell </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key13"> top-down parsing languages </a></td> <td class="#idxright" width="65%"> | | | 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 | <td class="#idxleft" width="35%"><a name="key688"> tokenization </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/string/token.html"> string::token </a> · <a href="tcllib/files/modules/string/token_shell.html"> string::token::shell </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key13"> top-down parsing languages </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key386"> torrent </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/bee/bee.html"> bee </a> </td></tr> <tr class="#idxeven" valign=top> |
︙ | ︙ | |||
3912 3913 3914 3915 3916 3917 3918 | <td class="#idxleft" width="35%"><a name="key74"> trace </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/debug/debug.html"> debug </a> · <a href="tcllib/files/modules/debug/debug_caller.html"> debug::caller </a> · <a href="tcllib/files/modules/debug/debug_heartbeat.html"> debug::heartbeat </a> · <a href="tcllib/files/modules/debug/debug_timestamp.html"> debug::timestamp </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key12"> transducer </a></td> <td class="#idxright" width="65%"> | | | 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 | <td class="#idxleft" width="35%"><a name="key74"> trace </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/debug/debug.html"> debug </a> · <a href="tcllib/files/modules/debug/debug_caller.html"> debug::caller </a> · <a href="tcllib/files/modules/debug/debug_heartbeat.html"> debug::heartbeat </a> · <a href="tcllib/files/modules/debug/debug_timestamp.html"> debug::timestamp </a> </td></tr> <tr class="#idxodd" valign=top> <td class="#idxleft" width="35%"><a name="key12"> transducer </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/grammar_aycock/aycock.html"> grammar::aycock </a> · <a href="tcllib/files/modules/grammar_fa/fa.html"> grammar::fa </a> · <a href="tcllib/files/modules/grammar_fa/dacceptor.html"> grammar::fa::dacceptor </a> · <a href="tcllib/files/modules/grammar_fa/dexec.html"> grammar::fa::dexec </a> · <a href="tcllib/files/modules/grammar_fa/faop.html"> grammar::fa::op </a> · <a href="tcllib/files/modules/grammar_me/me_intro.html"> grammar::me_intro </a> · <a href="tcllib/files/modules/grammar_peg/peg.html"> grammar::peg </a> · <a href="tcllib/files/modules/grammar_peg/peg_interp.html"> grammar::peg::interp </a> · <a href="tcllib/files/apps/pt.html"> pt </a> · <a href="tcllib/files/modules/pt/pt_astree.html"> pt::ast </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html"> pt::cparam::configuration::critcl </a> · <a href="tcllib/files/modules/pt/pt_cparam_config_tea.html"> pt::cparam::configuration::tea </a> · <a href="tcllib/files/modules/pt/pt_json_language.html"> pt::json_language </a> · <a href="tcllib/files/modules/pt/pt_param.html"> pt::param </a> · <a href="tcllib/files/modules/pt/pt_pexpression.html"> pt::pe </a> · <a href="tcllib/files/modules/pt/pt_pexpr_op.html"> pt::pe::op </a> · <a href="tcllib/files/modules/pt/pt_pegrammar.html"> pt::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_container.html"> pt::peg::container </a> · <a href="tcllib/files/modules/pt/pt_peg_container_peg.html"> pt::peg::container::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_export.html"> pt::peg::export </a> · <a href="tcllib/files/modules/pt/pt_peg_export_container.html"> pt::peg::export::container </a> · <a href="tcllib/files/modules/pt/pt_peg_export_json.html"> pt::peg::export::json </a> · <a href="tcllib/files/modules/pt/pt_peg_export_peg.html"> pt::peg::export::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_from_container.html"> pt::peg::from::container </a> · <a href="tcllib/files/modules/pt/pt_peg_from_json.html"> pt::peg::from::json </a> · <a href="tcllib/files/modules/pt/pt_peg_from_peg.html"> pt::peg::from::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_import.html"> pt::peg::import </a> · <a href="tcllib/files/modules/pt/pt_peg_import_container.html"> pt::peg::import::container </a> · <a href="tcllib/files/modules/pt/pt_peg_import_json.html"> pt::peg::import::json </a> · <a href="tcllib/files/modules/pt/pt_peg_import_peg.html"> pt::peg::import::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_interp.html"> pt::peg::interp </a> · <a href="tcllib/files/modules/pt/pt_peg_to_container.html"> pt::peg::to::container </a> · <a href="tcllib/files/modules/pt/pt_peg_to_cparam.html"> pt::peg::to::cparam </a> · <a href="tcllib/files/modules/pt/pt_peg_to_json.html"> pt::peg::to::json </a> · <a href="tcllib/files/modules/pt/pt_peg_to_param.html"> pt::peg::to::param </a> · <a href="tcllib/files/modules/pt/pt_peg_to_peg.html"> pt::peg::to::peg </a> · <a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html"> pt::peg::to::tclparam </a> · <a href="tcllib/files/modules/pt/pt_peg_language.html"> pt::peg_language </a> · <a href="tcllib/files/modules/pt/pt_peg_introduction.html"> pt::pegrammar </a> · <a href="tcllib/files/modules/pt/pt_pgen.html"> pt::pgen </a> · <a href="tcllib/files/modules/pt/pt_rdengine.html"> pt::rde </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html"> pt::tclparam::configuration::snit </a> · <a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html"> pt::tclparam::configuration::tcloo </a> · <a href="tcllib/files/modules/pt/pt_util.html"> pt::util </a> · <a href="tcllib/files/modules/pt/pt_to_api.html"> pt_export_api </a> · <a href="tcllib/files/modules/pt/pt_from_api.html"> pt_import_api </a> · <a href="tcllib/files/modules/pt/pt_introduction.html"> pt_introduction </a> · <a href="tcllib/files/modules/pt/pt_parse_peg.html"> pt_parse_peg </a> · <a href="tcllib/files/modules/pt/pt_parser_api.html"> pt_parser_api </a> · <a href="tcllib/files/modules/pt/pt_peg_op.html"> pt_peg_op </a> </td></tr> <tr class="#idxeven" valign=top> <td class="#idxleft" width="35%"><a name="key62"> transfer </a></td> <td class="#idxright" width="65%"> <a href="tcllib/files/modules/transfer/connect.html"> transfer::connect </a> · <a href="tcllib/files/modules/transfer/copyops.html"> transfer::copy </a> · <a href="tcllib/files/modules/transfer/tqueue.html"> transfer::copy::queue </a> · <a href="tcllib/files/modules/transfer/ddest.html"> transfer::data::destination </a> · <a href="tcllib/files/modules/transfer/dsource.html"> transfer::data::source </a> · <a href="tcllib/files/modules/transfer/receiver.html"> transfer::receiver </a> · <a href="tcllib/files/modules/transfer/transmitter.html"> transfer::transmitter </a> </td></tr> <tr class="#idxodd" valign=top> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/apps/pt.html.
︙ | ︙ | |||
354 355 356 357 358 359 360 361 362 363 364 365 366 367 | The default value is <b class="const">CLASS</b>.</p> <p>For a simple value <b class="variable">X</b> without colons, like CLASS, the parser command will be <b class="variable">X</b>::<b class="variable">X</b>. Whereas for a namespaced value <b class="variable">X::Y</b> the parser command will be <b class="variable">X::Y</b>.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate. The default value is <b class="const">PACKAGE</b>.</p></dd> </dl> </div> <div id="section6" class="section"><h2><a name="section6">C Parser</a></h2> <p>The <b class="const">c</b> format is executable code, a parser for the grammar. The parser implementation is written in C and can be tweaked to the users' needs through a multitude of options.</p> <p>The <b class="cmd">critcl</b> format, for example, is implemented as a canned | > > > | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | The default value is <b class="const">CLASS</b>.</p> <p>For a simple value <b class="variable">X</b> without colons, like CLASS, the parser command will be <b class="variable">X</b>::<b class="variable">X</b>. Whereas for a namespaced value <b class="variable">X::Y</b> the parser command will be <b class="variable">X::Y</b>.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate. The default value is <b class="const">PACKAGE</b>.</p></dd> <dt><b class="option">-version</b> string</dt> <dd><p>The value of this option is the version of the package to generate. The default value is <b class="const">1</b>.</p></dd> </dl> </div> <div id="section6" class="section"><h2><a name="section6">C Parser</a></h2> <p>The <b class="const">c</b> format is executable code, a parser for the grammar. The parser implementation is written in C and can be tweaked to the users' needs through a multitude of options.</p> <p>The <b class="cmd">critcl</b> format, for example, is implemented as a canned |
︙ | ︙ | |||
482 483 484 485 486 487 488 489 490 491 492 493 494 495 | <b class="option">-class</b> nor <b class="option">-package</b> were specified.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option <b class="option">-class</b> is not specified, see above. The default value is <b class="const">PACKAGE</b>, applying if neither option <b class="option">-package</b> nor <b class="option">-class</b> were specified.</p></dd> </dl> </div> <div id="section8" class="section"><h2><a name="section8">TclOO Parser</a></h2> <p>The <b class="const">oo</b> format is executable code, a parser for the grammar. It is a Tcl package holding a <b class="package"><a href="../../../index.html#key761">TclOO</a></b> class, whose instances are parsers for the input grammar.</p> <p>This result-format supports the following options:</p> | > > > | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | <b class="option">-class</b> nor <b class="option">-package</b> were specified.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option <b class="option">-class</b> is not specified, see above. The default value is <b class="const">PACKAGE</b>, applying if neither option <b class="option">-package</b> nor <b class="option">-class</b> were specified.</p></dd> <dt><b class="option">-version</b> string</dt> <dd><p>The value of this option is the version of the package to generate. The default value is <b class="const">1</b>.</p></dd> </dl> </div> <div id="section8" class="section"><h2><a name="section8">TclOO Parser</a></h2> <p>The <b class="const">oo</b> format is executable code, a parser for the grammar. It is a Tcl package holding a <b class="package"><a href="../../../index.html#key761">TclOO</a></b> class, whose instances are parsers for the input grammar.</p> <p>This result-format supports the following options:</p> |
︙ | ︙ | |||
512 513 514 515 516 517 518 519 520 521 522 523 524 525 | <b class="option">-class</b> nor <b class="option">-package</b> were specified.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option <b class="option">-class</b> is not specified, see above. The default value is <b class="const">PACKAGE</b>, applying if neither option <b class="option">-package</b> nor <b class="option">-class</b> were specified.</p></dd> </dl> </div> <div id="section9" class="section"><h2><a name="section9">Grammar Container</a></h2> <p>The <b class="const">container</b> format is another form of describing parsing expression grammars. While data in this format is executable it does not constitute a parser for the grammar. It always has to be used in conjunction with the package <b class="package"><a href="../modules/pt/pt_peg_interp.html">pt::peg::interp</a></b>, a grammar | > > > | 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | <b class="option">-class</b> nor <b class="option">-package</b> were specified.</p></dd> <dt><b class="option">-package</b> string</dt> <dd><p>The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option <b class="option">-class</b> is not specified, see above. The default value is <b class="const">PACKAGE</b>, applying if neither option <b class="option">-package</b> nor <b class="option">-class</b> were specified.</p></dd> <dt><b class="option">-version</b> string</dt> <dd><p>The value of this option is the version of the package to generate. The default value is <b class="const">1</b>.</p></dd> </dl> </div> <div id="section9" class="section"><h2><a name="section9">Grammar Container</a></h2> <p>The <b class="const">container</b> format is another form of describing parsing expression grammars. While data in this format is executable it does not constitute a parser for the grammar. It always has to be used in conjunction with the package <b class="package"><a href="../modules/pt/pt_peg_interp.html">pt::peg::interp</a></b>, a grammar |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_cparam_config_critcl.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | | | | | 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::cparam::configuration::critcl(n) 1.0.2 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::cparam::configuration::critcl - C/PARAM, Canned configuration, Critcl</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> <li class="section"><a href="#section1">Description</a></li> <li class="section"><a href="#section2">API</a></li> <li class="section"><a href="#section3">Bugs, Ideas, Feedback</a></li> <li class="section"><a href="#keywords">Keywords</a></li> <li class="section"><a href="#category">Category</a></li> <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::cparam::configuration::critcl <span class="opt">?1.0.2?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::cparam::configuration::critcl</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> <p>Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the <i class="term"><a href="pt_introduction.html">Introduction to Parser Tools</a></i>. This document is the entrypoint to the whole system the current package is a part of.</p> <p>This package is an adjunct to <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b>, to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b> to generate <b class="package">critcl</b>-based parser packages.</p> <p>It is a supporting package in the Core Layer of Parser Tools.</p> <p><img alt="arch_core_support" src="../../../../image/arch_core_support.png"></p> </div> <div id="section2" class="section"><h2><a name="section2">API</a></h2> <dl class="definitions"> <dt><a name="1"><b class="cmd">::pt::cparam::configuration::critcl</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></dt> <dd><p>The command applies the configuration provided by this package to the <i class="arg">cmdprefix</i>, causing the creation of <b class="package">critcl</b>-based parsers whose class is <i class="arg">name</i>, in package <i class="arg">pkg</i> with <i class="arg">version</i>.</p> <p>The use of a command prefix as API allows application of the configuration to not only <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b> (<b class="cmd">pt::peg::to::cparam configure</b>), but also export manager instances and PEG containers (<b class="cmd">$export configuration set</b> and <b class="cmd">[$container exporter] configuration set</b> respectively).</p> <p>Or anything other command prefix accepting two arguments, option and value.</p></dd> |
︙ | ︙ |
Added embedded/www/tcllib/files/modules/pt/pt_cparam_config_tea.html.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | <html><head> <title>pt::cparam::configuration::tea - Parser Tools</title> <style type="text/css"><!-- HTML { background: #FFFFFF; color: black; } BODY { background: #FFFFFF; color: black; } DIV.doctools { margin-left: 10%; margin-right: 10%; } DIV.doctools H1,DIV.doctools H2 { margin-left: -5%; } H1, H2, H3, H4 { margin-top: 1em; font-family: sans-serif; font-size: large; color: #005A9C; background: transparent; text-align: left; } H1.title { text-align: center; } UL,OL { margin-right: 0em; margin-top: 3pt; margin-bottom: 3pt; } UL LI { list-style: disc; } OL LI { list-style: decimal; } DT { padding-top: 1ex; } UL.toc,UL.toc UL, UL.toc UL UL { font: normal 12pt/14pt sans-serif; list-style: none; } LI.section, LI.subsection { list-style: none; margin-left: 0em; text-indent: 0em; padding: 0em; } PRE { display: block; font-family: monospace; white-space: pre; margin: 0%; padding-top: 0.5ex; padding-bottom: 0.5ex; padding-left: 1ex; padding-right: 1ex; width: 100%; } PRE.example { color: black; background: #f5dcb3; border: 1px solid black; } UL.requirements LI, UL.syntax LI { list-style: none; margin-left: 0em; text-indent: 0em; padding: 0em; } DIV.synopsis { color: black; background: #80ffff; border: 1px solid black; font-family: serif; margin-top: 1em; margin-bottom: 1em; } UL.syntax { margin-top: 1em; border-top: 1px solid black; } UL.requirements { margin-bottom: 1em; border-bottom: 1px solid black; } --></style> </head> <! -- Generated from file 'pt_cparam_config_tea.man' by tcllib/doctools with format 'html' --> <! -- Copyright © 2009 Andreas Kupries <[email protected]> --> <! -- CVS: $Id$ pt::cparam::configuration::tea.n --> <body><div class="doctools"> <hr> [ <a href="../../../../../../../../home">Tcllib Home</a> | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::cparam::configuration::tea(n) 0.1 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::cparam::configuration::tea - C/PARAM, Canned configuration, TEA</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> <li class="section"><a href="#section1">Description</a></li> <li class="section"><a href="#section2">API</a></li> <li class="section"><a href="#section3">Bugs, Ideas, Feedback</a></li> <li class="section"><a href="#keywords">Keywords</a></li> <li class="section"><a href="#category">Category</a></li> <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::cparam::configuration::tea <span class="opt">?0.1?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::cparam::configuration::tea</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> <p>Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the <i class="term"><a href="pt_introduction.html">Introduction to Parser Tools</a></i>. This document is the entrypoint to the whole system the current package is a part of.</p> <p>This package is an adjunct to <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b>, to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b> to generate plain parser code ready for inclusion into a <i class="term">TEA</i>-based C extension.</p> <p>It is a supporting package in the Core Layer of Parser Tools.</p> <p><img alt="arch_core_support" src="../../../../image/arch_core_support.png"></p> </div> <div id="section2" class="section"><h2><a name="section2">API</a></h2> <dl class="definitions"> <dt><a name="1"><b class="cmd">::pt::cparam::configuration::tea</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></dt> <dd><p>The command applies the configuration provided by this package to the <i class="arg">cmdprefix</i>, causing the creation of <b class="package">tea</b>-based parsers whose class is <i class="arg">name</i>, in package <i class="arg">pkg</i> with <i class="arg">version</i>.</p> <p>The use of a command prefix as API allows application of the configuration to not only <b class="package"><a href="pt_peg_to_cparam.html">pt::peg::to::cparam</a></b> (<b class="cmd">pt::peg::to::cparam configure</b>), but also export manager instances and PEG containers (<b class="cmd">$export configuration set</b> and <b class="cmd">[$container exporter] configuration set</b> respectively).</p> <p>Or anything other command prefix accepting two arguments, option and value.</p></dd> </dl> </div> <div id="section3" class="section"><h2><a name="section3">Bugs, Ideas, Feedback</a></h2> <p>This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category <em>pt</em> of the <a href="http://core.tcl.tk/tcllib/reportlist">Tcllib Trackers</a>. Please also report any ideas for enhancements you may have for either package and/or documentation.</p> </div> <div id="keywords" class="section"><h2><a name="keywords">Keywords</a></h2> <p><a href="../../../../index.html#key3">EBNF</a>, <a href="../../../../index.html#key15">LL(k)</a>, <a href="../../../../index.html#key6">PEG</a>, <a href="../../../../index.html#key7">TDPL</a>, <a href="../../../../index.html#key4">context-free languages</a>, <a href="../../../../index.html#key0">expression</a>, <a href="../../../../index.html#key11">grammar</a>, <a href="../../../../index.html#key5">matching</a>, <a href="../../../../index.html#key9">parser</a>, <a href="../../../../index.html#key8">parsing expression</a>, <a href="../../../../index.html#key14">parsing expression grammar</a>, <a href="../../../../index.html#key1">push down automaton</a>, <a href="../../../../index.html#key10">recursive descent</a>, <a href="../../../../index.html#key2">state</a>, <a href="../../../../index.html#key13">top-down parsing languages</a>, <a href="../../../../index.html#key12">transducer</a></p> </div> <div id="category" class="section"><h2><a name="category">Category</a></h2> <p>Parsing and Grammars</p> </div> <div id="copyright" class="section"><h2><a name="copyright">Copyright</a></h2> <p>Copyright © 2009 Andreas Kupries <[email protected]></p> </div> </div></body></html> |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_export_peg.html.
︙ | ︙ | |||
254 255 256 257 258 259 260 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_from_peg.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::peg::from::peg(n) 1.0.3 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::peg::from::peg - PEG Conversion. Read PEG format</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
139 140 141 142 143 144 145 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::peg::from::peg <span class="opt">?1.0.3?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">pt::peg::from::peg</b> <b class="method">convert</b> <i class="arg">text</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> |
︙ | ︙ | |||
212 213 214 215 216 217 218 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_import_peg.html.
︙ | ︙ | |||
222 223 224 225 226 227 228 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_interp.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::peg::interp(n) 1.0.1 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::peg::interp - Interpreter for parsing expression grammars</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
138 139 140 141 142 143 144 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::peg::interp <span class="opt">?1.0.1?</span></b></li> <li>package require <b class="pkgname">pt::rde <span class="opt">?1?</span></b></li> <li>package require <b class="pkgname">snit</b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::peg::interp</b> <i class="arg">objectName</i> <i class="arg">grammar</i></a></li> <li><a href="#2"><i class="arg">objectName</i> <b class="method">use</b> <i class="arg">grammar</i></a></li> <li><a href="#3"><i class="arg">objectName</i> <b class="method">destroy</b></a></li> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_language.html.
︙ | ︙ | |||
421 422 423 424 425 426 427 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_to_cparam.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::peg::to::cparam(n) 1.1.2 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::peg::to::cparam - PEG Conversion. Write CPARAM format</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
140 141 142 143 144 145 146 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::peg::to::cparam <span class="opt">?1.1.2?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">pt::peg::to::cparam</b> <b class="method">reset</b></a></li> <li><a href="#2"><b class="cmd">pt::peg::to::cparam</b> <b class="method">configure</b></a></li> <li><a href="#3"><b class="cmd">pt::peg::to::cparam</b> <b class="method">configure</b> <i class="arg">option</i></a></li> <li><a href="#4"><b class="cmd">pt::peg::to::cparam</b> <b class="method">configure</b> <i class="arg">option</i> <i class="arg">value</i>...</a></li> <li><a href="#5"><b class="cmd">pt::peg::to::cparam</b> <b class="method">convert</b> <i class="arg">serial</i></a></li> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_to_peg.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::peg::to::peg(n) 1.0.2 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::peg::to::peg - PEG Conversion. Write PEG format</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
140 141 142 143 144 145 146 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::peg::to::peg <span class="opt">?1.0.2?</span></b></li> <li>package require <b class="pkgname">pt::peg</b></li> <li>package require <b class="pkgname">pt::pe</b></li> <li>package require <b class="pkgname">text::write</b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">pt::peg::to::peg</b> <b class="method">reset</b></a></li> <li><a href="#2"><b class="cmd">pt::peg::to::peg</b> <b class="method">configure</b></a></li> |
︙ | ︙ | |||
267 268 269 270 271 272 273 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | / DOT ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_peg_to_tclparam.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::peg::to::tclparam(n) 1.0.1 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::peg::to::tclparam - PEG Conversion. Write TCLPARAM format</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
136 137 138 139 140 141 142 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::peg::to::tclparam <span class="opt">?1.0.1?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">pt::peg::to::tclparam</b> <b class="method">reset</b></a></li> <li><a href="#2"><b class="cmd">pt::peg::to::tclparam</b> <b class="method">configure</b></a></li> <li><a href="#3"><b class="cmd">pt::peg::to::tclparam</b> <b class="method">configure</b> <i class="arg">option</i></a></li> <li><a href="#4"><b class="cmd">pt::peg::to::tclparam</b> <b class="method">configure</b> <i class="arg">option</i> <i class="arg">value</i>...</a></li> <li><a href="#5"><b class="cmd">pt::peg::to::tclparam</b> <b class="method">convert</b> <i class="arg">serial</i></a></li> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_pexpression.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::pe(n) 1.0.1 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::pe - Parsing Expression Serialization</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
129 130 131 132 133 134 135 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::pe <span class="opt">?1.0.1?</span></b></li> <li>package require <b class="pkgname">char</b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::pe</b> <b class="method">verify</b> <i class="arg">serial</i> <span class="opt">?<i class="arg">canonvar</i>?</span></a></li> <li><a href="#2"><b class="cmd">::pt::pe</b> <b class="method">verify-as-canonical</b> <i class="arg">serial</i></a></li> <li><a href="#3"><b class="cmd">::pt::pe</b> <b class="method">canonicalize</b> <i class="arg">serial</i></a></li> <li><a href="#4"><b class="cmd">::pt::pe</b> <b class="method">print</b> <i class="arg">serial</i></a></li> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_rdengine.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::rde(n) 1.0.3 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::rde - Parsing Runtime Support, PARAM based</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> |
︙ | ︙ | |||
128 129 130 131 132 133 134 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> | | | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::rde <span class="opt">?1.0.3?</span></b></li> <li>package require <b class="pkgname">snit</b></li> <li>package require <b class="pkgname">struct::stack 1.4</b></li> <li>package require <b class="pkgname">pt::ast 1.1</b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::rde</b> <i class="arg">objectName</i></a></li> <li><a href="#2"><i class="arg">objectName</i> <b class="method">destroy</b></a></li> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_tclparam_config_snit.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | | | | | 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::tclparam::configuration::snit(n) 1.0.2 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::tclparam::configuration::snit - Tcl/PARAM, Canned configuration, Snit</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> <li class="section"><a href="#section1">Description</a></li> <li class="section"><a href="#section2">API</a></li> <li class="section"><a href="#section3">Bugs, Ideas, Feedback</a></li> <li class="section"><a href="#keywords">Keywords</a></li> <li class="section"><a href="#category">Category</a></li> <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::tclparam::configuration::snit <span class="opt">?1.0.2?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::tclparam::configuration::snit</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> <p>Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the <i class="term"><a href="pt_introduction.html">Introduction to Parser Tools</a></i>. This document is the entrypoint to the whole system the current package is a part of.</p> <p>This package is an adjunct to <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b>, to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b> to generate <b class="package"><a href="../snit/snit.html">snit</a></b>-based parser packages.</p> <p>It is a supporting package in the Core Layer of Parser Tools.</p> <p><img alt="arch_core_support" src="../../../../image/arch_core_support.png"></p> </div> <div id="section2" class="section"><h2><a name="section2">API</a></h2> <dl class="definitions"> <dt><a name="1"><b class="cmd">::pt::tclparam::configuration::snit</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></dt> <dd><p>The command applies the configuration provided by this package to the <i class="arg">cmdprefix</i>, causing the creation of <b class="package"><a href="../snit/snit.html">snit</a></b>-based parsers whose class is <i class="arg">name</i>, in package <i class="arg">pkg</i> with <i class="arg">version</i>.</p> <p>The use of a command prefix as API allows application of the configuration to not only <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b> (<b class="cmd">pt::peg::to::tclparam configure</b>), but also export manager instances and PEG containers (<b class="cmd">$export configuration set</b> and <b class="cmd">[$container exporter] configuration set</b> respectively).</p> <p>Or anything other command prefix accepting two arguments, option and value.</p></dd> |
︙ | ︙ |
Changes to embedded/www/tcllib/files/modules/pt/pt_tclparam_config_tcloo.html.
︙ | ︙ | |||
104 105 106 107 108 109 110 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> | | | | | | | 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::tclparam::configuration::tcloo(n) 1.0.4 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::tclparam::configuration::tcloo - Tcl/PARAM, Canned configuration, Tcloo</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> <li class="section"><a href="#section1">Description</a></li> <li class="section"><a href="#section2">API</a></li> <li class="section"><a href="#section3">Bugs, Ideas, Feedback</a></li> <li class="section"><a href="#keywords">Keywords</a></li> <li class="section"><a href="#category">Category</a></li> <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::tclparam::configuration::tcloo <span class="opt">?1.0.4?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::tclparam::configuration::tcloo</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> <p>Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the <i class="term"><a href="pt_introduction.html">Introduction to Parser Tools</a></i>. This document is the entrypoint to the whole system the current package is a part of.</p> <p>This package is an adjunct to <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b>, to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b> to generate <b class="package">OO</b>-based parser packages.</p> <p>It is a supporting package in the Core Layer of Parser Tools.</p> <p><img alt="arch_core_support" src="../../../../image/arch_core_support.png"></p> </div> <div id="section2" class="section"><h2><a name="section2">API</a></h2> <dl class="definitions"> <dt><a name="1"><b class="cmd">::pt::tclparam::configuration::tcloo</b> <b class="method">def</b> <i class="arg">name</i> <i class="arg">pkg</i> <i class="arg">version</i> <i class="arg">cmdprefix</i></a></dt> <dd><p>The command applies the configuration provided by this package to the <i class="arg">cmdprefix</i>, causing the creation of <b class="package">OO</b>-based parsers whose class is <i class="arg">name</i>, in package <i class="arg">pkg</i> with <i class="arg">version</i>.</p> <p>The use of a command prefix as API allows application of the configuration to not only <b class="package"><a href="pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></b> (<b class="cmd">pt::peg::to::tclparam configure</b>), but also export manager instances and PEG containers (<b class="cmd">$export configuration set</b> and <b class="cmd">[$container exporter] configuration set</b> respectively).</p> <p>Or anything other command prefix accepting two arguments, option and value.</p></dd> |
︙ | ︙ |
Added embedded/www/tcllib/files/modules/pt/pt_util.html.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | <html><head> <title>pt::util - Parser Tools</title> <style type="text/css"><!-- HTML { background: #FFFFFF; color: black; } BODY { background: #FFFFFF; color: black; } DIV.doctools { margin-left: 10%; margin-right: 10%; } DIV.doctools H1,DIV.doctools H2 { margin-left: -5%; } H1, H2, H3, H4 { margin-top: 1em; font-family: sans-serif; font-size: large; color: #005A9C; background: transparent; text-align: left; } H1.title { text-align: center; } UL,OL { margin-right: 0em; margin-top: 3pt; margin-bottom: 3pt; } UL LI { list-style: disc; } OL LI { list-style: decimal; } DT { padding-top: 1ex; } UL.toc,UL.toc UL, UL.toc UL UL { font: normal 12pt/14pt sans-serif; list-style: none; } LI.section, LI.subsection { list-style: none; margin-left: 0em; text-indent: 0em; padding: 0em; } PRE { display: block; font-family: monospace; white-space: pre; margin: 0%; padding-top: 0.5ex; padding-bottom: 0.5ex; padding-left: 1ex; padding-right: 1ex; width: 100%; } PRE.example { color: black; background: #f5dcb3; border: 1px solid black; } UL.requirements LI, UL.syntax LI { list-style: none; margin-left: 0em; text-indent: 0em; padding: 0em; } DIV.synopsis { color: black; background: #80ffff; border: 1px solid black; font-family: serif; margin-top: 1em; margin-bottom: 1em; } UL.syntax { margin-top: 1em; border-top: 1px solid black; } UL.requirements { margin-bottom: 1em; border-bottom: 1px solid black; } --></style> </head> <! -- Generated from file 'pt_util.man' by tcllib/doctools with format 'html' --> <! -- Copyright © 2009 Andreas Kupries <[email protected]> --> <! -- CVS: $Id$ pt::util.n --> <body><div class="doctools"> <hr> [ <a href="../../../../../../../../home">Tcllib Home</a> | <a href="../../../../toc.html">Main Table Of Contents</a> | <a href="../../../toc.html">Table Of Contents</a> | <a href="../../../../index.html">Keyword Index</a> | <a href="../../../../toc0.html">Categories</a> | <a href="../../../../toc1.html">Modules</a> | <a href="../../../../toc2.html">Applications</a> ] <hr> <h1 class="title">pt::util(n) 1 tcllib "Parser Tools"</h1> <div id="name" class="section"><h2><a name="name">Name</a></h2> <p>pt::util - General utilities</p> </div> <div id="toc" class="section"><h2><a name="toc">Table Of Contents</a></h2> <ul class="toc"> <li class="section"><a href="#toc">Table Of Contents</a></li> <li class="section"><a href="#synopsis">Synopsis</a></li> <li class="section"><a href="#section1">Description</a></li> <li class="section"><a href="#section2">API</a></li> <li class="section"><a href="#section3">Bugs, Ideas, Feedback</a></li> <li class="section"><a href="#keywords">Keywords</a></li> <li class="section"><a href="#category">Category</a></li> <li class="section"><a href="#copyright">Copyright</a></li> </ul> </div> <div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2> <div class="synopsis"> <ul class="requirements"> <li>package require <b class="pkgname">Tcl 8.5</b></li> <li>package require <b class="pkgname">pt::ast <span class="opt">?1?</span></b></li> </ul> <ul class="syntax"> <li><a href="#1"><b class="cmd">::pt::util</b> <b class="method">error2readable</b> <i class="arg">error</i> <i class="arg">text</i></a></li> <li><a href="#2"><b class="cmd">::pt::util</b> <b class="method">error2position</b> <i class="arg">error</i> <i class="arg">text</i></a></li> <li><a href="#3"><b class="cmd">::pt::util</b> <b class="method">error2text</b> <i class="arg">error</i></a></li> </ul> </div> </div> <div id="section1" class="section"><h2><a name="section1">Description</a></h2> <p>Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the <i class="term"><a href="pt_introduction.html">Introduction to Parser Tools</a></i>. This document is the entrypoint to the whole system the current package is a part of.</p> <p>This package provides general utility commands.</p> <p>This is a supporting package in the Core Layer of Parser Tools.</p> <p><img alt="arch_core_support" src="../../../../image/arch_core_support.png"></p> </div> <div id="section2" class="section"><h2><a name="section2">API</a></h2> <dl class="definitions"> <dt><a name="1"><b class="cmd">::pt::util</b> <b class="method">error2readable</b> <i class="arg">error</i> <i class="arg">text</i></a></dt> <dd><p>This command takes the structured form of a syntax <i class="arg">error</i> as thrown by parser runtimes and the input <i class="arg">text</i> to the parser which caused that error and returns a string describing the error in a human-readable form.</p> <p>The input <i class="arg">text</i> is required to convert the character position of the error into a more readable line/column format, and to provide excerpts of the input around the error position.</p></dd> <dt><a name="2"><b class="cmd">::pt::util</b> <b class="method">error2position</b> <i class="arg">error</i> <i class="arg">text</i></a></dt> <dd><p>This command takes the structured form of a syntax <i class="arg">error</i> as thrown by parser runtimes and the input <i class="arg">text</i> to the parser which caused that error and returns a 2-element list containing the line number and column index for the error's character position in the input, in this order.</p></dd> <dt><a name="3"><b class="cmd">::pt::util</b> <b class="method">error2text</b> <i class="arg">error</i></a></dt> <dd><p>This command takes the structured form of a syntax <i class="arg">error</i> as thrown by parser runtimes and returns a list of strings, each describing a possible expected input in a human-readable form.</p></dd> </dl> </div> <div id="section3" class="section"><h2><a name="section3">Bugs, Ideas, Feedback</a></h2> <p>This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category <em>pt</em> of the <a href="http://core.tcl.tk/tcllib/reportlist">Tcllib Trackers</a>. Please also report any ideas for enhancements you may have for either package and/or documentation.</p> </div> <div id="keywords" class="section"><h2><a name="keywords">Keywords</a></h2> <p><a href="../../../../index.html#key3">EBNF</a>, <a href="../../../../index.html#key15">LL(k)</a>, <a href="../../../../index.html#key6">PEG</a>, <a href="../../../../index.html#key7">TDPL</a>, <a href="../../../../index.html#key4">context-free languages</a>, <a href="../../../../index.html#key0">expression</a>, <a href="../../../../index.html#key11">grammar</a>, <a href="../../../../index.html#key5">matching</a>, <a href="../../../../index.html#key9">parser</a>, <a href="../../../../index.html#key8">parsing expression</a>, <a href="../../../../index.html#key14">parsing expression grammar</a>, <a href="../../../../index.html#key1">push down automaton</a>, <a href="../../../../index.html#key10">recursive descent</a>, <a href="../../../../index.html#key2">state</a>, <a href="../../../../index.html#key13">top-down parsing languages</a>, <a href="../../../../index.html#key12">transducer</a></p> </div> <div id="category" class="section"><h2><a name="category">Category</a></h2> <p>Parsing and Grammars</p> </div> <div id="copyright" class="section"><h2><a name="copyright">Copyright</a></h2> <p>Copyright © 2009 Andreas Kupries <[email protected]></p> </div> </div></body></html> |
Changes to embedded/www/tcllib/toc.html.
︙ | ︙ | |||
913 914 915 916 917 918 919 920 921 922 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_cparam_config_tea.html">pt::cparam::configuration::tea</a></td> <td class="#tocright">C/PARAM, Canned configuration, TEA</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_param.html">pt::param</a></td> <td class="#tocright">PackRat Machine Specification</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_pexpression.html">pt::pe</a></td> <td class="#tocright">Parsing Expression Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_pexpr_op.html">pt::pe::op</a></td> <td class="#tocright">Parsing Expression Utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_pegrammar.html">pt::peg</a></td> <td class="#tocright">Parsing Expression Grammar Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_container.html">pt::peg::container</a></td> <td class="#tocright">PEG Storage</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_container_peg.html">pt::peg::container::peg</a></td> <td class="#tocright">PEG Storage. Canned PEG grammar specification</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_export.html">pt::peg::export</a></td> <td class="#tocright">PEG Export</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_export_container.html">pt::peg::export::container</a></td> <td class="#tocright">PEG Export Plugin. Write CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_export_json.html">pt::peg::export::json</a></td> <td class="#tocright">PEG Export Plugin. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_export_peg.html">pt::peg::export::peg</a></td> <td class="#tocright">PEG Export Plugin. Write PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_from_container.html">pt::peg::from::container</a></td> <td class="#tocright">PEG Conversion. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_from_json.html">pt::peg::from::json</a></td> <td class="#tocright">PEG Conversion. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_from_peg.html">pt::peg::from::peg</a></td> <td class="#tocright">PEG Conversion. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_import.html">pt::peg::import</a></td> <td class="#tocright">PEG Import</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_import_container.html">pt::peg::import::container</a></td> <td class="#tocright">PEG Import Plugin. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_import_json.html">pt::peg::import::json</a></td> <td class="#tocright">PEG Import Plugin. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_import_peg.html">pt::peg::import::peg</a></td> <td class="#tocright">PEG Import Plugin. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_interp.html">pt::peg::interp</a></td> <td class="#tocright">Interpreter for parsing expression grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_container.html">pt::peg::to::container</a></td> <td class="#tocright">PEG Conversion. Write CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_cparam.html">pt::peg::to::cparam</a></td> <td class="#tocright">PEG Conversion. Write CPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_json.html">pt::peg::to::json</a></td> <td class="#tocright">PEG Conversion. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_param.html">pt::peg::to::param</a></td> <td class="#tocright">PEG Conversion. Write PARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_peg.html">pt::peg::to::peg</a></td> <td class="#tocright">PEG Conversion. Write PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></td> <td class="#tocright">PEG Conversion. Write TCLPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_language.html">pt::peg_language</a></td> <td class="#tocright">PEG Language Tutorial</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_peg_introduction.html">pt::pegrammar</a></td> <td class="#tocright">Introduction to Parsing Expression Grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_pgen.html">pt::pgen</a></td> <td class="#tocright">Parser Generator</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_rdengine.html">pt::rde</a></td> <td class="#tocright">Parsing Runtime Support, PARAM based</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_tclparam_config_snit.html">pt::tclparam::configuration::snit</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Snit</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_tclparam_config_tcloo.html">pt::tclparam::configuration::tcloo</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Tcloo</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_util.html">pt::util</a></td> <td class="#tocright">General utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="files/modules/pt/pt_to_api.html">pt_export_api</a></td> <td class="#tocright">Parser Tools Export API</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="files/modules/pt/pt_from_api.html">pt_import_api</a></td> <td class="#tocright">Parser Tools Import API</td> |
︙ | ︙ |
Changes to embedded/www/toc.html.
︙ | ︙ | |||
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_tea.html">pt::cparam::configuration::tea</a></td> <td class="#tocright">C/PARAM, Canned configuration, TEA</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_param.html">pt::param</a></td> <td class="#tocright">PackRat Machine Specification</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpression.html">pt::pe</a></td> <td class="#tocright">Parsing Expression Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpr_op.html">pt::pe::op</a></td> <td class="#tocright">Parsing Expression Utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pegrammar.html">pt::peg</a></td> <td class="#tocright">Parsing Expression Grammar Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container.html">pt::peg::container</a></td> <td class="#tocright">PEG Storage</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container_peg.html">pt::peg::container::peg</a></td> <td class="#tocright">PEG Storage. Canned PEG grammar specification</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export.html">pt::peg::export</a></td> <td class="#tocright">PEG Export</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_container.html">pt::peg::export::container</a></td> <td class="#tocright">PEG Export Plugin. Write CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_json.html">pt::peg::export::json</a></td> <td class="#tocright">PEG Export Plugin. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_peg.html">pt::peg::export::peg</a></td> <td class="#tocright">PEG Export Plugin. Write PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_container.html">pt::peg::from::container</a></td> <td class="#tocright">PEG Conversion. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_json.html">pt::peg::from::json</a></td> <td class="#tocright">PEG Conversion. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_peg.html">pt::peg::from::peg</a></td> <td class="#tocright">PEG Conversion. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import.html">pt::peg::import</a></td> <td class="#tocright">PEG Import</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_container.html">pt::peg::import::container</a></td> <td class="#tocright">PEG Import Plugin. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_json.html">pt::peg::import::json</a></td> <td class="#tocright">PEG Import Plugin. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_peg.html">pt::peg::import::peg</a></td> <td class="#tocright">PEG Import Plugin. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_interp.html">pt::peg::interp</a></td> <td class="#tocright">Interpreter for parsing expression grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_container.html">pt::peg::to::container</a></td> <td class="#tocright">PEG Conversion. Write CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_cparam.html">pt::peg::to::cparam</a></td> <td class="#tocright">PEG Conversion. Write CPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_json.html">pt::peg::to::json</a></td> <td class="#tocright">PEG Conversion. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_param.html">pt::peg::to::param</a></td> <td class="#tocright">PEG Conversion. Write PARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_peg.html">pt::peg::to::peg</a></td> <td class="#tocright">PEG Conversion. Write PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></td> <td class="#tocright">PEG Conversion. Write TCLPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_language.html">pt::peg_language</a></td> <td class="#tocright">PEG Language Tutorial</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_introduction.html">pt::pegrammar</a></td> <td class="#tocright">Introduction to Parsing Expression Grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pgen.html">pt::pgen</a></td> <td class="#tocright">Parser Generator</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_rdengine.html">pt::rde</a></td> <td class="#tocright">Parsing Runtime Support, PARAM based</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html">pt::tclparam::configuration::snit</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Snit</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html">pt::tclparam::configuration::tcloo</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Tcloo</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_util.html">pt::util</a></td> <td class="#tocright">General utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_to_api.html">pt_export_api</a></td> <td class="#tocright">Parser Tools Export API</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_from_api.html">pt_import_api</a></td> <td class="#tocright">Parser Tools Import API</td> |
︙ | ︙ | |||
2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_tea.html">pt::cparam::configuration::tea</a></td> <td class="#tocright">C/PARAM, Canned configuration, TEA</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_param.html">pt::param</a></td> <td class="#tocright">PackRat Machine Specification</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpression.html">pt::pe</a></td> <td class="#tocright">Parsing Expression Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpr_op.html">pt::pe::op</a></td> <td class="#tocright">Parsing Expression Utilities</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pegrammar.html">pt::peg</a></td> <td class="#tocright">Parsing Expression Grammar Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container.html">pt::peg::container</a></td> <td class="#tocright">PEG Storage</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container_peg.html">pt::peg::container::peg</a></td> <td class="#tocright">PEG Storage. Canned PEG grammar specification</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export.html">pt::peg::export</a></td> <td class="#tocright">PEG Export</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_container.html">pt::peg::export::container</a></td> <td class="#tocright">PEG Export Plugin. Write CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_json.html">pt::peg::export::json</a></td> <td class="#tocright">PEG Export Plugin. Write JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_peg.html">pt::peg::export::peg</a></td> <td class="#tocright">PEG Export Plugin. Write PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_container.html">pt::peg::from::container</a></td> <td class="#tocright">PEG Conversion. From CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_json.html">pt::peg::from::json</a></td> <td class="#tocright">PEG Conversion. Read JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_peg.html">pt::peg::from::peg</a></td> <td class="#tocright">PEG Conversion. Read PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import.html">pt::peg::import</a></td> <td class="#tocright">PEG Import</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_container.html">pt::peg::import::container</a></td> <td class="#tocright">PEG Import Plugin. From CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_json.html">pt::peg::import::json</a></td> <td class="#tocright">PEG Import Plugin. Read JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_peg.html">pt::peg::import::peg</a></td> <td class="#tocright">PEG Import Plugin. Read PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_interp.html">pt::peg::interp</a></td> <td class="#tocright">Interpreter for parsing expression grammars</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_container.html">pt::peg::to::container</a></td> <td class="#tocright">PEG Conversion. Write CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_cparam.html">pt::peg::to::cparam</a></td> <td class="#tocright">PEG Conversion. Write CPARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_json.html">pt::peg::to::json</a></td> <td class="#tocright">PEG Conversion. Write JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_param.html">pt::peg::to::param</a></td> <td class="#tocright">PEG Conversion. Write PARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_peg.html">pt::peg::to::peg</a></td> <td class="#tocright">PEG Conversion. Write PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></td> <td class="#tocright">PEG Conversion. Write TCLPARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_language.html">pt::peg_language</a></td> <td class="#tocright">PEG Language Tutorial</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_introduction.html">pt::pegrammar</a></td> <td class="#tocright">Introduction to Parsing Expression Grammars</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pgen.html">pt::pgen</a></td> <td class="#tocright">Parser Generator</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_rdengine.html">pt::rde</a></td> <td class="#tocright">Parsing Runtime Support, PARAM based</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html">pt::tclparam::configuration::snit</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Snit</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html">pt::tclparam::configuration::tcloo</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Tcloo</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_util.html">pt::util</a></td> <td class="#tocright">General utilities</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_to_api.html">pt_export_api</a></td> <td class="#tocright">Parser Tools Export API</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_from_api.html">pt_import_api</a></td> <td class="#tocright">Parser Tools Import API</td> |
︙ | ︙ |
Changes to embedded/www/toc0.html.
︙ | ︙ | |||
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_tea.html">pt::cparam::configuration::tea</a></td> <td class="#tocright">C/PARAM, Canned configuration, TEA</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_param.html">pt::param</a></td> <td class="#tocright">PackRat Machine Specification</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpression.html">pt::pe</a></td> <td class="#tocright">Parsing Expression Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpr_op.html">pt::pe::op</a></td> <td class="#tocright">Parsing Expression Utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pegrammar.html">pt::peg</a></td> <td class="#tocright">Parsing Expression Grammar Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container.html">pt::peg::container</a></td> <td class="#tocright">PEG Storage</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container_peg.html">pt::peg::container::peg</a></td> <td class="#tocright">PEG Storage. Canned PEG grammar specification</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export.html">pt::peg::export</a></td> <td class="#tocright">PEG Export</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_container.html">pt::peg::export::container</a></td> <td class="#tocright">PEG Export Plugin. Write CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_json.html">pt::peg::export::json</a></td> <td class="#tocright">PEG Export Plugin. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_peg.html">pt::peg::export::peg</a></td> <td class="#tocright">PEG Export Plugin. Write PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_container.html">pt::peg::from::container</a></td> <td class="#tocright">PEG Conversion. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_json.html">pt::peg::from::json</a></td> <td class="#tocright">PEG Conversion. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_peg.html">pt::peg::from::peg</a></td> <td class="#tocright">PEG Conversion. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import.html">pt::peg::import</a></td> <td class="#tocright">PEG Import</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_container.html">pt::peg::import::container</a></td> <td class="#tocright">PEG Import Plugin. From CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_json.html">pt::peg::import::json</a></td> <td class="#tocright">PEG Import Plugin. Read JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_peg.html">pt::peg::import::peg</a></td> <td class="#tocright">PEG Import Plugin. Read PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_interp.html">pt::peg::interp</a></td> <td class="#tocright">Interpreter for parsing expression grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_container.html">pt::peg::to::container</a></td> <td class="#tocright">PEG Conversion. Write CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_cparam.html">pt::peg::to::cparam</a></td> <td class="#tocright">PEG Conversion. Write CPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_json.html">pt::peg::to::json</a></td> <td class="#tocright">PEG Conversion. Write JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_param.html">pt::peg::to::param</a></td> <td class="#tocright">PEG Conversion. Write PARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_peg.html">pt::peg::to::peg</a></td> <td class="#tocright">PEG Conversion. Write PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></td> <td class="#tocright">PEG Conversion. Write TCLPARAM format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_language.html">pt::peg_language</a></td> <td class="#tocright">PEG Language Tutorial</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_introduction.html">pt::pegrammar</a></td> <td class="#tocright">Introduction to Parsing Expression Grammars</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pgen.html">pt::pgen</a></td> <td class="#tocright">Parser Generator</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_rdengine.html">pt::rde</a></td> <td class="#tocright">Parsing Runtime Support, PARAM based</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html">pt::tclparam::configuration::snit</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Snit</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html">pt::tclparam::configuration::tcloo</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Tcloo</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_util.html">pt::util</a></td> <td class="#tocright">General utilities</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_to_api.html">pt_export_api</a></td> <td class="#tocright">Parser Tools Export API</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_from_api.html">pt_import_api</a></td> <td class="#tocright">Parser Tools Import API</td> |
︙ | ︙ |
Changes to embedded/www/toc1.html.
︙ | ︙ | |||
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | <td class="#tocright">Abstract Syntax Tree Serialization</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_critcl.html">pt::cparam::configuration::critcl</a></td> <td class="#tocright">C/PARAM, Canned configuration, Critcl</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_cparam_config_tea.html">pt::cparam::configuration::tea</a></td> <td class="#tocright">C/PARAM, Canned configuration, TEA</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_json_language.html">pt::json_language</a></td> <td class="#tocright">The JSON Grammar Exchange Format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_param.html">pt::param</a></td> <td class="#tocright">PackRat Machine Specification</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpression.html">pt::pe</a></td> <td class="#tocright">Parsing Expression Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pexpr_op.html">pt::pe::op</a></td> <td class="#tocright">Parsing Expression Utilities</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pegrammar.html">pt::peg</a></td> <td class="#tocright">Parsing Expression Grammar Serialization</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container.html">pt::peg::container</a></td> <td class="#tocright">PEG Storage</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_container_peg.html">pt::peg::container::peg</a></td> <td class="#tocright">PEG Storage. Canned PEG grammar specification</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export.html">pt::peg::export</a></td> <td class="#tocright">PEG Export</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_container.html">pt::peg::export::container</a></td> <td class="#tocright">PEG Export Plugin. Write CONTAINER format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_json.html">pt::peg::export::json</a></td> <td class="#tocright">PEG Export Plugin. Write JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_export_peg.html">pt::peg::export::peg</a></td> <td class="#tocright">PEG Export Plugin. Write PEG format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_container.html">pt::peg::from::container</a></td> <td class="#tocright">PEG Conversion. From CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_json.html">pt::peg::from::json</a></td> <td class="#tocright">PEG Conversion. Read JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_from_peg.html">pt::peg::from::peg</a></td> <td class="#tocright">PEG Conversion. Read PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import.html">pt::peg::import</a></td> <td class="#tocright">PEG Import</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_container.html">pt::peg::import::container</a></td> <td class="#tocright">PEG Import Plugin. From CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_json.html">pt::peg::import::json</a></td> <td class="#tocright">PEG Import Plugin. Read JSON format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_import_peg.html">pt::peg::import::peg</a></td> <td class="#tocright">PEG Import Plugin. Read PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_interp.html">pt::peg::interp</a></td> <td class="#tocright">Interpreter for parsing expression grammars</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_container.html">pt::peg::to::container</a></td> <td class="#tocright">PEG Conversion. Write CONTAINER format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_cparam.html">pt::peg::to::cparam</a></td> <td class="#tocright">PEG Conversion. Write CPARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_json.html">pt::peg::to::json</a></td> <td class="#tocright">PEG Conversion. Write JSON format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_param.html">pt::peg::to::param</a></td> <td class="#tocright">PEG Conversion. Write PARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_peg.html">pt::peg::to::peg</a></td> <td class="#tocright">PEG Conversion. Write PEG format</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_to_tclparam.html">pt::peg::to::tclparam</a></td> <td class="#tocright">PEG Conversion. Write TCLPARAM format</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_language.html">pt::peg_language</a></td> <td class="#tocright">PEG Language Tutorial</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_peg_introduction.html">pt::pegrammar</a></td> <td class="#tocright">Introduction to Parsing Expression Grammars</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_pgen.html">pt::pgen</a></td> <td class="#tocright">Parser Generator</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_rdengine.html">pt::rde</a></td> <td class="#tocright">Parsing Runtime Support, PARAM based</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_snit.html">pt::tclparam::configuration::snit</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Snit</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_tclparam_config_tcloo.html">pt::tclparam::configuration::tcloo</a></td> <td class="#tocright">Tcl/PARAM, Canned configuration, Tcloo</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_util.html">pt::util</a></td> <td class="#tocright">General utilities</td> </tr> <tr class="#tocodd" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_to_api.html">pt_export_api</a></td> <td class="#tocright">Parser Tools Export API</td> </tr> <tr class="#toceven" > <td class="#tocleft" ><a href="tcllib/files/modules/pt/pt_from_api.html">pt_import_api</a></td> <td class="#tocright">Parser Tools Import API</td> |
︙ | ︙ |
Changes to modules/pt/char.tcl.
︙ | ︙ | |||
53 54 55 56 57 58 59 | return [format %c 0x$hcode] } return $ch } | > > | | < < < | > > > > | < | < | < | < > > | < < | < | < | < > > | > | > | > > | > | < | | | > | < | | | | > > > | | | > | | > | | | | > > > > > | < < < > | | < | < | > | | < < < | < < < < < < < < | > > | < | | | > > > > > > > > > > | < > > > > > > | > > | < < | < | 53 54 55 56 57 58 59 60 61 62 63 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | return [format %c 0x$hcode] } return $ch } # ### ### ### ######### ######### ######### proc ::char::quote::tcl {ch args} { Arg Tcl $ch {*}$args } proc ::char::quote::Tcl {ch} { # Input: A single character # Output: A string representing the input. # Properties of the output: # (1) Contains only ASCII characters (7bit Unicode subset). # (2) When embedded in a ""-quoted Tcl string in a piece of Tcl # code the Tcl parser will regenerate the input character. # Special character? switch -exact -- $ch { "\n" {return "\\n"} "\r" {return "\\r"} "\t" {return "\\t"} "\\" - "\;" - " " - "\"" - "(" - ")" - "\{" - "\}" - "\[" - "\]" { # Quote space and all the brackets as well, using octal, # for easy impure list-ness. scan $ch %c chcode return \\[format %o $chcode] } } scan $ch %c chcode # Control character? if {[::string is control -strict $ch]} { return \\[format %o $chcode] } # Unicode beyond 7bit ASCII? if {$chcode > 127} { return \\u[format %04x $chcode] } # Regular character: Is its own representation. return $ch } # ### ### ### ######### ######### ######### proc ::char::quote::string {ch args} { Arg String $ch {*}$args } proc ::char::quote::String {ch} { # Input: A single character # Output: A string representing the input # Properties of the output # (1) Human-readable, for use in error messages, or comments. # (1a) Uses only printable characters. # (2) NO particular properties with regard to C or Tcl parsers. scan $ch %c chcode # Map the ascii control characters to proper names. if {($chcode <= 32) || ($chcode == 127)} { variable strmap return [dict get $strmap $chcode] } # Printable ascii characters represent themselves. if {$chcode < 128} { return $ch } # Unicode characters. Mostly represent themselves, except if # control or not printable. Then they are represented by their # codepoint. # Control characters: Octal if {[::string is control -strict $ch] || ![::string is print -strict $ch]} { return <U+[format %04x $chcode]> } return $ch } namespace eval ::char::quote { variable strmap { 0 <NUL> 8 <BS> 16 <DLE> 24 <CAN> 32 <SPACE> 1 <SOH> 9 <TAB> 17 <DC1> 25 <EM> 127 <DEL> 2 <STX> 10 <LF> 18 <DC2> 26 <SUB> 3 <ETX> 11 <VTAB> 19 <DC3> 27 <ESC> 4 <EOT> 12 <FF> 20 <DC4> 28 <FS> 5 <ENQ> 13 <CR> 21 <NAK> 29 <GS> 6 <ACK> 14 <SO> 22 <SYN> 30 <RS> 7 <BEL> 15 <SI> 23 <ETB> 31 <US> } } # ### ### ### ######### ######### ######### proc ::char::quote::cstring {ch args} { Arg CString $ch {*}$args } proc ::char::quote::CString {ch} { # Input: A single character # Output: A string representing the input. # Properties of the output: # (1) Contains only ASCII characters (7bit Unicode subset). # (2) When embedded in a ""-quoted C string in a piece of # C code the C parser will regenerate the input character # in UTF-8 encoding. # Special characters (named). switch -exact -- $ch { "\n" {return "\\n"} "\r" {return "\\r"} "\t" {return "\\t"} "\"" - "\\" { return \\$ch } "\{" - "\}" { # The generated C code containing the result of this # transform may be embedded in Tcl code (Brace-quoted), # i.e. like for a critcl-based package. To avoid tripping # the Tcl parser with unbalanced braces we sacrifice # readability of the generated code a bit and insert # braces in their octal form. scan $ch %c chcode return \\[format %o $chcode] } } scan $ch %c chcode # Control characters: Octal if {[::string is control -strict $ch]} { return \\[format %o $chcode] } # Beyond 7-bit ASCII: Unicode if {$chcode > 127} { # Recode the character into the sequence of utf-8 bytes and # convert each to octal. foreach x [split [encoding convertto utf-8 $ch] {}] { scan $x %c x append res \\[format %o $x] } return $res } # Regular character: Is its own representation. return $ch } # ### ### ### ######### ######### ######### proc ::char::quote::comment {ch args} { Arg Comment $ch {*}$args } proc ::char::quote::Comment {ch} { # Converts a Tcl character (internal representation) into a string # which is accepted by the Tcl parser when used within a Tcl # comment. |
︙ | ︙ | |||
241 242 243 244 245 246 247 248 249 250 251 | return \\u[format %04x $chcode] } # Regular character: Is its own representation. return $ch } # ### ### ### ######### ######### ######### ## Ready | > > > > > > > > > > > > > > > > > > > > > > > > | < | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | return \\u[format %04x $chcode] } # Regular character: Is its own representation. return $ch } # ### ### ### ######### ######### ######### ## Internal. Argument processing helper proc ::char::quote::Arg {cmdpfx str args} { # single argument => treat as string, # process all characters separately. # return transformed string. if {![llength $args]} { set r {} foreach c [split $str {}] { append r [uplevel 1 [linsert $cmdpfx end $c]] } return $r } # multiple arguments => process each like a single argument, and # return list of transform results. set args [linsert $args 0 $str] foreach str $args { lappend res [uplevel 1 [list Arg $cmdpfx $str]] } return $res } # ### ### ### ######### ######### ######### ## Ready package provide char 1.0.1 |
Added modules/pt/char.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 -*- # char.test: tests for the char package. # # Copyright (c) 2014 by Andreas Kupries <[email protected]> # All rights reserved. # # RCS: @(#) $Id: char.test,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] testsNeedTcl 8.5 testsNeedTcltest 2.0 support { } testing { useLocal char.tcl char } # ------------------------------------------------------------------------- set mytestdir tests/data # ------------------------------------------------------------------------- source [localPath tests/char.tests] #---------------------------------------------------------------------- unset mytestdir testsuiteCleanup return |
Changes to modules/pt/include/format/options_cparam_critcl.inc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [list_begin options] [include options_std.inc] [opt_def -class string] The value of this option is the name of the class to generate, without leading colons. The default value is [const CLASS]. [para] For a simple value [var X] without colons, like CLASS, the parser command will be [var X]::[var X]. Whereas for a namespaced value [var X::Y] the parser command will be [var X::Y]. | > | > > > > > > > > | 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 | [list_begin options] [include options_std.inc] [comment {= = == === ===== ======== =============}] [opt_def -class string] The value of this option is the name of the class to generate, without leading colons. The default value is [const CLASS]. [para] For a simple value [var X] without colons, like CLASS, the parser command will be [var X]::[var X]. Whereas for a namespaced value [var X::Y] the parser command will be [var X::Y]. [comment {= = == === ===== ======== =============}] [opt_def -package string] The value of this option is the name of the package to generate. The default value is [const PACKAGE]. [comment {= = == === ===== ======== =============}] [opt_def -version string] The value of this option is the version of the package to generate. The default value is [const 1]. [comment {= = == === ===== ======== =============}] [list_end] |
Changes to modules/pt/include/format/options_tclparam_oo.inc.
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 | The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option [option -class] is not specified, see above. The default value is [const PACKAGE], applying if neither option [option -package] nor [option -class] were specified. [list_end] | > > > > > > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option [option -class] is not specified, see above. The default value is [const PACKAGE], applying if neither option [option -package] nor [option -class] were specified. [comment {================================================================================}] [opt_def -version string] The value of this option is the version of the package to generate. The default value is [const 1]. [list_end] |
Changes to modules/pt/include/format/options_tclparam_snit.inc.
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 | The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option [option -class] is not specified, see above. The default value is [const PACKAGE], applying if neither option [option -package] nor [option -class] were specified. [list_end] | > > > > > > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | The value of this option is the name of the package to generate, without leading colons. Note, it serves double-duty as the name of the class to generate too, if option [option -class] is not specified, see above. The default value is [const PACKAGE], applying if neither option [option -package] nor [option -class] were specified. [comment {================================================================================}] [opt_def -version string] The value of this option is the version of the package to generate. The default value is [const 1]. [list_end] |
Changes to modules/pt/include/format/peg.inc.
︙ | ︙ | |||
35 36 37 38 39 40 41 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; | | | | < | 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 70 71 72 73 74 75 76 | ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; Class <- OPENB (!CLOSEB Range)* CLOSEB WHITESPACE ; Range <- Char TO Char / Char ; StartExpr <- OPEN Expression CLOSE ; void: Final <- "END" WHITESPACE SEMICOLON WHITESPACE ; # -------------------------------------------------------------------- # Lexing constructs Identifier <- Ident WHITESPACE ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Char <- CharSpecial / CharOctalFull / CharOctalPart / CharUnicode / CharUnescaped ; leaf: CharSpecial <- "\\" [nrt'"\[\]\\] ; leaf: CharOctalFull <- "\\" [0-2][0-7][0-7] ; leaf: CharOctalPart <- "\\" [0-7][0-7]? ; leaf: CharUnicode <- "\\" 'u' HexDigit (HexDigit (HexDigit HexDigit?)?)? ; leaf: CharUnescaped <- !"\\" . ; void: HexDigit <- [0-9a-fA-F] ; void: TO <- '-' ; void: OPENB <- "[" ; void: CLOSEB <- "]" ; void: APOSTROPH <- "'" ; void: DAPOSTROPH <- '"' ; void: PEG <- "PEG" !([_:] / <alnum>) WHITESPACE ; void: IS <- "<-" WHITESPACE ; leaf: VOID <- "void" WHITESPACE ; # Implies that definition has no semantic value. leaf: LEAF <- "leaf" WHITESPACE ; # Implies that definition has no terminals. void: SEMICOLON <- ";" WHITESPACE ; void: COLON <- ":" WHITESPACE ; void: SLASH <- "/" WHITESPACE ; leaf: AND <- "&" WHITESPACE ; leaf: NOT <- "!" WHITESPACE ; leaf: QUESTION <- "?" WHITESPACE ; leaf: STAR <- "*" WHITESPACE ; |
︙ | ︙ |
Changes to modules/pt/pkgIndex.tcl.
1 2 3 | if {![package vsatisfies [package provide Tcl] 8.5]} return # General utilities. | | > > > > | | | | | | | | | | | | | | | | | > | | | | 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 67 | if {![package vsatisfies [package provide Tcl] 8.5]} return # General utilities. package ifneeded char 1.0.1 [list source [file join $dir char.tcl]] package ifneeded configuration 1 [list source [file join $dir configuration.tcl]] package ifneeded paths 1 [list source [file join $dir paths.tcl]] package ifneeded text::write 1 [list source [file join $dir text_write.tcl]] # AST support package ifneeded pt::ast 1.1 [list source [file join $dir pt_astree.tcl]] # General parser support. Currently only conversion of structured # syntax errors (or parts thereof) into a human-readable form. package ifneeded pt::util 1 [list source [file join $dir pt_util.tcl]] # Parsing Expression support package ifneeded pt::pe 1.0.2 [list source [file join $dir pt_pexpression.tcl]] package ifneeded pt::pe::op 1 [list source [file join $dir pt_pexpr_op.tcl]] # Parsing Expression Grammar support. package ifneeded pt::peg 1 [list source [file join $dir pt_pegrammar.tcl]] package ifneeded pt::peg::container 1 [list source [file join $dir pt_peg_container.tcl]] package ifneeded pt::peg::interp 1.0.1 [list source [file join $dir pt_peg_interp.tcl]] package ifneeded pt::peg::op 1.0.1 [list source [file join $dir pt_peg_op.tcl]] package ifneeded pt::parse::peg 1.0.1 [list source [file join $dir pt_parse_peg.tcl]] # Export/import managers. Assumes an untrusted environment. package ifneeded pt::peg::export 1 [list source [file join $dir pt_peg_export.tcl]] package ifneeded pt::peg::import 1 [list source [file join $dir pt_peg_import.tcl]] # Export plugins, connecting manager to the core conversion packages. package ifneeded pt::peg::export::container 1 [list source [file join $dir pt_peg_export_container.tcl]] package ifneeded pt::peg::export::json 1 [list source [file join $dir pt_peg_export_json.tcl]] package ifneeded pt::peg::export::peg 1 [list source [file join $dir pt_peg_export_peg.tcl]] # Import plugins, connecting manager to the core conversion packages. package ifneeded pt::peg::import::json 1 [list source [file join $dir pt_peg_import_json.tcl]] package ifneeded pt::peg::import::peg 1 [list source [file join $dir pt_peg_import_peg.tcl]] # Export core functionality: Conversion from PEG to a specific format. package ifneeded pt::peg::to::container 1 [list source [file join $dir pt_peg_to_container.tcl]] package ifneeded pt::peg::to::cparam 1.1.3 [list source [file join $dir pt_peg_to_cparam.tcl]] package ifneeded pt::peg::to::json 1 [list source [file join $dir pt_peg_to_json.tcl]] package ifneeded pt::peg::to::param 1.0.1 [list source [file join $dir pt_peg_to_param.tcl]] package ifneeded pt::peg::to::peg 1.0.2 [list source [file join $dir pt_peg_to_peg.tcl]] package ifneeded pt::peg::to::tclparam 1.0.2 [list source [file join $dir pt_peg_to_tclparam.tcl]] # Import core functionality: Conversion from a specific format to PEG. package ifneeded pt::peg::from::json 1 [list source [file join $dir pt_peg_from_json.tcl]] package ifneeded pt::peg::from::peg 1.0.3 [list source [file join $dir pt_peg_from_peg.tcl]] # PARAM runtime. package ifneeded pt::rde 1.0.3 [list source [file join $dir pt_rdengine.tcl]] package ifneeded pt::rde::oo 1.0.3 [list source [file join $dir pt_rdengine_oo.tcl]] # PEG grammar specification, as CONTAINER package ifneeded pt::peg::container::peg 1 [list source [file join $dir pt_peg_container_peg.tcl]] # */PARAM support (canned configurations). package ifneeded pt::cparam::configuration::critcl 1.0.2 [list source [file join $dir pt_cparam_config_critcl.tcl]] package ifneeded pt::cparam::configuration::tea 0.1 [list source [file join $dir pt_cparam_config_tea.tcl]] package ifneeded pt::tclparam::configuration::snit 1.0.2 [list source [file join $dir pt_tclparam_config_snit.tcl]] package ifneeded pt::tclparam::configuration::tcloo 1.0.4 [list source [file join $dir pt_tclparam_config_tcloo.tcl]] # Parser generator core. package ifneeded pt::pgen 1.0.3 [list source [file join $dir pt_pgen.tcl]] |
Changes to modules/pt/pt_cparam_config_critcl.man.
1 | [comment {-*- text -*- doctools manpage}] | > | | | | | 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 | [vset VERSION 1.0.2] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::cparam::configuration::critcl n [vset VERSION]] [include include/module.inc] [titledesc {C/PARAM, Canned configuration, Critcl}] [require pt::cparam::configuration::critcl [opt [vset VERSION]]] [description] [include include/ref_intro.inc] This package is an adjunct to [package pt::peg::to::cparam], to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package [package pt::peg::to::cparam] to generate [package critcl]-based parser packages. [para] It is a supporting package in the Core Layer of Parser Tools. [para][image arch_core_support][para] [section API] [list_begin definitions] [call [cmd ::pt::cparam::configuration::critcl] [method def] \ [arg name] [arg pkg] [arg version] [arg cmdprefix]] The command applies the configuration provided by this package to the [arg cmdprefix], causing the creation of [package critcl]-based parsers whose class is [arg name], in package [arg pkg] with [arg version]. [para] The use of a command prefix as API allows application of the configuration to not only [package pt::peg::to::cparam] ([cmd {pt::peg::to::cparam configure}]), but also export manager instances and PEG containers ([cmd {$export configuration set}] and |
︙ | ︙ |
Changes to modules/pt/pt_cparam_config_critcl.tcl.
1 | # -*- tcl -*- | | > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | # -*- tcl -*- # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # TODO: Refactor this and pt::cparam::configuration::critcl to avoid # TODO: duplication of the supporting code (creation of the RDE # TODO: amalgamation, basic C template). # Canned configuration for the converter to C/PARAM representation, # causing generation of a proper critcl-based parser. # The requirements of the embedded template are not our requirements. # @mdgen NODEP: critcl |
︙ | ︙ | |||
29 30 31 32 33 34 35 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. | | | > | > > > > > > > > | < < < < < < < < | | | 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 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 99 100 101 102 103 104 105 106 107 108 109 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. proc ::pt::cparam::configuration::critcl::def {class pkg version cmd} { # TODO :: See if we can consolidate the API for converters, # TODO :: plugins, export manager, and container in some way. # TODO :: Container may make exporter manager available through # TODO :: public method. # class = The namespace/prefix for the generated commands. # pkg = The name of the generated package / parser. # version = The version of the generated package / parser. if {[string first :: $class] < 0} { set cheader $class set ctrailer $class } else { set cheader [namespace qualifier $class] set ctrailer [namespace tail $class] } lappend map @@RUNTIME@@ [GetRuntime] lappend map @@PKG@@ $pkg lappend map @@VERSION@@ $version lappend map @@CLASS@@ $class lappend map @@CHEAD@@ $cheader lappend map @@CTAIL@@ $ctrailer lappend map \n\t \n ;# undent the template {*}$cmd -main MAIN {*}$cmd -indent 8 {*}$cmd -template [string trim \ [string map $map { ## -*- tcl -*- ## ## Critcl-based C/PARAM implementation of the parsing ## expression grammar ## ## @name@ ## ## Generated from file @file@ ## for user @user@ ## # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.4 package require critcl # @sak notprovided @@PKG@@ package provide @@PKG@@ @@VERSION@@ # Note: The implementation of the PARAM virtual machine # underlying the C/PARAM code used below is inlined # into the generated parser, allowing for direct access # and manipulation of the RDE state, instead of having # to dispatch through the Tcl interpreter. # # ## ### ##### ######## ############# ##################### ## namespace eval ::@@CHEAD@@ { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
158 159 160 161 162 163 164 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "@@CTAIL@@%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ | |||
395 396 397 398 399 400 401 | return }]] return } proc ::pt::cparam::configuration::critcl::GetRuntime {} { | < | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | return }]] return } proc ::pt::cparam::configuration::critcl::GetRuntime {} { # This is the C code for the RDE, i.e. the implementation of # pt::rde. Only the low-level engine is imported, the Tcl # interface layer is ignored. This generated parser provides its # own layer for that. # We are inlining the code (making the functions static) to # prevent any conflict with the support for pt::rde, should both |
︙ | ︙ | |||
473 474 475 476 477 478 479 | # # ## ### ##### ######## ############# namespace eval ::pt::cparam::configuration::critcl {} # # ## ### ##### ######## ############# ##################### ## Ready | | | 484 485 486 487 488 489 490 491 492 | # # ## ### ##### ######## ############# namespace eval ::pt::cparam::configuration::critcl {} # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::cparam::configuration::critcl 1.0.2 return |
Added modules/pt/pt_cparam_config_tea.man.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | [vset VERSION 0.1] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::cparam::configuration::tea n [vset VERSION]] [include include/module.inc] [titledesc {C/PARAM, Canned configuration, TEA}] [require pt::cparam::configuration::tea [opt [vset VERSION]]] [description] [include include/ref_intro.inc] This package is an adjunct to [package pt::peg::to::cparam], to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package [package pt::peg::to::cparam] to generate plain parser code ready for inclusion into a [term TEA]-based C extension. [para] It is a supporting package in the Core Layer of Parser Tools. [para][image arch_core_support][para] [section API] [list_begin definitions] [call [cmd ::pt::cparam::configuration::tea] [method def] \ [arg name] [arg pkg] [arg version] [arg cmdprefix]] The command applies the configuration provided by this package to the [arg cmdprefix], causing the creation of [package tea]-based parsers whose class is [arg name], in package [arg pkg] with [arg version]. [para] The use of a command prefix as API allows application of the configuration to not only [package pt::peg::to::cparam] ([cmd {pt::peg::to::cparam configure}]), but also export manager instances and PEG containers ([cmd {$export configuration set}] and [cmd {[$container exporter] configuration set}] respectively). [para] Or anything other command prefix accepting two arguments, option and value. [list_end] [include include/feedback.inc] [manpage_end] |
Added modules/pt/pt_cparam_config_tea.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 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | # -*- tcl -*- # Copyright (c) 2014 Christian Gollwitzer <[email protected]> # TODO: Refactor this and pt::cparam::configuration::critcl to avoid # TODO: duplication of the supporting code (creation of the RDE # TODO: amalgamation, basic C template). # Canned configuration for the converter to C/PARAM representation, # causing generation of a C-based parser which can be plugged into a # TEA-based C extension. The supporting files, i.e. configure.in, # Makefile.in, etc. still have to be written separately, and manually. # The generated file can easily be compiled with a single # # gcc -dynamiclib -o <parser>.dylib <parser>.c -DUSE_TCL_STUBS -ltclstub8.5 # # or similar, or included in a larger package, if added to the source # files and by invoking the <parser>_Init() function within the init # function of the main package. # # TODO: Put the above note/semi-example into the manpage for this generator. # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.5 ; # Required runtime. # # ## ### ##### ######## ############# ##################### ## namespace eval ::pt::cparam::configuration::tea { namespace export def namespace ensemble create # @mdgen OWNER: rde_critcl/util.* # @mdgen OWNER: rde_critcl/stack.* # @mdgen OWNER: rde_critcl/tc.* # @mdgen OWNER: rde_critcl/param.* # Access to the rde_critcl files forming the low-level runtime variable selfdir [file dirname [file normalize [info script]]] } # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. proc ::pt::cparam::configuration::tea::def {class pkg version cmd} { # TODO :: See if we can consolidate the API for converters, # TODO :: plugins, export manager, and container in some way. # TODO :: Container may make exporter manager available through # TODO :: public method. # class = The namespace/prefix for the generated commands. # pkg = The name of the generated package / parser. # version = The version of the generated package / parser. if {[string first :: $class] < 0} { set cheader $class set ctrailer $class } else { set cheader [namespace qualifier $class] set ctrailer [namespace tail $class] } set pkghead [string range $pkg 0 0] set pkgtail [string range $pkg 1 end] set pkglowcase "[string toupper $pkghead][string tolower $pkgtail]" lappend map @@RUNTIME@@ [GetRuntime] lappend map @@PKG@@ $pkg lappend map @@PKGLOWCASE@@ $pkglowcase lappend map @@VERSION@@ $version lappend map @@CLASS@@ $class lappend map @@CHEAD@@ $cheader lappend map @@CTAIL@@ $ctrailer lappend map \n\t \n ;# undent the template {*}$cmd -main MAIN {*}$cmd -indent 8 {*}$cmd -template [string trim \ [string map $map { /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** @name@ ** ** Generated from file @file@ ** for user @user@ ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static @@RUNTIME@@ @code@ /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/@@PKG@@/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "@@CTAIL@@%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int @@PKGLOWCASE@@_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "@@CLASS@@", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "@@PKG@@", "0.1"); return TCL_OK; } }]] return } proc ::pt::cparam::configuration::tea::GetRuntime {} { # This is the C code for the RDE, i.e. the implementation of # pt::rde. Only the low-level engine is imported, the Tcl # interface layer is ignored. This generated parser provides its # own layer for that. # We are inlining the code (making the functions static) to # prevent any conflict with the support for pt::rde, should both # be put into the same shared library. variable selfdir set code {} foreach f { rde_critcl/util.h rde_critcl/stack.h rde_critcl/tc.h rde_critcl/param.h rde_critcl/util.c rde_critcl/stack.c rde_critcl/tc.c rde_critcl/param.c } { # Load C code. set c [open $selfdir/$f] set d [read $c] close $c # Strip include directives and anything explicitly excluded. set skip 0 set n {} foreach l [split $d \n] { if {[string match {*#include*} $l]} { continue } if {[string match {*SKIP START*} $l]} { set skip 1 continue } if {[string match {*SKIP END*} $l]} { set skip 0 continue } if {$skip} continue lappend n $l } set d [join $n \n] # Strip comments, trailing whitespace, empty lines. set d [regsub -all {/\*.*?\*/} $d {}] set d [regsub -all {//.*?\n} $d {}] set d [regsub -all {[ ]+$} $d {}] while {1} { set n [string map [list \n\n \n] $d] if {$n eq $d} break set d $n } # Indent code. lappend code "#line 1 \"$f\"" foreach l [split $d \n] { if {$l ne ""} { set l \t$l } lappend code $l } } #lappend code "#line x \"X\"" return [join $code \n] } # # ## ### ##### ######## ############# namespace eval ::pt::cparam::configuration::tea {} # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::cparam::configuration::tea 0.1 return |
Added modules/pt/pt_cparam_config_tea.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | # -*- tcl -*- # pt_cparam_config_critcl.test: tests for the pt::peg::to::cparam # converter package configured for critcl. # # Copyright (c) 2009 by Andreas Kupries <[email protected]> # All rights reserved. # # RCS: @(#) $Id: pt_cparam_config_critcl.test,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] testsNeedTcl 8.5 testsNeedTcltest 2 support { useAccel [useTcllibC] struct/sets.tcl struct::set ; # used by pt::pe::op, TestAccelInit struct::set ; # however not by the # # commands used here. use fileutil/fileutil.tcl fileutil ;# tests/common use textutil/adjust.tcl textutil::adjust useLocal pt_pexpression.tcl pt::pe useLocal pt_pexpr_op.tcl pt::pe::op useLocal pt_pegrammar.tcl pt::peg useLocal text_write.tcl text::write useLocal char.tcl char useLocal pt_peg_to_cparam.tcl pt::peg::to::cparam source [localPath tests/common] } testing { useLocal pt_cparam_config_tea.tcl pt::cparam::configuration::tea } set mytestdir tests/data # ------------------------------------------------------------------------- source [localPath tests/pt_cparam_config_tea.tests] # ------------------------------------------------------------------------- TestAccelExit struct::set testsuiteCleanup return |
Changes to modules/pt/pt_parse_peg.tcl.
1 2 | # -*- tcl -*- # | | | 1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ##################### ## Package description ## Implementation of a parser for PE grammars. We have multiple ## implementations in Tcl (Snit-based), and C (Critcl-based). The ## system will try to use the latter where possible. |
︙ | ︙ | |||
173 174 175 176 177 178 179 | ## Ready namespace eval ::pt { # Export the constructor command. namespace export rde } | | | 173 174 175 176 177 178 179 180 | ## Ready namespace eval ::pt { # Export the constructor command. namespace export rde } package provide pt::parse::peg 1.0.1 |
Changes to modules/pt/pt_parse_peg_c.tcl.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ## # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.4 package require critcl # @sak notprovided pt_parse_peg_c | | | | 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 | ## # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.4 package require critcl # @sak notprovided pt_parse_peg_c package provide pt_parse_peg_c 1.0.1 # Note: The implementation of the PARAM virtual machine # underlying the C/PARAM code used below is inlined # into the generated parser, allowing for direct access # and manipulation of the RDE state, instead of having # to dispatch through the Tcl interpreter. # # ## ### ##### ######## ############# ##################### ## namespace eval ::pt::parse { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | | > > | 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 842 843 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 | static void optional_137 (RDE_PARAM p); static void sequence_143 (RDE_PARAM p); static void sym_Definition (RDE_PARAM p); static void sequence_148 (RDE_PARAM p); static void sym_DIGIT (RDE_PARAM p); static void sequence_153 (RDE_PARAM p); static void sym_DOT (RDE_PARAM p); | < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > | 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 | static void optional_137 (RDE_PARAM p); static void sequence_143 (RDE_PARAM p); static void sym_Definition (RDE_PARAM p); static void sequence_148 (RDE_PARAM p); static void sym_DIGIT (RDE_PARAM p); static void sequence_153 (RDE_PARAM p); static void sym_DOT (RDE_PARAM p); static void notahead_157 (RDE_PARAM p); static void sym_EOF (RDE_PARAM p); static void sym_EOL (RDE_PARAM p); static void sequence_165 (RDE_PARAM p); static void kleene_167 (RDE_PARAM p); static void sequence_169 (RDE_PARAM p); static void sym_Expression (RDE_PARAM p); static void sequence_176 (RDE_PARAM p); static void sym_Final (RDE_PARAM p); static void kleene_182 (RDE_PARAM p); static void sequence_186 (RDE_PARAM p); static void sym_Grammar (RDE_PARAM p); static void sequence_191 (RDE_PARAM p); static void sym_GRAPH (RDE_PARAM p); static void sequence_197 (RDE_PARAM p); static void sym_Header (RDE_PARAM p); static void choice_202 (RDE_PARAM p); static void choice_206 (RDE_PARAM p); static void kleene_208 (RDE_PARAM p); static void sequence_210 (RDE_PARAM p); static void sym_Ident (RDE_PARAM p); static void sequence_215 (RDE_PARAM p); static void sym_Identifier (RDE_PARAM p); static void sequence_220 (RDE_PARAM p); static void sym_IS (RDE_PARAM p); static void sequence_225 (RDE_PARAM p); static void sym_LEAF (RDE_PARAM p); static void notahead_230 (RDE_PARAM p); static void sequence_233 (RDE_PARAM p); static void kleene_235 (RDE_PARAM p); static void sequence_239 (RDE_PARAM p); static void notahead_243 (RDE_PARAM p); static void sequence_246 (RDE_PARAM p); static void kleene_248 (RDE_PARAM p); static void sequence_252 (RDE_PARAM p); static void choice_254 (RDE_PARAM p); static void sym_Literal (RDE_PARAM p); static void sequence_259 (RDE_PARAM p); static void sym_LOWER (RDE_PARAM p); static void sequence_264 (RDE_PARAM p); static void sym_NOT (RDE_PARAM p); static void sequence_269 (RDE_PARAM p); static void sym_OPEN (RDE_PARAM p); static void sym_OPENB (RDE_PARAM p); static void notahead_278 (RDE_PARAM p); static void sequence_281 (RDE_PARAM p); static void sym_PEG (RDE_PARAM p); static void sequence_286 (RDE_PARAM p); static void sym_PLUS (RDE_PARAM p); static void choice_291 (RDE_PARAM p); static void optional_293 (RDE_PARAM p); static void sequence_296 (RDE_PARAM p); static void sym_Prefix (RDE_PARAM p); static void sequence_317 (RDE_PARAM p); static void choice_322 (RDE_PARAM p); static void sym_Primary (RDE_PARAM p); static void sequence_327 (RDE_PARAM p); static void sym_PRINTABLE (RDE_PARAM p); static void sequence_332 (RDE_PARAM p); static void sym_PUNCT (RDE_PARAM p); static void sequence_337 (RDE_PARAM p); static void sym_QUESTION (RDE_PARAM p); static void sequence_343 (RDE_PARAM p); static void choice_346 (RDE_PARAM p); static void sym_Range (RDE_PARAM p); static void sequence_351 (RDE_PARAM p); static void sym_SEMICOLON (RDE_PARAM p); static void poskleene_355 (RDE_PARAM p); static void sym_Sequence (RDE_PARAM p); static void sequence_360 (RDE_PARAM p); static void sym_SLASH (RDE_PARAM p); static void sequence_365 (RDE_PARAM p); static void sym_SPACE (RDE_PARAM p); static void sequence_370 (RDE_PARAM p); static void sym_STAR (RDE_PARAM p); static void sym_StartExpr (RDE_PARAM p); static void choice_382 (RDE_PARAM p); static void optional_384 (RDE_PARAM p); static void sequence_386 (RDE_PARAM p); static void sym_Suffix (RDE_PARAM p); static void sym_TO (RDE_PARAM p); static void sequence_393 (RDE_PARAM p); static void sym_UPPER (RDE_PARAM p); static void sequence_398 (RDE_PARAM p); static void sym_VOID (RDE_PARAM p); static void choice_403 (RDE_PARAM p); static void kleene_405 (RDE_PARAM p); static void sym_WHITESPACE (RDE_PARAM p); static void sequence_410 (RDE_PARAM p); static void sym_WORDCHAR (RDE_PARAM p); static void sequence_415 (RDE_PARAM p); static void sym_XDIGIT (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [178] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str <alnum>", /* 15 = */ "n ALNUM", /* 16 = */ "ALNUM", /* 17 = */ "str <alpha>", /* 18 = */ "n ALPHA", /* 19 = */ "ALPHA", /* 20 = */ "t &", /* 21 = */ "n AND", /* 22 = */ "AND", /* 23 = */ "t '", /* 24 = */ "n APOSTROPH", /* 25 = */ "APOSTROPH", /* 26 = */ "str <ascii>", /* 27 = */ "n ASCII", /* 28 = */ "ASCII", /* 29 = */ "n Attribute", /* 30 = */ "Attribute", /* 31 = */ "n Char", /* 32 = */ "Char", /* 33 = */ "t \\\\", /* 34 = */ ".. 0 2", /* 35 = */ ".. 0 7", /* 36 = */ "n CharOctalFull", /* 37 = */ "CharOctalFull", /* 38 = */ "n CharOctalPart", /* 39 = */ "CharOctalPart", /* 40 = */ "cl nrt'\\\"\\[\\]\\\\", /* 41 = */ "n CharSpecial", /* 42 = */ "CharSpecial", /* 43 = */ "dot", /* 44 = */ "n CharUnescaped", /* 45 = */ "CharUnescaped", /* 46 = */ "str \173\\u\175", /* 47 = */ "n CharUnicode", /* 48 = */ "CharUnicode", /* 49 = */ "n Class", /* 50 = */ "Class", /* 51 = */ "t )", /* 52 = */ "n CLOSE", /* 53 = */ "CLOSE", /* 54 = */ "t \\]", /* 55 = */ "n CLOSEB", /* 56 = */ "CLOSEB", /* 57 = */ "t :", /* 58 = */ "n COLON", /* 59 = */ "COLON", /* 60 = */ "t #", /* 61 = */ "n COMMENT", /* 62 = */ "COMMENT", /* 63 = */ "str <control>", /* 64 = */ "n CONTROL", /* 65 = */ "CONTROL", /* 66 = */ "t \173\"\175", /* 67 = */ "n DAPOSTROPH", /* 68 = */ "DAPOSTROPH", /* 69 = */ "str <ddigit>", /* 70 = */ "n DDIGIT", /* 71 = */ "DDIGIT", /* 72 = */ "n Definition", /* 73 = */ "Definition", /* 74 = */ "str <digit>", /* 75 = */ "n DIGIT", /* 76 = */ "DIGIT", /* 77 = */ "t .", /* 78 = */ "n DOT", /* 79 = */ "DOT", /* 80 = */ "n EOF", /* 81 = */ "EOF", /* 82 = */ "cl \173\n\r\175", /* 83 = */ "n EOL", /* 84 = */ "EOL", /* 85 = */ "n Expression", /* 86 = */ "Expression", /* 87 = */ "str END", /* 88 = */ "n Final", /* 89 = */ "Final", /* 90 = */ "n Grammar", /* 91 = */ "Grammar", /* 92 = */ "str <graph>", /* 93 = */ "n GRAPH", /* 94 = */ "GRAPH", /* 95 = */ "n Header", /* 96 = */ "Header", /* 97 = */ "cl _:", /* 98 = */ "n Ident", /* 99 = */ "Ident", /* 100 = */ "n Identifier", /* 101 = */ "Identifier", /* 102 = */ "str <-", /* 103 = */ "n IS", /* 104 = */ "IS", /* 105 = */ "str leaf", /* 106 = */ "n LEAF", /* 107 = */ "LEAF", /* 108 = */ "n Literal", /* 109 = */ "Literal", /* 110 = */ "str <lower>", /* 111 = */ "n LOWER", /* 112 = */ "LOWER", /* 113 = */ "t !", /* 114 = */ "n NOT", /* 115 = */ "NOT", /* 116 = */ "t (", /* 117 = */ "n OPEN", /* 118 = */ "OPEN", /* 119 = */ "t \173[\175", /* 120 = */ "n OPENB", /* 121 = */ "OPENB", /* 122 = */ "str PEG", /* 123 = */ "n PEG", /* 124 = */ "PEG", /* 125 = */ "t +", /* 126 = */ "n PLUS", /* 127 = */ "PLUS", /* 128 = */ "n Prefix", /* 129 = */ "Prefix", /* 130 = */ "n Primary", /* 131 = */ "Primary", /* 132 = */ "str <print>", /* 133 = */ "n PRINTABLE", /* 134 = */ "PRINTABLE", /* 135 = */ "str <punct>", /* 136 = */ "n PUNCT", /* 137 = */ "PUNCT", /* 138 = */ "t ?", /* 139 = */ "n QUESTION", /* 140 = */ "QUESTION", /* 141 = */ "n Range", /* 142 = */ "Range", /* 143 = */ "t \173;\175", /* 144 = */ "n SEMICOLON", /* 145 = */ "SEMICOLON", /* 146 = */ "n Sequence", /* 147 = */ "Sequence", /* 148 = */ "t /", /* 149 = */ "n SLASH", /* 150 = */ "SLASH", /* 151 = */ "str <space>", /* 152 = */ "n SPACE", /* 153 = */ "SPACE", /* 154 = */ "t *", /* 155 = */ "n STAR", /* 156 = */ "STAR", /* 157 = */ "n StartExpr", /* 158 = */ "StartExpr", /* 159 = */ "n Suffix", /* 160 = */ "Suffix", /* 161 = */ "t -", /* 162 = */ "n TO", /* 163 = */ "TO", /* 164 = */ "str <upper>", /* 165 = */ "n UPPER", /* 166 = */ "UPPER", /* 167 = */ "str void", /* 168 = */ "n VOID", /* 169 = */ "VOID", /* 170 = */ "n WHITESPACE", /* 171 = */ "WHITESPACE", /* 172 = */ "str <wordchar>", /* 173 = */ "n WORDCHAR", /* 174 = */ "WORDCHAR", /* 175 = */ "str <xdigit>", /* 176 = */ "n XDIGIT", /* 177 = */ "XDIGIT" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { |
︙ | ︙ | |||
2030 2031 2032 2033 2034 2035 2036 | static void sym_ALNUM (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 | static void sym_ALNUM (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_4 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_4 (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alnum>", 14); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'ALPHA' */ static void sym_ALPHA (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 19)) return ; sequence_9 (p); rde_param_i_symbol_done_leaf (p, 19, 18); return; } static void sequence_9 (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alpha>", 17); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'AND' */ static void sym_AND (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 22)) return ; sequence_14 (p); rde_param_i_symbol_done_leaf (p, 22, 21); return; } static void sequence_14 (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "&", 20); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'APOSTROPH' */ static void sym_APOSTROPH (RDE_PARAM p) { /* * ''' */ if (rde_param_i_symbol_void_start (p, 25)) return ; rde_param_i_next_char (p, "'", 23); rde_param_i_symbol_done_void (p, 25, 24); return; } /* * leaf Symbol 'ASCII' */ static void sym_ASCII (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 28)) return ; sequence_21 (p); rde_param_i_symbol_done_leaf (p, 28, 27); return; } static void sequence_21 (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ascii>", 26); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Attribute' */ static void sym_Attribute (RDE_PARAM p) { /* * x * / * (VOID) * (LEAF) * (COLON) */ if (rde_param_i_symbol_start_d (p, 30)) return ; sequence_29 (p); rde_param_i_symbol_done_d_reduce (p, 30, 29); return; } static void sequence_29 (RDE_PARAM p) { /* * x * / |
︙ | ︙ | |||
2227 2228 2229 2230 2231 2232 2233 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ | | | | 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ if (rde_param_i_symbol_start_d (p, 32)) return ; choice_37 (p); rde_param_i_symbol_done_d_reduce (p, 32, 31); return; } static void choice_37 (RDE_PARAM p) { /* * / * (CharSpecial) |
︙ | ︙ | |||
2270 2271 2272 2273 2274 2275 2276 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ | | | | | | | | | | | | | | | | | | | | | | | 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 37)) return ; sequence_44 (p); rde_param_i_symbol_done_leaf (p, 37, 36); return; } static void sequence_44 (RDE_PARAM p) { /* * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "2", 34); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharOctalPart' */ static void sym_CharOctalPart (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 39)) return ; sequence_52 (p); rde_param_i_symbol_done_leaf (p, 39, 38); return; } static void sequence_52 (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; optional_50 (p); rde_param_i_state_merge_void (p); return; } static void optional_50 (RDE_PARAM p) { /* * ? * range (0 .. 7) */ rde_param_i_state_push_2 (p); rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_ok (p); return; } /* * leaf Symbol 'CharSpecial' */ static void sym_CharSpecial (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ if (rde_param_i_symbol_start (p, 42)) return ; sequence_57 (p); rde_param_i_symbol_done_leaf (p, 42, 41); return; } static void sequence_57 (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_class (p, "nrt'\"[]\\", 40); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharUnescaped' */ static void sym_CharUnescaped (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ if (rde_param_i_symbol_start (p, 45)) return ; sequence_64 (p); rde_param_i_symbol_done_leaf (p, 45, 44); return; } static void sequence_64 (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ rde_param_i_state_push_void (p); notahead_61 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_61 (RDE_PARAM p) { /* * ! * '\' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "\\", 33); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'CharUnicode' */ |
︙ | ︙ | |||
2444 2445 2446 2447 2448 2449 2450 | * ? * x * <xdigit> * ? * <xdigit> */ | | | | | | 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 | * ? * x * <xdigit> * ? * <xdigit> */ if (rde_param_i_symbol_start (p, 48)) return ; sequence_82 (p); rde_param_i_symbol_done_leaf (p, 48, 47); return; } static void sequence_82 (RDE_PARAM p) { /* * x * "\u" * <xdigit> * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "\\u", 46); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_80 (p); rde_param_i_state_merge_void (p); return; } static void optional_80 (RDE_PARAM p) { |
︙ | ︙ | |||
2505 2506 2507 2508 2509 2510 2511 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); | | | 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_76 (p); rde_param_i_state_merge_void (p); return; } static void optional_76 (RDE_PARAM p) { |
︙ | ︙ | |||
2536 2537 2538 2539 2540 2541 2542 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); | | | | 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_72 (p); rde_param_i_state_merge_void (p); return; } static void optional_72 (RDE_PARAM p) { /* * ? * <xdigit> */ rde_param_i_state_push_2 (p); rde_param_i_next_xdigit (p, 13); rde_param_i_state_merge_ok (p); return; } /* * value Symbol 'Class' */ |
︙ | ︙ | |||
2572 2573 2574 2575 2576 2577 2578 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ | | | | 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 50)) return ; sequence_96 (p); rde_param_i_symbol_done_d_reduce (p, 50, 49); return; } static void sequence_96 (RDE_PARAM p) { /* * x * (OPENB) |
︙ | ︙ | |||
2659 2660 2661 2662 2663 2664 2665 | static void sym_CLOSE (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ | | | | | | | | | | | 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 | static void sym_CLOSE (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 53)) return ; sequence_101 (p); rde_param_i_symbol_done_void (p, 53, 52); return; } static void sequence_101 (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ")", 51); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'CLOSEB' */ static void sym_CLOSEB (RDE_PARAM p) { /* * ']' */ if (rde_param_i_symbol_void_start (p, 56)) return ; rde_param_i_next_char (p, "]", 54); rde_param_i_symbol_done_void (p, 56, 55); return; } /* * void Symbol 'COLON' */ static void sym_COLON (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 59)) return ; sequence_108 (p); rde_param_i_symbol_done_void (p, 59, 58); return; } static void sequence_108 (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ":", 57); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
2743 2744 2745 2746 2747 2748 2749 | * x * ! * (EOL) * <dot> * (EOL) */ | | | | | 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 | * x * ! * (EOL) * <dot> * (EOL) */ if (rde_param_i_symbol_void_start (p, 62)) return ; sequence_121 (p); rde_param_i_symbol_done_void (p, 62, 61); return; } static void sequence_121 (RDE_PARAM p) { /* * x * '#' * * * x * ! * (EOL) * <dot> * (EOL) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "#", 60); if (rde_param_i_seq_void2void(p)) return; kleene_118 (p); if (rde_param_i_seq_void2void(p)) return; sym_EOL (p); rde_param_i_state_merge_void (p); return; } |
︙ | ︙ | |||
2799 2800 2801 2802 2803 2804 2805 | * (EOL) * <dot> */ rde_param_i_state_push_void (p); notahead_113 (p); if (rde_param_i_seq_void2void(p)) return; | | | 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 | * (EOL) * <dot> */ rde_param_i_state_push_void (p); notahead_113 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_113 (RDE_PARAM p) { /* * ! |
︙ | ︙ | |||
2827 2828 2829 2830 2831 2832 2833 | static void sym_CONTROL (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ | | | | | | | | | | | 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 | static void sym_CONTROL (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 65)) return ; sequence_126 (p); rde_param_i_symbol_done_leaf (p, 65, 64); return; } static void sequence_126 (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<control>", 63); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'DAPOSTROPH' */ static void sym_DAPOSTROPH (RDE_PARAM p) { /* * '\"' */ if (rde_param_i_symbol_void_start (p, 68)) return ; rde_param_i_next_char (p, "\"", 66); rde_param_i_symbol_done_void (p, 68, 67); return; } /* * leaf Symbol 'DDIGIT' */ static void sym_DDIGIT (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 71)) return ; sequence_133 (p); rde_param_i_symbol_done_leaf (p, 71, 70); return; } static void sequence_133 (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ddigit>", 69); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
2910 2911 2912 2913 2914 2915 2916 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ | | | | 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ if (rde_param_i_symbol_start_d (p, 73)) return ; sequence_143 (p); rde_param_i_symbol_done_d_reduce (p, 73, 72); return; } static void sequence_143 (RDE_PARAM p) { /* * x * ? |
︙ | ︙ | |||
2964 2965 2966 2967 2968 2969 2970 | static void sym_DIGIT (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ | | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | < | | | | | | | | | | | | 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 | static void sym_DIGIT (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 76)) return ; sequence_148 (p); rde_param_i_symbol_done_leaf (p, 76, 75); return; } static void sequence_148 (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<digit>", 74); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'DOT' */ static void sym_DOT (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 79)) return ; sequence_153 (p); rde_param_i_symbol_done_leaf (p, 79, 78); return; } static void sequence_153 (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ".", 77); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'EOF' */ static void sym_EOF (RDE_PARAM p) { /* * ! * <dot> */ if (rde_param_i_symbol_void_start (p, 81)) return ; notahead_157 (p); rde_param_i_symbol_done_void (p, 81, 80); return; } static void notahead_157 (RDE_PARAM p) { /* * ! * <dot> */ rde_param_i_loc_push (p); rde_param_i_input_next (p, 43); rde_param_i_notahead_exit (p); return; } /* * void Symbol 'EOL' */ static void sym_EOL (RDE_PARAM p) { /* * [\n\r] */ if (rde_param_i_symbol_void_start (p, 84)) return ; rde_param_i_next_class (p, "\n\r", 82); rde_param_i_symbol_done_void (p, 84, 83); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ if (rde_param_i_symbol_start_d (p, 86)) return ; sequence_169 (p); rde_param_i_symbol_done_d_reduce (p, 86, 85); return; } static void sequence_169 (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ rde_param_i_state_push_value (p); sym_Sequence (p); if (rde_param_i_seq_value2value(p)) return; kleene_167 (p); rde_param_i_state_merge_value (p); return; } static void kleene_167 (RDE_PARAM p) { /* * * * x * (SLASH) * (Sequence) */ while (1) { rde_param_i_state_push_2 (p); sequence_165 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_165 (RDE_PARAM p) { /* * x * (SLASH) * (Sequence) */ rde_param_i_state_push_void (p); |
︙ | ︙ | |||
3169 3170 3171 3172 3173 3174 3175 | /* * void Symbol 'Final' */ static void sym_Final (RDE_PARAM p) { /* * x | | > | | | | | > > > | | 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 | /* * void Symbol 'Final' */ static void sym_Final (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 89)) return ; sequence_176 (p); rde_param_i_symbol_done_void (p, 89, 88); return; } static void sequence_176 (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "END", 87); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); if (rde_param_i_seq_void2void(p)) return; sym_SEMICOLON (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } |
︙ | ︙ | |||
3213 3214 3215 3216 3217 3218 3219 | * (Header) * * * (Definition) * (Final) * (EOF) */ | | | | | | | | 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 | * (Header) * * * (Definition) * (Final) * (EOF) */ if (rde_param_i_symbol_start_d (p, 91)) return ; sequence_186 (p); rde_param_i_symbol_done_d_reduce (p, 91, 90); return; } static void sequence_186 (RDE_PARAM p) { /* * x * (WHITESPACE) * (Header) * * * (Definition) * (Final) * (EOF) */ rde_param_i_state_push_void (p); sym_WHITESPACE (p); if (rde_param_i_seq_void2value(p)) return; sym_Header (p); if (rde_param_i_seq_value2value(p)) return; kleene_182 (p); if (rde_param_i_seq_value2value(p)) return; sym_Final (p); if (rde_param_i_seq_value2value(p)) return; sym_EOF (p); rde_param_i_state_merge_value (p); return; } static void kleene_182 (RDE_PARAM p) { /* * * * (Definition) */ while (1) { rde_param_i_state_push_2 (p); |
︙ | ︙ | |||
3269 3270 3271 3272 3273 3274 3275 | static void sym_GRAPH (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ | | | | | | | | | | | 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 | static void sym_GRAPH (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 94)) return ; sequence_191 (p); rde_param_i_symbol_done_leaf (p, 94, 93); return; } static void sequence_191 (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<graph>", 92); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Header' */ static void sym_Header (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ if (rde_param_i_symbol_start_d (p, 96)) return ; sequence_197 (p); rde_param_i_symbol_done_d_reduce (p, 96, 95); return; } static void sequence_197 (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ |
︙ | ︙ | |||
3342 3343 3344 3345 3346 3347 3348 | * <alpha> * * * / * [_:] * <alnum> */ | | | | | | | | | | | | | | | | | | | | 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 | * <alpha> * * * / * [_:] * <alnum> */ if (rde_param_i_symbol_start (p, 99)) return ; sequence_210 (p); rde_param_i_symbol_done_leaf (p, 99, 98); return; } static void sequence_210 (RDE_PARAM p) { /* * x * / * [_:] * <alpha> * * * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); choice_202 (p); if (rde_param_i_seq_void2void(p)) return; kleene_208 (p); rde_param_i_state_merge_void (p); return; } static void choice_202 (RDE_PARAM p) { /* * / * [_:] * <alpha> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alpha (p, 1); rde_param_i_state_merge_void (p); return; } static void kleene_208 (RDE_PARAM p) { /* * * * / * [_:] * <alnum> */ while (1) { rde_param_i_state_push_2 (p); choice_206 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_206 (RDE_PARAM p) { /* * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alnum (p, 0); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Identifier' */ static void sym_Identifier (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 101)) return ; sequence_215 (p); rde_param_i_symbol_done_d_reduce (p, 101, 100); return; } static void sequence_215 (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ rde_param_i_state_push_value (p); |
︙ | ︙ | |||
3457 3458 3459 3460 3461 3462 3463 | static void sym_IS (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ | | | | | | | | | | | | 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 | static void sym_IS (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 104)) return ; sequence_220 (p); rde_param_i_symbol_done_void (p, 104, 103); return; } static void sequence_220 (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<-", 102); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'LEAF' */ static void sym_LEAF (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 107)) return ; sequence_225 (p); rde_param_i_symbol_done_leaf (p, 107, 106); return; } static void sequence_225 (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "leaf", 105); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
3537 3538 3539 3540 3541 3542 3543 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ | | | | | | 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 109)) return ; choice_254 (p); rde_param_i_symbol_done_d_reduce (p, 109, 108); return; } static void choice_254 (RDE_PARAM p) { /* * / * x * (APOSTROPH) * * * x * ! |
︙ | ︙ | |||
3567 3568 3569 3570 3571 3572 3573 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (p); | | | | | | | | | | | | | | | | | | 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (p); sequence_239 (p); if (rde_param_i_bra_value2value(p)) return; sequence_252 (p); rde_param_i_state_merge_value (p); return; } static void sequence_239 (RDE_PARAM p) { /* * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_APOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_235 (p); if (rde_param_i_seq_value2value(p)) return; sym_APOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_235 (RDE_PARAM p) { /* * * * x * ! * (APOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_233 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_233 (RDE_PARAM p) { /* * x * ! * (APOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_230 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_230 (RDE_PARAM p) { /* * ! * (APOSTROPH) */ rde_param_i_loc_push (p); sym_APOSTROPH (p); rde_param_i_notahead_exit (p); return; } static void sequence_252 (RDE_PARAM p) { /* * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_DAPOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_248 (p); if (rde_param_i_seq_value2value(p)) return; sym_DAPOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_248 (RDE_PARAM p) { /* * * * x * ! * (DAPOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_246 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_246 (RDE_PARAM p) { /* * x * ! * (DAPOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_243 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_243 (RDE_PARAM p) { /* * ! * (DAPOSTROPH) */ rde_param_i_loc_push (p); sym_DAPOSTROPH (p); |
︙ | ︙ | |||
3725 3726 3727 3728 3729 3730 3731 | static void sym_LOWER (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | > > > > | | | | > > > > | > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 | static void sym_LOWER (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 112)) return ; sequence_259 (p); rde_param_i_symbol_done_leaf (p, 112, 111); return; } static void sequence_259 (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<lower>", 110); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'NOT' */ static void sym_NOT (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 115)) return ; sequence_264 (p); rde_param_i_symbol_done_leaf (p, 115, 114); return; } static void sequence_264 (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "!", 113); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPEN' */ static void sym_OPEN (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 118)) return ; sequence_269 (p); rde_param_i_symbol_done_void (p, 118, 117); return; } static void sequence_269 (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 116); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPENB' */ static void sym_OPENB (RDE_PARAM p) { /* * '[' */ if (rde_param_i_symbol_void_start (p, 121)) return ; rde_param_i_next_char (p, "[", 119); rde_param_i_symbol_done_void (p, 121, 120); return; } /* * void Symbol 'PEG' */ static void sym_PEG (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 124)) return ; sequence_281 (p); rde_param_i_symbol_done_void (p, 124, 123); return; } static void sequence_281 (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "PEG", 122); if (rde_param_i_seq_void2void(p)) return; notahead_278 (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } static void notahead_278 (RDE_PARAM p) { /* * ! * / * [_:] * <alnum> */ rde_param_i_loc_push (p); choice_206 (p); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'PLUS' */ static void sym_PLUS (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 127)) return ; sequence_286 (p); rde_param_i_symbol_done_leaf (p, 127, 126); return; } static void sequence_286 (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "+", 125); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Prefix' */ static void sym_Prefix (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ if (rde_param_i_symbol_start_d (p, 129)) return ; sequence_296 (p); rde_param_i_symbol_done_d_reduce (p, 129, 128); return; } static void sequence_296 (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ rde_param_i_state_push_value (p); optional_293 (p); if (rde_param_i_seq_value2value(p)) return; sym_Suffix (p); rde_param_i_state_merge_value (p); return; } static void optional_293 (RDE_PARAM p) { /* * ? * / * (AND) * (NOT) */ rde_param_i_state_push_2 (p); choice_291 (p); rde_param_i_state_merge_ok (p); return; } static void choice_291 (RDE_PARAM p) { /* * / * (AND) * (NOT) */ rde_param_i_state_push_value (p); |
︙ | ︙ | |||
3987 3988 3989 3990 3991 3992 3993 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ | | | | | | 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ if (rde_param_i_symbol_start_d (p, 131)) return ; choice_322 (p); rde_param_i_symbol_done_d_reduce (p, 131, 130); return; } static void choice_322 (RDE_PARAM p) { /* * / * (ALNUM) * (ALPHA) * (ASCII) * (CONTROL) * (DDIGIT) |
︙ | ︙ | |||
4051 4052 4053 4054 4055 4056 4057 | if (rde_param_i_bra_value2value(p)) return; sym_WORDCHAR (p); if (rde_param_i_bra_value2value(p)) return; sym_XDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_Identifier (p); if (rde_param_i_bra_value2value(p)) return; | | | | 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 | if (rde_param_i_bra_value2value(p)) return; sym_WORDCHAR (p); if (rde_param_i_bra_value2value(p)) return; sym_XDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_Identifier (p); if (rde_param_i_bra_value2value(p)) return; sequence_317 (p); if (rde_param_i_bra_value2value(p)) return; sym_Literal (p); if (rde_param_i_bra_value2value(p)) return; sym_Class (p); if (rde_param_i_bra_value2value(p)) return; sym_DOT (p); rde_param_i_state_merge_value (p); return; } static void sequence_317 (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ |
︙ | ︙ | |||
4091 4092 4093 4094 4095 4096 4097 | static void sym_PRINTABLE (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | static void sym_PRINTABLE (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 134)) return ; sequence_327 (p); rde_param_i_symbol_done_leaf (p, 134, 133); return; } static void sequence_327 (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<print>", 132); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'PUNCT' */ static void sym_PUNCT (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 137)) return ; sequence_332 (p); rde_param_i_symbol_done_leaf (p, 137, 136); return; } static void sequence_332 (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<punct>", 135); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'QUESTION' */ static void sym_QUESTION (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 140)) return ; sequence_337 (p); rde_param_i_symbol_done_leaf (p, 140, 139); return; } static void sequence_337 (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "?", 138); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Range' */ static void sym_Range (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ if (rde_param_i_symbol_start_d (p, 142)) return ; choice_346 (p); rde_param_i_symbol_done_d_reduce (p, 142, 141); return; } static void choice_346 (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ rde_param_i_state_push_value (p); sequence_343 (p); if (rde_param_i_bra_value2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void sequence_343 (RDE_PARAM p) { /* * x * (Char) * (TO) * (Char) */ |
︙ | ︙ | |||
4243 4244 4245 4246 4247 4248 4249 | static void sym_SEMICOLON (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ | | | | | | | | | | | 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 | static void sym_SEMICOLON (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 145)) return ; sequence_351 (p); rde_param_i_symbol_done_void (p, 145, 144); return; } static void sequence_351 (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ";", 143); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Sequence' */ static void sym_Sequence (RDE_PARAM p) { /* * + * (Prefix) */ if (rde_param_i_symbol_start_d (p, 147)) return ; poskleene_355 (p); rde_param_i_symbol_done_d_reduce (p, 147, 146); return; } static void poskleene_355 (RDE_PARAM p) { /* * + * (Prefix) */ rde_param_i_loc_push (p); sym_Prefix (p); |
︙ | ︙ | |||
4308 4309 4310 4311 4312 4313 4314 | static void sym_SLASH (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 | static void sym_SLASH (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 150)) return ; sequence_360 (p); rde_param_i_symbol_done_void (p, 150, 149); return; } static void sequence_360 (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "/", 148); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'SPACE' */ static void sym_SPACE (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 153)) return ; sequence_365 (p); rde_param_i_symbol_done_leaf (p, 153, 152); return; } static void sequence_365 (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<space>", 151); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'STAR' */ static void sym_STAR (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 156)) return ; sequence_370 (p); rde_param_i_symbol_done_leaf (p, 156, 155); return; } static void sequence_370 (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "*", 154); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'StartExpr' */ static void sym_StartExpr (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ if (rde_param_i_symbol_start_d (p, 158)) return ; sequence_317 (p); rde_param_i_symbol_done_d_reduce (p, 158, 157); return; } /* * value Symbol 'Suffix' */ static void sym_Suffix (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ if (rde_param_i_symbol_start_d (p, 160)) return ; sequence_386 (p); rde_param_i_symbol_done_d_reduce (p, 160, 159); return; } static void sequence_386 (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_value (p); sym_Primary (p); if (rde_param_i_seq_value2value(p)) return; optional_384 (p); rde_param_i_state_merge_value (p); return; } static void optional_384 (RDE_PARAM p) { /* * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_2 (p); choice_382 (p); rde_param_i_state_merge_ok (p); return; } static void choice_382 (RDE_PARAM p) { /* * / * (QUESTION) * (STAR) * (PLUS) */ |
︙ | ︙ | |||
4493 4494 4495 4496 4497 4498 4499 | */ static void sym_TO (RDE_PARAM p) { /* * '-' */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 | */ static void sym_TO (RDE_PARAM p) { /* * '-' */ if (rde_param_i_symbol_void_start (p, 163)) return ; rde_param_i_next_char (p, "-", 161); rde_param_i_symbol_done_void (p, 163, 162); return; } /* * leaf Symbol 'UPPER' */ static void sym_UPPER (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 166)) return ; sequence_393 (p); rde_param_i_symbol_done_leaf (p, 166, 165); return; } static void sequence_393 (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<upper>", 164); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'VOID' */ static void sym_VOID (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 169)) return ; sequence_398 (p); rde_param_i_symbol_done_leaf (p, 169, 168); return; } static void sequence_398 (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "void", 167); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'WHITESPACE' */ static void sym_WHITESPACE (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ if (rde_param_i_symbol_void_start (p, 171)) return ; kleene_405 (p); rde_param_i_symbol_done_void (p, 171, 170); return; } static void kleene_405 (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ while (1) { rde_param_i_state_push_2 (p); choice_403 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_403 (RDE_PARAM p) { /* * / * <space> * (COMMENT) */ rde_param_i_state_push_void (p); rde_param_i_next_space (p, 10); if (rde_param_i_bra_void2void(p)) return; sym_COMMENT (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'WORDCHAR' */ static void sym_WORDCHAR (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 174)) return ; sequence_410 (p); rde_param_i_symbol_done_leaf (p, 174, 173); return; } static void sequence_410 (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<wordchar>", 172); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'XDIGIT' */ static void sym_XDIGIT (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 177)) return ; sequence_415 (p); rde_param_i_symbol_done_leaf (p, 177, 176); return; } static void sequence_415 (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<xdigit>", 175); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } } |
︙ | ︙ | |||
4716 4717 4718 4719 4720 4721 4722 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "peg%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/pt_parse_peg_tcl.tcl.
︙ | ︙ | |||
361 362 363 364 365 366 367 | # # leaf Symbol 'CharSpecial' # proc sym_CharSpecial {} { upvar 1 myparser myparser # x # '\' | | | | 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | # # leaf Symbol 'CharSpecial' # proc sym_CharSpecial {} { upvar 1 myparser myparser # x # '\' # [nrt'\"[]\] $myparser si:void_symbol_start CharSpecial sequence_57 $myparser si:void_leaf_symbol_end CharSpecial return } proc sequence_57 {} { upvar 1 myparser myparser # x # '\' # [nrt'\"[]\] $myparser si:void_state_push $myparser si:next_char \134 $myparser si:voidvoid_part $myparser si:next_class nrt'\42\133\135\134 $myparser si:void_state_merge return |
︙ | ︙ | |||
946 947 948 949 950 951 952 | $myparser si:next_char . $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | > | | | | | | | > | | | > > > | | 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | $myparser si:next_char . $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } # # void Symbol 'EOF' # proc sym_EOF {} { upvar 1 myparser myparser # ! # <dot> $myparser si:void_void_symbol_start EOF notahead_157 $myparser si:void_clear_symbol_end EOF return } proc notahead_157 {} { upvar 1 myparser myparser # ! # <dot> $myparser i_loc_push $myparser i_input_next dot $myparser si:void_notahead_exit return } # # void Symbol 'EOL' # proc sym_EOL {} { upvar 1 myparser myparser # [\n\r] $myparser si:void_void_symbol_start EOL $myparser si:next_class \n\r $myparser si:void_clear_symbol_end EOL return } # # value Symbol 'Expression' # proc sym_Expression {} { upvar 1 myparser myparser # x # (Sequence) # * # x # (SLASH) # (Sequence) $myparser si:value_symbol_start Expression sequence_169 $myparser si:reduce_symbol_end Expression return } proc sequence_169 {} { upvar 1 myparser myparser # x # (Sequence) # * # x # (SLASH) # (Sequence) $myparser si:value_state_push sym_Sequence $myparser si:valuevalue_part kleene_167 $myparser si:value_state_merge return } proc kleene_167 {} { upvar 1 myparser myparser # * # x # (SLASH) # (Sequence) while {1} { $myparser si:void2_state_push sequence_165 $myparser si:kleene_close } return } proc sequence_165 {} { upvar 1 myparser myparser # x # (SLASH) # (Sequence) $myparser si:void_state_push sym_SLASH $myparser si:voidvalue_part sym_Sequence $myparser si:value_state_merge return } # # void Symbol 'Final' # proc sym_Final {} { upvar 1 myparser myparser # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) $myparser si:void_void_symbol_start Final sequence_176 $myparser si:void_clear_symbol_end Final return } proc sequence_176 {} { upvar 1 myparser myparser # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str END $myparser si:voidvoid_part sym_WHITESPACE $myparser si:voidvoid_part sym_SEMICOLON $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } |
︙ | ︙ | |||
1117 1118 1119 1120 1121 1122 1123 | # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:value_symbol_start Grammar | | | | | | 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 | # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:value_symbol_start Grammar sequence_186 $myparser si:reduce_symbol_end Grammar return } proc sequence_186 {} { upvar 1 myparser myparser # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:void_state_push sym_WHITESPACE $myparser si:voidvalue_part sym_Header $myparser si:valuevalue_part kleene_182 $myparser si:valuevalue_part sym_Final $myparser si:valuevalue_part sym_EOF $myparser si:value_state_merge return } proc kleene_182 {} { upvar 1 myparser myparser # * # (Definition) while {1} { $myparser si:void2_state_push sym_Definition $myparser si:kleene_close |
︙ | ︙ | |||
1167 1168 1169 1170 1171 1172 1173 | proc sym_GRAPH {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_symbol_start GRAPH | | | | 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | proc sym_GRAPH {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_symbol_start GRAPH sequence_191 $myparser si:void_leaf_symbol_end GRAPH return } proc sequence_191 {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <graph> $myparser si:voidvoid_part |
︙ | ︙ | |||
1196 1197 1198 1199 1200 1201 1202 | proc sym_Header {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:value_symbol_start Header | | | | 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | proc sym_Header {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:value_symbol_start Header sequence_197 $myparser si:reduce_symbol_end Header return } proc sequence_197 {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:void_state_push sym_PEG |
︙ | ︙ | |||
1232 1233 1234 1235 1236 1237 1238 | # <alpha> # * # / # [_:] # <alnum> $myparser si:void_symbol_start Ident | | | | | | | | | | 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | # <alpha> # * # / # [_:] # <alnum> $myparser si:void_symbol_start Ident sequence_210 $myparser si:void_leaf_symbol_end Ident return } proc sequence_210 {} { upvar 1 myparser myparser # x # / # [_:] # <alpha> # * # / # [_:] # <alnum> $myparser si:void_state_push choice_202 $myparser si:voidvoid_part kleene_208 $myparser si:void_state_merge return } proc choice_202 {} { upvar 1 myparser myparser # / # [_:] # <alpha> $myparser si:void_state_push $myparser si:next_class _: $myparser si:voidvoid_branch $myparser si:next_alpha $myparser si:void_state_merge return } proc kleene_208 {} { upvar 1 myparser myparser # * # / # [_:] # <alnum> while {1} { $myparser si:void2_state_push choice_206 $myparser si:kleene_close } return } proc choice_206 {} { upvar 1 myparser myparser # / # [_:] # <alnum> $myparser si:void_state_push $myparser si:next_class _: $myparser si:voidvoid_branch |
︙ | ︙ | |||
1305 1306 1307 1308 1309 1310 1311 | proc sym_Identifier {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_symbol_start Identifier | | | | 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 | proc sym_Identifier {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_symbol_start Identifier sequence_215 $myparser si:reduce_symbol_end Identifier return } proc sequence_215 {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_state_push sym_Ident $myparser si:valuevalue_part |
︙ | ︙ | |||
1333 1334 1335 1336 1337 1338 1339 | proc sym_IS {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_void_symbol_start IS | | | | 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 | proc sym_IS {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_void_symbol_start IS sequence_220 $myparser si:void_clear_symbol_end IS return } proc sequence_220 {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <- $myparser si:voidvoid_part |
︙ | ︙ | |||
1361 1362 1363 1364 1365 1366 1367 | proc sym_LEAF {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_symbol_start LEAF | | | | 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | proc sym_LEAF {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_symbol_start LEAF sequence_225 $myparser si:void_leaf_symbol_end LEAF return } proc sequence_225 {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str leaf $myparser si:voidvoid_part |
︙ | ︙ | |||
1405 1406 1407 1408 1409 1410 1411 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_symbol_start Literal | | | | 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_symbol_start Literal choice_254 $myparser si:reduce_symbol_end Literal return } proc choice_254 {} { upvar 1 myparser myparser # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
1432 1433 1434 1435 1436 1437 1438 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_state_push | | | | | | | | | | | | | | | | | | | | 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_state_push sequence_239 $myparser si:valuevalue_branch sequence_252 $myparser si:value_state_merge return } proc sequence_239 {} { upvar 1 myparser myparser # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) $myparser si:void_state_push sym_APOSTROPH $myparser si:voidvalue_part kleene_235 $myparser si:valuevalue_part sym_APOSTROPH $myparser si:valuevalue_part sym_WHITESPACE $myparser si:value_state_merge return } proc kleene_235 {} { upvar 1 myparser myparser # * # x # ! # (APOSTROPH) # (Char) while {1} { $myparser si:void2_state_push sequence_233 $myparser si:kleene_close } return } proc sequence_233 {} { upvar 1 myparser myparser # x # ! # (APOSTROPH) # (Char) $myparser si:void_state_push notahead_230 $myparser si:voidvalue_part sym_Char $myparser si:value_state_merge return } proc notahead_230 {} { upvar 1 myparser myparser # ! # (APOSTROPH) $myparser i_loc_push sym_APOSTROPH $myparser si:void_notahead_exit return } proc sequence_252 {} { upvar 1 myparser myparser # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:void_state_push sym_DAPOSTROPH $myparser si:voidvalue_part kleene_248 $myparser si:valuevalue_part sym_DAPOSTROPH $myparser si:valuevalue_part sym_WHITESPACE $myparser si:value_state_merge return } proc kleene_248 {} { upvar 1 myparser myparser # * # x # ! # (DAPOSTROPH) # (Char) while {1} { $myparser si:void2_state_push sequence_246 $myparser si:kleene_close } return } proc sequence_246 {} { upvar 1 myparser myparser # x # ! # (DAPOSTROPH) # (Char) $myparser si:void_state_push notahead_243 $myparser si:voidvalue_part sym_Char $myparser si:value_state_merge return } proc notahead_243 {} { upvar 1 myparser myparser # ! # (DAPOSTROPH) $myparser i_loc_push sym_DAPOSTROPH $myparser si:void_notahead_exit return } # # leaf Symbol 'LOWER' # proc sym_LOWER {} { upvar 1 myparser myparser # x # "<lower>" # (WHITESPACE) $myparser si:void_symbol_start LOWER sequence_259 $myparser si:void_leaf_symbol_end LOWER return } proc sequence_259 {} { upvar 1 myparser myparser # x # "<lower>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <lower> $myparser si:voidvoid_part |
︙ | ︙ | |||
1601 1602 1603 1604 1605 1606 1607 | proc sym_NOT {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_symbol_start NOT | | | | 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 | proc sym_NOT {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_symbol_start NOT sequence_264 $myparser si:void_leaf_symbol_end NOT return } proc sequence_264 {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char ! $myparser si:voidvoid_part |
︙ | ︙ | |||
1629 1630 1631 1632 1633 1634 1635 | proc sym_OPEN {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_void_symbol_start OPEN | | | | 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 | proc sym_OPEN {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_void_symbol_start OPEN sequence_269 $myparser si:void_clear_symbol_end OPEN return } proc sequence_269 {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char \50 $myparser si:voidvoid_part |
︙ | ︙ | |||
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 | # # void Symbol 'PEG' # proc sym_PEG {} { upvar 1 myparser myparser # x # "PEG" # (WHITESPACE) $myparser si:void_void_symbol_start PEG | > > > > | | > > > > > > > > > > > > > > > > > > | | | 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 | # # void Symbol 'PEG' # proc sym_PEG {} { upvar 1 myparser myparser # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) $myparser si:void_void_symbol_start PEG sequence_281 $myparser si:void_clear_symbol_end PEG return } proc sequence_281 {} { upvar 1 myparser myparser # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str PEG $myparser si:voidvoid_part notahead_278 $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } proc notahead_278 {} { upvar 1 myparser myparser # ! # / # [_:] # <alnum> $myparser i_loc_push choice_206 $myparser si:void_notahead_exit return } # # leaf Symbol 'PLUS' # proc sym_PLUS {} { upvar 1 myparser myparser # x # '+' # (WHITESPACE) $myparser si:void_symbol_start PLUS sequence_286 $myparser si:void_leaf_symbol_end PLUS return } proc sequence_286 {} { upvar 1 myparser myparser # x # '+' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char + $myparser si:voidvoid_part |
︙ | ︙ | |||
1729 1730 1731 1732 1733 1734 1735 | # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_symbol_start Prefix | | | | | | | | 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 | # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_symbol_start Prefix sequence_296 $myparser si:reduce_symbol_end Prefix return } proc sequence_296 {} { upvar 1 myparser myparser # x # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_state_push optional_293 $myparser si:valuevalue_part sym_Suffix $myparser si:value_state_merge return } proc optional_293 {} { upvar 1 myparser myparser # ? # / # (AND) # (NOT) $myparser si:void2_state_push choice_291 $myparser si:void_state_merge_ok return } proc choice_291 {} { upvar 1 myparser myparser # / # (AND) # (NOT) $myparser si:value_state_push sym_AND $myparser si:valuevalue_branch |
︙ | ︙ | |||
1805 1806 1807 1808 1809 1810 1811 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) $myparser si:value_symbol_start Primary | | | | 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) $myparser si:value_symbol_start Primary choice_322 $myparser si:reduce_symbol_end Primary return } proc choice_322 {} { upvar 1 myparser myparser # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
1866 1867 1868 1869 1870 1871 1872 | $myparser si:valuevalue_branch sym_WORDCHAR $myparser si:valuevalue_branch sym_XDIGIT $myparser si:valuevalue_branch sym_Identifier $myparser si:valuevalue_branch | | | | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 | $myparser si:valuevalue_branch sym_WORDCHAR $myparser si:valuevalue_branch sym_XDIGIT $myparser si:valuevalue_branch sym_Identifier $myparser si:valuevalue_branch sequence_317 $myparser si:valuevalue_branch sym_Literal $myparser si:valuevalue_branch sym_Class $myparser si:valuevalue_branch sym_DOT $myparser si:value_state_merge return } proc sequence_317 {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:void_state_push sym_OPEN |
︙ | ︙ | |||
1903 1904 1905 1906 1907 1908 1909 | proc sym_PRINTABLE {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_symbol_start PRINTABLE | | | | 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 | proc sym_PRINTABLE {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_symbol_start PRINTABLE sequence_327 $myparser si:void_leaf_symbol_end PRINTABLE return } proc sequence_327 {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <print> $myparser si:voidvoid_part |
︙ | ︙ | |||
1931 1932 1933 1934 1935 1936 1937 | proc sym_PUNCT {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_symbol_start PUNCT | | | | 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 | proc sym_PUNCT {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_symbol_start PUNCT sequence_332 $myparser si:void_leaf_symbol_end PUNCT return } proc sequence_332 {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <punct> $myparser si:voidvoid_part |
︙ | ︙ | |||
1959 1960 1961 1962 1963 1964 1965 | proc sym_QUESTION {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_symbol_start QUESTION | | | | 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 | proc sym_QUESTION {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_symbol_start QUESTION sequence_337 $myparser si:void_leaf_symbol_end QUESTION return } proc sequence_337 {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char ? $myparser si:voidvoid_part |
︙ | ︙ | |||
1990 1991 1992 1993 1994 1995 1996 | # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_symbol_start Range | | | | | | 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_symbol_start Range choice_346 $myparser si:reduce_symbol_end Range return } proc choice_346 {} { upvar 1 myparser myparser # / # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_state_push sequence_343 $myparser si:valuevalue_branch sym_Char $myparser si:value_state_merge return } proc sequence_343 {} { upvar 1 myparser myparser # x # (Char) # (TO) # (Char) $myparser si:value_state_push sym_Char |
︙ | ︙ | |||
2037 2038 2039 2040 2041 2042 2043 | proc sym_SEMICOLON {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_void_symbol_start SEMICOLON | | | | 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 | proc sym_SEMICOLON {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_void_symbol_start SEMICOLON sequence_351 $myparser si:void_clear_symbol_end SEMICOLON return } proc sequence_351 {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char \73 $myparser si:voidvoid_part |
︙ | ︙ | |||
2064 2065 2066 2067 2068 2069 2070 | # proc sym_Sequence {} { upvar 1 myparser myparser # + # (Prefix) $myparser si:value_symbol_start Sequence | | | | 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 | # proc sym_Sequence {} { upvar 1 myparser myparser # + # (Prefix) $myparser si:value_symbol_start Sequence poskleene_355 $myparser si:reduce_symbol_end Sequence return } proc poskleene_355 {} { upvar 1 myparser myparser # + # (Prefix) $myparser i_loc_push sym_Prefix $myparser si:kleene_abort while {1} { |
︙ | ︙ | |||
2094 2095 2096 2097 2098 2099 2100 | proc sym_SLASH {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_void_symbol_start SLASH | | | | 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 | proc sym_SLASH {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_void_symbol_start SLASH sequence_360 $myparser si:void_clear_symbol_end SLASH return } proc sequence_360 {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char / $myparser si:voidvoid_part |
︙ | ︙ | |||
2122 2123 2124 2125 2126 2127 2128 | proc sym_SPACE {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_symbol_start SPACE | | | | 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 | proc sym_SPACE {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_symbol_start SPACE sequence_365 $myparser si:void_leaf_symbol_end SPACE return } proc sequence_365 {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <space> $myparser si:voidvoid_part |
︙ | ︙ | |||
2150 2151 2152 2153 2154 2155 2156 | proc sym_STAR {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_symbol_start STAR | | | | 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 | proc sym_STAR {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_symbol_start STAR sequence_370 $myparser si:void_leaf_symbol_end STAR return } proc sequence_370 {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char * $myparser si:voidvoid_part |
︙ | ︙ | |||
2179 2180 2181 2182 2183 2184 2185 | proc sym_StartExpr {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:value_symbol_start StartExpr | | | | | | | | | 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 | proc sym_StartExpr {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:value_symbol_start StartExpr sequence_317 $myparser si:reduce_symbol_end StartExpr return } # # value Symbol 'Suffix' # proc sym_Suffix {} { upvar 1 myparser myparser # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_symbol_start Suffix sequence_386 $myparser si:reduce_symbol_end Suffix return } proc sequence_386 {} { upvar 1 myparser myparser # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_state_push sym_Primary $myparser si:valuevalue_part optional_384 $myparser si:value_state_merge return } proc optional_384 {} { upvar 1 myparser myparser # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:void2_state_push choice_382 $myparser si:void_state_merge_ok return } proc choice_382 {} { upvar 1 myparser myparser # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_state_push sym_QUESTION |
︙ | ︙ | |||
2272 2273 2274 2275 2276 2277 2278 | proc sym_UPPER {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_symbol_start UPPER | | | | 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 | proc sym_UPPER {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_symbol_start UPPER sequence_393 $myparser si:void_leaf_symbol_end UPPER return } proc sequence_393 {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <upper> $myparser si:voidvoid_part |
︙ | ︙ | |||
2300 2301 2302 2303 2304 2305 2306 | proc sym_VOID {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_symbol_start VOID | | | | 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 | proc sym_VOID {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_symbol_start VOID sequence_398 $myparser si:void_leaf_symbol_end VOID return } proc sequence_398 {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str void $myparser si:voidvoid_part |
︙ | ︙ | |||
2329 2330 2331 2332 2333 2334 2335 | proc sym_WHITESPACE {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) $myparser si:void_void_symbol_start WHITESPACE | | | | | | 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 | proc sym_WHITESPACE {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) $myparser si:void_void_symbol_start WHITESPACE kleene_405 $myparser si:void_clear_symbol_end WHITESPACE return } proc kleene_405 {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) while {1} { $myparser si:void2_state_push choice_403 $myparser si:kleene_close } return } proc choice_403 {} { upvar 1 myparser myparser # / # <space> # (COMMENT) $myparser si:void_state_push $myparser si:next_space $myparser si:voidvoid_branch |
︙ | ︙ | |||
2371 2372 2373 2374 2375 2376 2377 | proc sym_WORDCHAR {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_symbol_start WORDCHAR | | | | 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 | proc sym_WORDCHAR {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_symbol_start WORDCHAR sequence_410 $myparser si:void_leaf_symbol_end WORDCHAR return } proc sequence_410 {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <wordchar> $myparser si:voidvoid_part |
︙ | ︙ | |||
2399 2400 2401 2402 2403 2404 2405 | proc sym_XDIGIT {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_symbol_start XDIGIT | | | | | 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 | proc sym_XDIGIT {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_symbol_start XDIGIT sequence_415 $myparser si:void_leaf_symbol_end XDIGIT return } proc sequence_415 {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <xdigit> $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::parse::peg_tcl 1.0.1 return |
Changes to modules/pt/pt_peg_from_peg.man.
1 2 3 4 5 | [comment {--- doctools ---}] [vset PACKAGE peg] [vset NAME PEG] [vset REQUIRE peg] [vset CONFIG peg] | | | 1 2 3 4 5 6 7 | [comment {--- doctools ---}] [vset PACKAGE peg] [vset NAME PEG] [vset REQUIRE peg] [vset CONFIG peg] [vset VERSION 1.0.3] [include include/import/from.inc] |
Changes to modules/pt/pt_peg_from_peg.tcl.
1 2 3 4 | # pt_peg_from_peg.tcl -- # # Conversion from PEG (Human readable text) to PEG. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # pt_peg_from_peg.tcl -- # # Conversion from PEG (Human readable text) to PEG. # # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: pt_peg_from_peg.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # This package takes text for a human-readable PEG and produces the |
︙ | ︙ | |||
193 194 195 196 197 198 199 | return [lindex $args 0] } else { return [pt::pe choice {*}$args] ; # <- Chars and Ranges } } proc pt::peg::from::peg::GEN::CONTROL {s e} { | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | return [lindex $args 0] } else { return [pt::pe choice {*}$args] ; # <- Chars and Ranges } } proc pt::peg::from::peg::GEN::CONTROL {s e} { return [pt::pe control] } proc pt::peg::from::peg::GEN::DDIGIT {s e} { return [pt::pe ddigit] } proc pt::peg::from::peg::GEN::Definition {s e args} { |
︙ | ︙ | |||
386 387 388 389 390 391 392 | proc pt::peg::from::peg::GEN::XDIGIT {s e} { return [pt::pe xdigit] } # ### ### ### ######### ######### ######### ## Ready | | | 386 387 388 389 390 391 392 393 394 | proc pt::peg::from::peg::GEN::XDIGIT {s e} { return [pt::pe xdigit] } # ### ### ### ######### ######### ######### ## Ready package provide pt::peg::from::peg 1.0.3 return |
Changes to modules/pt/pt_peg_interp.man.
1 | [comment {-*- tcl -*- doctools manpage}] | | | 1 2 3 4 5 6 7 8 9 | [comment {-*- tcl -*- doctools manpage}] [vset PACKAGE_VERSION 1.0.1] [manpage_begin pt::peg::interp n [vset PACKAGE_VERSION]] [include include/module.inc] [titledesc {Interpreter for parsing expression grammars}] [require pt::peg::interp [opt [vset PACKAGE_VERSION]]] [require pt::rde [opt 1]] [require snit] [description] |
︙ | ︙ |
Changes to modules/pt/pt_peg_interp.tcl.
1 2 | # -*- tcl -*- # | | | 1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # Interpreter for parsing expression grammars. In essence a recursive # descent parser configurable with a parsing expression grammar. # ### ### ### ######### ######### ######### ## Package description |
︙ | ︙ | |||
112 113 114 115 116 117 118 | } # Parse and consume one specific character. This fails if the # character at the location is not in the specified character # class. Does not consume input on failure. foreach operator { | | | < | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | } # Parse and consume one specific character. This fails if the # character at the location is not in the specified character # class. Does not consume input on failure. foreach operator { alnum alpha ascii control ddigit digit graph lower print punct space upper wordchar xdigit } { method $operator {} [string map [list @ $operator] { $self Next $myparser i:fail_return $myparser i_test_@ return }] |
︙ | ︙ | |||
379 380 381 382 383 384 385 | ## # ### ### ### ######### ######### ######### } # ### ### ### ######### ######### ######### ## Package Management | | | 378 379 380 381 382 383 384 385 | ## # ### ### ### ######### ######### ######### } # ### ### ### ######### ######### ######### ## Package Management package provide pt::peg::interp 1.0.1 |
Changes to modules/pt/pt_peg_to_cparam.man.
1 2 3 4 5 | [comment {--- doctools ---}] [vset PACKAGE cparam] [vset NAME CPARAM] [vset REQUIRE cparam] [vset CONFIG cparam] | | | 1 2 3 4 5 6 7 | [comment {--- doctools ---}] [vset PACKAGE cparam] [vset NAME CPARAM] [vset REQUIRE cparam] [vset CONFIG cparam] [vset VERSION 1.1.2] [include include/export/to.inc] |
Changes to modules/pt/pt_peg_to_cparam.tcl.
1 2 3 4 | # peg_to_param.tcl -- # # Conversion of PEG to C PARAM, customizable text blocks. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # peg_to_param.tcl -- # # Conversion of PEG to C PARAM, customizable text blocks. # # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: pt_peg_to_cparam.tcl,v 1.2 2010/04/07 19:40:54 andreas_kupries Exp $ # This package takes the canonical serialization of a parsing |
︙ | ︙ | |||
37 38 39 40 41 42 43 | namespace ensemble create } # ### ### ### ######### ######### ######### ## API. proc ::pt::peg::to::cparam::reset {} { | > | | | | | | | | | | | | | | > > > | > | > | 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 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 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 130 131 132 133 134 135 136 137 138 139 | namespace ensemble create } # ### ### ### ######### ######### ######### ## API. proc ::pt::peg::to::cparam::reset {} { variable insertcmd {} ; # -insert-command (hook) variable template @code@ ; # -template variable name a_pe_grammar ; # -name variable file unknown ; # -file variable user unknown ; # -user variable self {} ; # -self-command variable ns {} ; # -namespace variable def static ; # -fun-qualifier variable main __main ; # -main variable indent 0 ; # -indent variable comments 1 ; # -comments variable prelude {} ; # -prelude variable statedecl {RDE_PARAM p} ; # -state-decl variable stateref {p} ; # -state-ref variable strings p_string ; # -string-varname return } proc ::pt::peg::to::cparam::configure {args} { variable template variable name variable file variable user variable self variable ns variable def variable main variable omap variable indent variable insertcmd variable comments variable prelude variable statedecl variable stateref variable strings if {[llength $args] == 0} { return [list \ -comments $comments \ -file $file \ -fun-qualifier $def \ -indent $indent \ -insert-command $insertcmd \ -main $main \ -name $name \ -namespace $ns \ -self-command $self \ -state-decl $statedecl \ -state-ref $stateref \ -string-varname $strings \ -template $template \ -user $user \ ] } elseif {[llength $args] == 1} { lassign $args option set variable [string range $option 1 end] if {[info exists omap($variable)]} { return [set $omap($variable)] } else { # TODO: compute this string dynamically. return -code error "Expected one of -comments, -file, -fun-qualifier, -indent, -insert-cmd, -main, -name, -namespace, -self-command, -state-decl, -state-ref, -string-varname, -template, or -user, got \"$option\"" } } elseif {[llength $args] % 2 == 0} { foreach {option value} $args { set variable [string range $option 1 end] if {![info exists omap($variable)]} { # TODO: compute this string dynamically. return -code error "Expected one of -comments, -file, -fun-qualifier, -indent, -insert-cmd, -main, -name, -namespace, -self-command, -state-decl, -state-ref, -string-varname, -template, or -user, got \"$option\"" } } foreach {option value} $args { set variable $omap([string range $option 1 end]) switch -exact -- $variable { template { if {$value eq {}} { return -code error "Expected template, got the empty string" } } indent { if {![string is integer -strict $value] || ($value < 0)} { return -code error "Expected int > 0, got \"$value\"" } } comments { if {![string is boolean -strict $value]} { return -code error "Expected boolean, got \"$value\"" } } insert-cmd - statedecl - stateref - strings - self - def - ns - main - |
︙ | ︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | variable file variable user variable self variable ns variable def variable main variable indent variable prelude variable statedecl variable stateref variable strings Op::Asm::Setup | > | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | variable file variable user variable self variable ns variable def variable main variable indent variable insertcmd variable prelude variable statedecl variable stateref variable strings Op::Asm::Setup |
︙ | ︙ | |||
170 171 172 173 174 175 176 177 178 179 180 181 182 183 | set modes {} foreach {symbol symdef} $peg(rules) { lassign $symdef _ is _ mode lappend modes $symbol $mode } text::write reset Op::Asm::Header {Declaring the parse functions} text::write /line text::write store FORWARD text::write clear set blocks {} | > > > > > > > > > > > > > > > > > > > > > > | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | set modes {} foreach {symbol symdef} $peg(rules) { lassign $symdef _ is _ mode lappend modes $symbol $mode } text::write reset # Fixed elements of the string table as needed by the lower level # PARAM functions (class tests, see param.c, enum test_class). # ** Keep in sync ** # # Maybe move the interning into the lower level, i.e. PARAM ? Op::Asm::String alnum Op::Asm::String alpha Op::Asm::String ascii Op::Asm::String control Op::Asm::String ddigit Op::Asm::String digit Op::Asm::String graph Op::Asm::String lower Op::Asm::String print Op::Asm::String punct Op::Asm::String space Op::Asm::String upper Op::Asm::String wordchar Op::Asm::String xdigit Op::Asm::Header {Declaring the parse functions} text::write /line text::write store FORWARD text::write clear set blocks {} |
︙ | ︙ | |||
238 239 240 241 242 243 244 | if {$indent} { set code [Indent $code $indent] } set xprelude $prelude ; if {$xprelude ne {}} { set xprelude " $xprelude" } set xself $self ; if {$xself ne {}} { append xself { } } | > > | > | > > | | | | | | > | > > | | | | | | | | > < | | > | | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | if {$indent} { set code [Indent $code $indent] } set xprelude $prelude ; if {$xprelude ne {}} { set xprelude " $xprelude" } set xself $self ; if {$xself ne {}} { append xself { } } # I. run code through the insertcmd hook (if specified) to prepare it for embedding if {[llength $insertcmd]} { set code [{*}$insertcmd $code] } # II. Phase 1 merge of code into the template. # (Placeholders only in the template) lappend map @user@ $user lappend map @format@ C/PARAM lappend map @file@ $file lappend map @name@ $name lappend map @code@ $code set code [string map $map $template] unset map # III. Phase 2 merge of code into the template. # (Placeholders in generated code, and template). lappend map @statedecl@ $statedecl lappend map @stateref@ $stateref lappend map @strings@ $strings lappend map { @prelude@} $xprelude lappend map {@self@ } $xself lappend map @def@ $def lappend map @ns@ $ns lappend map @main@ $main set code [string map $map $code] return $code # ### ### ### ######### ######### ######### } # ### ### ### ######### ######### ######### ## Internals proc ::pt::peg::to::cparam::Indent {text n} { set b [string repeat { } $n] return $b[join [split $text \n] \n$b] } proc ::pt::peg::to::cparam::Expression {expression modes} { return [pt::pe bottomup \ [list [namespace current]::Op $modes] \ $expression] } proc ::pt::peg::to::cparam::Symbol {symbol mode rhs modes} { set expression [Expression $rhs $modes] text::write clear Op::Asm::Header "$mode Symbol '$symbol'" text::write store FUN_HEADER Op::Asm::Start Op::Asm::ReExpression $symbol Op::Asm::GenAST $expression Op::Asm::PE $rhs set gen [dict get $result gen] Op::Asm::Function sym_$symbol { # Message is Tcl list. Quote for C embedding. set msg [Op::Asm::String [char quote cstring [list n $symbol]]] # Quote for C embedding. set symbol [Op::Asm::String [char quote cstring $symbol]] # We have six possibilites for the combination of AST node # generation by the rhs and AST generation by the symbol. Two # of these (leaf/0, value/0 coincide, leaving 5). This # controls the use of AS/ARS instructions. switch -exact -- $mode/$gen { |
︙ | ︙ | |||
482 483 484 485 486 487 488 | } } $expression Op::Asm::Done } namespace eval ::pt::peg::to::cparam::Op { namespace export \ | | | 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | } } $expression Op::Asm::Done } namespace eval ::pt::peg::to::cparam::Op { namespace export \ alpha alnum ascii control digit graph lower print \ punct space upper wordchar xdigit ddigit \ dot epsilon t .. n ? * + & ! x / } proc ::pt::peg::to::cparam::Op {modes pe op arguments} { return [namespace eval Op [list $op $modes {*}$arguments]] } |
︙ | ︙ | |||
510 511 512 513 514 515 516 | Asm::Direct { Asm::Ins input_next [Asm::String dot] } Asm::Done } foreach test { | | | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | Asm::Direct { Asm::Ins input_next [Asm::String dot] } Asm::Done } foreach test { alpha alnum ascii control digit graph lower print punct space upper wordchar xdigit ddigit } { proc ::pt::peg::to::cparam::Op::$test {modes} \ [string map [list @OP@ $test] { Asm::Start Asm::ReExpression @OP@ Asm::Direct { |
︙ | ︙ | |||
532 533 534 535 536 537 538 | }] } proc ::pt::peg::to::cparam::Op::t {modes char} { Asm::Start Asm::ReTerminal t $char Asm::Direct { | | | > > | | | | | > > | > | | | | | | > | > > | | > | > > | | 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 | }] } proc ::pt::peg::to::cparam::Op::t {modes char} { Asm::Start Asm::ReTerminal t $char Asm::Direct { # Message is Tcl list. Quote for C embedding. set msg [Asm::String [char quote cstring [list t $char]]] # Quote for C embedding. set char [char quote cstring $char] #Asm::Ins input_next $msg #Asm::CStmt if (!rde_param_query_st(@stateref@)) return #Asm::Ins test_char \"$char\" $msg Asm::Ins next_char \"$char\" $msg } Asm::Done } proc ::pt::peg::to::cparam::Op::.. {modes chs che} { Asm::Start Asm::ReTerminal .. $chs $che Asm::Direct { # Message is Tcl list. Quote for C embedding. set msg [Asm::String [char quote cstring [list .. $chs $che]]] # Quote for C embedding set chs [char quote cstring $chs] set che [char quote cstring $che] #Asm::Ins input_next $msg #Asm::CStmt if (!rde_param_query_st(@stateref@)) return #Asm::Ins test_range \"$chs\" \"$che\" $msg Asm::Ins next_range \"$chs\" \"$che\" $msg } Asm::Done } proc ::pt::peg::to::cparam::Op::str {modes args} { Asm::Start Asm::ReTerminal str {*}$args Asm::Direct { set str [join $args {}] # Message is Tcl list. Quote for C embedding. set msg [Asm::String [char quote cstring [list str $str]]] # Quote for C embedding set str [char quote cstring $str] # Without fusing this would be rendered as a sequence of # characters, with associated stack churn for each # character/part (See Op::x, void/all). Asm::Ins next_str \"$str\" $msg } Asm::Done } proc ::pt::peg::to::cparam::Op::cl {modes args} { # rorc = Range-OR-Char-List Asm::Start Asm::ReTerminal cl {*}$args Asm::Direct { # Without fusing this would be rendered as a choice of # characters, with associated stack churn for each # character/branch (See Op::/, void/all). set cl [join [Ranges {*}$args] {}] # Message is Tcl list. Quote for C embedding. set msg [Asm::String [char quote cstring [list cl $cl]]] # Quote for C embedding set cl [char quote cstring $cl] Asm::Ins next_class \"$cl\" $msg } Asm::Done } proc ::pt::peg::to::cparam::Op::Ranges {args} { set res {} foreach rorc $args { lappend res [Range $rorc] } |
︙ | ︙ | |||
622 623 624 625 626 627 628 | set res {} for {set i $s} {$i <= $e} {incr i} { append res [format %c $i] } return $res } else { | | | 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | set res {} for {set i $s} {$i <= $e} {incr i} { append res [format %c $i] } return $res } else { return $rorc ;#[char quote tcl $rorc] } } proc ::pt::peg::to::cparam::Op::n {modes symbol} { # symbol mode determines AST generation # void => non-generative, # leaf/value => generative. |
︙ | ︙ | |||
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 | # Map from option name (without leading dash) to the name of the # variable used to store setting. variable omap ; array set omap { comments comments file file fun-qualifier def indent indent main main name name namespace ns prelude prelude self-command self state-decl statedecl state-ref stateref string-varname strings template template user user } variable self {} variable ns {} variable def static variable main __main variable indent 0 variable prelude {} variable statedecl {RDE_PARAM p} variable stateref p variable strings p_string | > > > | > | | | | 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 | # Map from option name (without leading dash) to the name of the # variable used to store setting. variable omap ; array set omap { comments comments file file fun-qualifier def indent indent insert-cmd insertcmd main main name name namespace ns prelude prelude self-command self state-decl statedecl state-ref stateref string-varname strings template template user user } variable insertcmd {} variable comments 1 variable self {} variable ns {} variable def static variable main __main variable indent 0 variable prelude {} variable statedecl {RDE_PARAM p} variable stateref p variable strings p_string variable template @code@ ; # A string. Together with the # insertcmd (if any) it specifies # how to embed the generated code # into a larger framework (the # template). variable name a_pe_grammar ; # String. Name of the grammar. variable file unknown ; # String. Name of the file or # other entity the grammar came # from. variable user unknown ; # String. Name of the user on # which behalf the conversion has # been invoked. } # ### ### ### ######### ######### ######### ## Ready package provide pt::peg::to::cparam 1.1.3 return |
Changes to modules/pt/pt_peg_to_param.tcl.
1 2 3 4 | # peg_to_param.tcl -- # # Conversion of PEG to PARAM assembler. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # peg_to_param.tcl -- # # Conversion of PEG to PARAM assembler. # # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: pt_peg_to_param.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # This package takes the canonical serialization of a parsing |
︙ | ︙ | |||
368 369 370 371 372 373 374 | proc ::pt::peg::to::param::Op::t {modes char} { variable ::pt::peg::to::param::inline Asm::Start Asm::ReTerminal t $char if {$inline} { Asm::Direct { | | | | | | | | 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | proc ::pt::peg::to::param::Op::t {modes char} { variable ::pt::peg::to::param::inline Asm::Start Asm::ReTerminal t $char if {$inline} { Asm::Direct { set c [char quote string $char] Asm::Ins input_next "\"t $c\"" Asm::Ins ok! test_char \"$c\" } } else { Asm::Function [Asm::NewBlock char ] { set c [char quote string $char] Asm::Ins input_next "\"t $c\"" Asm::Ins ok! test_char \"$c\" } } Asm::Done } proc ::pt::peg::to::param::Op::.. {modes chstart chend} { variable ::pt::peg::to::param::inline Asm::Start Asm::ReTerminal .. $chstart $chend if {$inline} { Asm::Direct { set s [char quote string $chstart] set e [char quote string $chend] Asm::Ins input_next "\".. $s $e\"" Asm::Ins ok! test_range \"$s\" \"$e\" } } else { Asm::Function [Asm::NewBlock range] { set s [char quote string $chstart] set e [char quote string $chend] Asm::Ins input_next "\".. $s $e\"" Asm::Ins ok! test_range \"$s\" \"$e\" } } Asm::Done } |
︙ | ︙ | |||
1021 1022 1023 1024 1025 1026 1027 | # which behalf the conversion has # been invoked. } # ### ### ### ######### ######### ######### ## Ready | | | 1021 1022 1023 1024 1025 1026 1027 1028 1029 | # which behalf the conversion has # been invoked. } # ### ### ### ######### ######### ######### ## Ready package provide pt::peg::to::param 1.0.1 return |
Changes to modules/pt/pt_peg_to_peg.man.
1 2 3 4 5 | [comment {--- doctools ---}] [vset PACKAGE peg] [vset NAME PEG] [vset REQUIRE peg] [vset CONFIG peg] | | | 1 2 3 4 5 6 7 | [comment {--- doctools ---}] [vset PACKAGE peg] [vset NAME PEG] [vset REQUIRE peg] [vset CONFIG peg] [vset VERSION 1.0.2] [include include/export/to.inc] |
Changes to modules/pt/pt_peg_to_peg.tcl.
1 2 3 4 | # peg_to_peg.tcl -- # # Conversion from PEG to PEG (Human readable text). # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # peg_to_peg.tcl -- # # Conversion from PEG to PEG (Human readable text). # # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: pt_peg_to_peg.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # This package takes the canonical serialization of a parsing |
︙ | ︙ | |||
203 204 205 206 207 208 209 | proc ::pt::peg::to::peg::Convert {pe operator arguments} { # For the inner nodes the each of arguments are a pair of # generated text, and the sub-expression it came from, in this # order. switch -exact -- $operator { | | | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | proc ::pt::peg::to::peg::Convert {pe operator arguments} { # For the inner nodes the each of arguments are a pair of # generated text, and the sub-expression it came from, in this # order. switch -exact -- $operator { alpha - alnum - ascii - control - digit - graph - lower - print - punct - space - upper - wordchar - xdigit - ddigit { # Special forms ... return [list <$operator> $pe] } dot { # Special form ... return [list "." $pe] |
︙ | ︙ | |||
398 399 400 401 402 403 404 | array set priority { / 0 t 4 ascii 4 upper 4 x 1 n 4 digit 4 wordchar 4 & 2 .. 4 graph 4 xdigit 4 ! 2 dot 4 lower 4 ddigit 4 + 3 epsilon 4 print 4 str 4 * 3 alnum 4 punct 4 cl 4 | | | | 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | array set priority { / 0 t 4 ascii 4 upper 4 x 1 n 4 digit 4 wordchar 4 & 2 .. 4 graph 4 xdigit 4 ! 2 dot 4 lower 4 ddigit 4 + 3 epsilon 4 print 4 str 4 * 3 alnum 4 punct 4 cl 4 ? 3 alpha 4 space 4 control 4 } } # ### ### ### ######### ######### ######### ## Ready package provide pt::peg::to::peg 1.0.2 return |
Changes to modules/pt/pt_peg_to_tclparam.man.
1 2 3 4 5 | [comment {--- doctools ---}] [vset PACKAGE tclparam] [vset NAME TCLPARAM] [vset REQUIRE tclparam] [vset CONFIG tclparam] | | | 1 2 3 4 5 6 7 | [comment {--- doctools ---}] [vset PACKAGE tclparam] [vset NAME TCLPARAM] [vset REQUIRE tclparam] [vset CONFIG tclparam] [vset VERSION 1.0.1] [include include/export/to.inc] |
Changes to modules/pt/pt_peg_to_tclparam.tcl.
1 2 3 4 | # peg_to_param.tcl -- # # Conversion of PEG to Tcl/C PARAM, customizable text blocks. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # peg_to_param.tcl -- # # Conversion of PEG to Tcl/C PARAM, customizable text blocks. # # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: pt_peg_to_tclparam.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # This package takes the canonical serialization of a parsing |
︙ | ︙ | |||
371 372 373 374 375 376 377 | } } $expression Op::Asm::Done } namespace eval ::pt::peg::to::tclparam::Op { namespace export \ | | | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | } } $expression Op::Asm::Done } namespace eval ::pt::peg::to::tclparam::Op { namespace export \ alpha alnum ascii control digit graph lower print \ punct space upper wordchar xdigit ddigit \ dot epsilon t .. n ? * + & ! x / str cl } proc ::pt::peg::to::tclparam::Op {modes pe op arguments} { return [namespace eval Op [list $op $modes {*}$arguments]] } |
︙ | ︙ | |||
399 400 401 402 403 404 405 | Asm::Direct { Asm::Ins i_input_next dot } Asm::Done } foreach test { | | | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | Asm::Direct { Asm::Ins i_input_next dot } Asm::Done } foreach test { alpha alnum ascii control digit graph lower print punct space upper wordchar xdigit ddigit } { proc ::pt::peg::to::tclparam::Op::$test {modes} \ [string map [list @ $test] { Asm::Start Asm::ReExpression @ Asm::Direct { |
︙ | ︙ | |||
421 422 423 424 425 426 427 | }] } proc ::pt::peg::to::tclparam::Op::t {modes char} { Asm::Start Asm::ReTerminal t $char Asm::Direct { | | | | | | | | | | | | < < > > > | > > > > > > > | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | }] } proc ::pt::peg::to::tclparam::Op::t {modes char} { Asm::Start Asm::ReTerminal t $char Asm::Direct { set char [char quote tcl $char] #Asm::Ins i_input_next "\{t $char\}" #Asm::Ins i:fail_return #Asm::Ins i_test_char $char Asm::Ins si:next_char $char } Asm::Done } proc ::pt::peg::to::tclparam::Op::.. {modes chs che} { Asm::Start Asm::ReTerminal .. $chs $che Asm::Direct { set chs [char quote tcl $chs] set che [char quote tcl $che] #Asm::Ins i_input_next "\{.. $chs $che\}" #Asm::Ins i:fail_return #Asm::Ins i_test_range $chs $che Asm::Ins si:next_range $chs $che } Asm::Done } proc ::pt::peg::to::tclparam::Op::str {modes args} { Asm::Start Asm::ReTerminal str {*}$args Asm::Direct { # Without fusing this would be rendered as a sequence of # characters, with associated stack churn for each character/part # (See Op::x, void/all). set str [join $args {}] set str [char quote tcl $str] Asm::Ins si:next_str $str } Asm::Done } proc ::pt::peg::to::tclparam::Op::cl {modes args} { # rorc = Range-OR-Char-List Asm::Start Asm::ReTerminal cl {*}$args Asm::Direct { # Without fusing this would be rendered as a choice of # characters, with associated stack churn for each # character/branch (See Op::/, void/all). set cl [join [Ranges {*}$args] {}] set cl [char quote tcl $cl] Asm::Ins si:next_class $cl } Asm::Done } proc ::pt::peg::to::tclparam::Op::Ranges {args} { set res {} foreach rorc $args { lappend res [Range $rorc] } return $res } proc ::pt::peg::to::tclparam::Op::Range {rorc} { # See also pt::peg::to::peg # We use string ops here to distinguish terminals and ranges. The # input can be a single char, not a list, and further the char may # not be a proper list. Example: double-apostroph. |
︙ | ︙ | |||
503 504 505 506 507 508 509 | set res {} for {set i $s} {$i <= $e} {incr i} { append res [format %c $i] } return $res } else { | | | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | set res {} for {set i $s} {$i <= $e} {incr i} { append res [format %c $i] } return $res } else { return $rorc ;#[char quote tcl $rorc] } } proc ::pt::peg::to::tclparam::Op::n {modes symbol} { # symbol mode determines AST generation # void => non-generative, # leaf/value => generative. |
︙ | ︙ | |||
1257 1258 1259 1260 1261 1262 1263 | # which behalf the conversion has # been invoked. } # ### ### ### ######### ######### ######### ## Ready | | | 1265 1266 1267 1268 1269 1270 1271 1272 1273 | # which behalf the conversion has # been invoked. } # ### ### ### ######### ######### ######### ## Ready package provide pt::peg::to::tclparam 1.0.2 return |
Changes to modules/pt/pt_pegrammar.tcl.
︙ | ︙ | |||
343 344 345 346 347 348 349 | } namespace eval ::pt::peg { # # ## ### ##### ######## ############# variable ourcode pt::grammar::peg variable ourprefix {error in serialization:} | | | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | } namespace eval ::pt::peg { # # ## ### ##### ######## ############# variable ourcode pt::grammar::peg variable ourprefix {error in serialization:} # # Test cases (grammar-peg-structure-) variable ourshort { dictionary too short, expected exactly one key} ; # variable ourtag { bad type tag "%s"} ; # variable ourcbadlen { dictionary of bad length, expected exactly two keys} ; # variable ourmiss { missing expected key "%s"} ; # variable oursmiss { symbol "%s", missing expected key "%s"} ; # variable ourbadpe { bad %s parsing expression:} ; # variable ourbadmode { symbol "%s", bad nonterminal mode "%s"} ; # |
︙ | ︙ |
Changes to modules/pt/pt_pexpression.man.
1 | [comment {-*- text -*- doctools manpage}] | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | [vset VERSION 1.0.1] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::pe n [vset VERSION]] [include include/module.inc] [titledesc {Parsing Expression Serialization}] [require pt::pe [opt [vset VERSION]]] [require char] [description] [include include/ref_intro.inc] This package provides commands to work with the serializations of parsing expressions as managed by the Parser Tools, and specified in section [sectref {PE serialization format}]. |
︙ | ︙ |
Changes to modules/pt/pt_pexpression.tcl.
1 | # -*- 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 | # -*- tcl -*- # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # Verification of serialized parsing expressions, conversion # between such and other data structures, and their construction. # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.5 ; # Required runtime. package require char ; # Character quoting utilities. # # ## ### ##### ######## ############# ##################### ## namespace eval ::pt::pe { namespace export \ verify verify-as-canonical canonicalize \ bottomup topdown print equal \ \ epsilon dot alnum alpha ascii digit graph lower printable \ control punct space upper wordchar xdigit ddigit \ nonterminal optional repeat0 repeat1 ahead notahead \ choice sequence \ terminal range class str namespace ensemble create } # # ## ### ##### ######## ############# ## Public API |
︙ | ︙ | |||
127 128 129 130 131 132 133 | proc ::pt::pe::print {serial} { return [join [bottomup [list [namespace current]::Print] $serial] \n] } proc ::pt::pe::Print {pe op arguments} { switch -exact -- $op { epsilon - alpha - alnum - ascii - digit - graph - lower - print - \ | | | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | proc ::pt::pe::print {serial} { return [join [bottomup [list [namespace current]::Print] $serial] \n] } proc ::pt::pe::Print {pe op arguments} { switch -exact -- $op { epsilon - alpha - alnum - ascii - digit - graph - lower - print - \ control - punct - space - upper - wordchar - xdigit - ddigit - dot { return [list <$op>] } str { return [list "\"[join [char quote comment {*}$arguments] {}]\""] } cl { return [list "\[[join [char quote comment {*}$arguments] {}]\]"] } n { return [list "([lindex $arguments 0])"] } t { return [list "'[char quote comment [lindex $arguments 0]]'"] } .. { |
︙ | ︙ | |||
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | # # ## ### ##### ######## ############# proc ::pt::pe::epsilon {} { return epsilon } proc ::pt::pe::dot {} { return dot } proc ::pt::pe::alnum {} { return alnum } proc ::pt::pe::alpha {} { return alpha } proc ::pt::pe::ascii {} { return ascii } proc ::pt::pe::digit {} { return digit } proc ::pt::pe::graph {} { return graph } proc ::pt::pe::lower {} { return lower } proc ::pt::pe::printable {} { return print } proc ::pt::pe::punct {} { return punct } proc ::pt::pe::space {} { return space } proc ::pt::pe::upper {} { return upper } | > | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | # # ## ### ##### ######## ############# proc ::pt::pe::epsilon {} { return epsilon } proc ::pt::pe::dot {} { return dot } proc ::pt::pe::alnum {} { return alnum } proc ::pt::pe::alpha {} { return alpha } proc ::pt::pe::ascii {} { return ascii } proc ::pt::pe::control {} { return control } proc ::pt::pe::digit {} { return digit } proc ::pt::pe::graph {} { return graph } proc ::pt::pe::lower {} { return lower } proc ::pt::pe::printable {} { return print } proc ::pt::pe::punct {} { return punct } proc ::pt::pe::space {} { return space } proc ::pt::pe::upper {} { return upper } |
︙ | ︙ | |||
237 238 239 240 241 242 243 | proc ::pt::pe::repeat1 {pe} { list + $pe } proc ::pt::pe::ahead {pe} { list & $pe } proc ::pt::pe::notahead {pe} { list ! $pe } proc ::pt::pe::choice {pe args} { linsert $args 0 / $pe } proc ::pt::pe::sequence {pe args} { linsert $args 0 x $pe } | | > > | > > > > > > > > > > > > > > | 238 239 240 241 242 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 268 269 270 271 272 273 274 | proc ::pt::pe::repeat1 {pe} { list + $pe } proc ::pt::pe::ahead {pe} { list & $pe } proc ::pt::pe::notahead {pe} { list ! $pe } proc ::pt::pe::choice {pe args} { linsert $args 0 / $pe } proc ::pt::pe::sequence {pe args} { linsert $args 0 x $pe } proc ::pt::pe::terminal {t} { list t $t } proc ::pt::pe::range {ta tb} { if {$ta eq $tb} { list t $ta } else { list .. $ta $tb } } proc ::pt::pe::class {set} { if {[string length $set] > 1} { list cl $set } else { list t $set } } proc ::pt::pe::str {str} { if {[string length $str] > 1} { list str $str } else { list t $str } } namespace eval ::pt::pe { # # ## ### ##### ######## ############# ## Strings for error messages. variable ourprefix "error in serialization:" |
︙ | ︙ | |||
265 266 267 268 269 270 271 272 273 274 275 276 277 278 | variable ourarity array set ourarity { epsilon {0 0} alpha {0 0} alnum {0 0} ascii {0 0} digit {0 0} graph {0 0} lower {0 0} print {0 0} punct {0 0} space {0 0} upper {0 0} | > | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | variable ourarity array set ourarity { epsilon {0 0} alpha {0 0} alnum {0 0} ascii {0 0} control {0 0} digit {0 0} graph {0 0} lower {0 0} print {0 0} punct {0 0} space {0 0} upper {0 0} |
︙ | ︙ | |||
295 296 297 298 299 300 301 | ## # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready | | | 313 314 315 316 317 318 319 320 321 | ## # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::pe 1.0.2 return |
Changes to modules/pt/pt_pgen.tcl.
1 2 | # -*- 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 -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # Grammars / Parsing Expression Grammars / Parser Generator # ### ### ### ######### ######### ######### ## Package description # A package exporting a parser generator command. # ### ### ### ######### ######### ######### ## Requisites package require Tcl 8.5 package require fileutil package require pt::peg::from::json ; # Frontends: json, and PEG text form package require pt::peg::from::peg ; # package require pt::peg::to::container ; # Backends: json, peg, container code, package require pt::peg::to::json ; # param assembler, package require pt::peg::to::peg ; # package require pt::peg::to::param ; # PARAM assembly, raw package require pt::peg::to::tclparam ; # PARAM assembly, embedded into Tcl package require pt::peg::to::cparam ; # PARAM assembly, embedded into C package require pt::tclparam::configuration::snit 1.0.2 ; # PARAM/Tcl, snit::type package require pt::tclparam::configuration::tcloo 1.0.4 ; # PARAM/Tcl, TclOO class package require pt::cparam::configuration::critcl 1.0.2 ; # PARAM/C, in critcl package require pt::cparam::configuration::tea ; # PARAM/C, in TEA # ### ### ### ######### ######### ######### ## Implementation namespace eval ::pt::pgen { namespace export json peg serial namespace ensemble create |
︙ | ︙ | |||
51 52 53 54 55 56 57 | return [Write {*}$args [pt::peg::from::peg convert $input]] } # # ## ### ##### ######## ############# ## Internals - Generating the parser. namespace eval ::pt::pgen::Write { | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | return [Write {*}$args [pt::peg::from::peg convert $input]] } # # ## ### ##### ######## ############# ## Internals - Generating the parser. namespace eval ::pt::pgen::Write { namespace export json peg container param snit oo critcl c tea namespace ensemble create } proc ::pt::pgen::Write::json {args} { # args = (option value)... grammar pt::peg::to::json configure {*}[lrange $args 0 end-1] return [pt::peg::to::json convert [lindex $args end]] |
︙ | ︙ | |||
81 82 83 84 85 86 87 | # args = (option value)... grammar pt::peg::to::param configure {*}[lrange $args 0 end-1] return [pt::peg::to::param convert [lindex $args end]] } proc ::pt::pgen::Write::snit {args} { # args = (option value)... grammar | | | | | > > > > > > > > > > > > > > > > | | | > > > > > > > > > > | 82 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | # args = (option value)... grammar pt::peg::to::param configure {*}[lrange $args 0 end-1] return [pt::peg::to::param convert [lindex $args end]] } proc ::pt::pgen::Write::snit {args} { # args = (option value)... grammar pt::peg::to::tclparam configure {*}[Package [Version [Class [lrange $args 0 end-1]]]] ClassPackageDefaults pt::tclparam::configuration::snit def \ $class $package $version \ {pt::peg::to::tclparam configure} return [pt::peg::to::tclparam convert [lindex $args end]] } proc ::pt::pgen::Write::oo {args} { # args = (option value)... grammar pt::peg::to::tclparam configure {*}[Package [Version [Class [lrange $args 0 end-1]]]] ClassPackageDefaults pt::tclparam::configuration::tcloo def \ $class $package $version \ {pt::peg::to::tclparam configure} return [pt::peg::to::tclparam convert [lindex $args end]] } proc ::pt::pgen::Write::tea {args} { # args = (option value)... grammar # Class -> touches/defines variable 'class' # Package -> touches/defines variable 'package' # Version -> touches/defines variable 'version' pt::peg::to::cparam configure {*}[Package [Version [Class [lrange $args 0 end-1]]]] ClassPackageDefaults pt::cparam::configuration::tea def \ $class $package $version \ {pt::peg::to::cparam configure} return [pt::peg::to::cparam convert [lindex $args end]] } proc ::pt::pgen::Write::critcl {args} { # args = (option value)... grammar # Class -> touches/defines variable 'class' # Package -> touches/defines variable 'package' # Version -> touches/defines variable 'version' pt::peg::to::cparam configure {*}[Package [Version [Class [lrange $args 0 end-1]]]] ClassPackageDefaults pt::cparam::configuration::critcl def \ $class $package $version \ {pt::peg::to::cparam configure} return [pt::peg::to::cparam convert [lindex $args end]] } proc ::pt::pgen::Write::c {args} { # args = (option value)... grammar pt::peg::to::cparam configure {*}[lrange $args 0 end-1] return [pt::peg::to::cparam convert [lindex $args end]] } # ### ### ### ######### ######### ######### ## Internals: Special option handling handling. proc ::pt::pgen::Write::ClassPackageDefaults {} { upvar 1 class class upvar 1 package package upvar 1 version version # Initialize undefined class and package names from each other, # i.e. from whichever of the two was specified, or fallback to # hardwired defaults if neither was specified. if {[info exists class] && ![info exists package]} { set package $class } elseif {[info exists package] && ![info exists class]} { set class $package } elseif {![info exists package] && ![info exists class]} { set class CLASS set package PACKAGE } # Initialize undefined version information. if {![info exists version]} { set version 1 } return } # Class, Package, Version - identical modulo option and variable name. # TODO: Refactor into some common code. proc ::pt::pgen::Write::Class {optiondict} { upvar 1 class class set res {} foreach {option value} $optiondict { if {$option eq "-class"} { set class $value |
︙ | ︙ | |||
170 171 172 173 174 175 176 177 178 179 180 | set package $value continue } lappend res $option $value } return $res } # ### ### ### ######### ######### ######### ## Package Management | > > > > > > > > > > > > > | | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | set package $value continue } lappend res $option $value } return $res } proc ::pt::pgen::Write::Version {optiondict} { upvar 1 version version set res {} foreach {option value} $optiondict { if {$option eq "-version"} { set version $value continue } lappend res $option $value } return $res } # ### ### ### ######### ######### ######### ## Package Management package provide pt::pgen 1.0.3 |
Added modules/pt/pt_pgen.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 | # -*- tcl -*- # pt_pgen.test: Testing the parser generator, and the generated parsers. # Mainly for testing generated parsers for good and bad inputs. # # Copyright (c) 2014 by Andreas Kupries <[email protected]> # All rights reserved. # # RCS: @(#) $Id: pt_parse_peg.test,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] testsNeedTcl 8.5 testsNeedTcltest 2 # Check if we have critcl available. tcltest::testConstraint critcl [expr {![catch {package require critcl}]}] support { useAccel [useTcllibC] struct/stack.tcl struct::stack ; # User: pt::rde TestAccelInit struct::stack ; # (tcl) useAccel [useTcllibC] struct/sets.tcl struct::set TestAccelInit struct::set if {![package vsatisfies [package present Tcl] 8.6]} { # Pull in try emulation for 8.5. Tcl 8.6 has it builtin. use try/try.tcl try } use snit/snit.tcl snit use fileutil/fileutil.tcl fileutil ;# tests/common use textutil/adjust.tcl textutil::adjust useLocal pt_util.tcl pt::util useLocal pt_astree.tcl pt::ast useLocal pt_pexpression.tcl pt::pe useLocal pt_pexpr_op.tcl pt::pe::op useLocal pt_pegrammar.tcl pt::peg useLocal pt_peg_container.tcl pt::peg::container useAccel [useTcllibC] pt/pt_rdengine.tcl pt::rde ; # User: pt::parse::peg TestAccelInit pt::rde ; # and: pt:peg::interp useLocal pt_rdengine_oo.tcl pt::rde::oo useLocal pt_peg_interp.tcl pt::peg::interp useAccel [useTcllibC] pt/pt_parse_peg.tcl pt::parse::peg ; # User: pt::peg::from::peg TestAccelInit pt::parse::peg useLocal pt_peg_from_json.tcl pt::peg::from::json ; # Frontends: json, and PEG text form useLocal pt_peg_from_peg.tcl pt::peg::from::peg ; # useLocal pt_peg_to_container.tcl pt::peg::to::container ; # Backends: json, peg, container code, useLocal pt_peg_to_json.tcl pt::peg::to::json ; # param assembler, useLocal pt_peg_to_peg.tcl pt::peg::to::peg ; # useLocal pt_peg_to_param.tcl pt::peg::to::param ; # PARAM assembly, raw useLocal pt_peg_to_tclparam.tcl pt::peg::to::tclparam ; # PARAM assembly, embedded into Tcl useLocal pt_peg_to_cparam.tcl pt::peg::to::cparam ; # PARAM assembly, embedded into C useLocal pt_tclparam_config_snit.tcl pt::tclparam::configuration::snit ; # PARAM/Tcl, snit::type useLocal pt_tclparam_config_tcloo.tcl pt::tclparam::configuration::tcloo ; # PARAM/Tcl, TclOO class useLocal pt_cparam_config_critcl.tcl pt::cparam::configuration::critcl ; # PARAM/C, in critcl # Get the parser used by the converter, either the grammar # interpreter, or snit-based and spcialized to PEG. #useLocal pt_peg_container_peg.tcl pt::peg::container::peg #useLocal pt_peg_interp.tcl pt::peg::interp source [localPath tests/common] } testing { useLocal pt_pgen.tcl pt::pgen ;# Generator } set mytestdir tests/data # Table of test cases ... # Id PEG InText Error detail Readable char set chars {} lappend chars 0 \{ \{ [list t \{] \{ lappend chars 1 \[ \[ [list t \[] \[ lappend chars 2 \" \" [list t \"] \" lappend chars 3 \\033 \033 [list t \33] <ESC> lappend chars 4 \\n \n [list t \n] <LF> lappend chars 5 \\r \r [list t \r] <CR> lappend chars 6 \\t \t [list t \t] <TAB> # \b, \f, \v - Extend PEG grammar to recognize. Also \e = \33 lappend chars 7 \\010 \b [list t \b] <BS> lappend chars 8 \\014 \f [list t \f] <FF> lappend chars 9 \\013 \v [list t \v] <VTAB> lappend chars 10 \\007 \a [list t \a] <BEL> lappend chars 11 { } { } [list t { }] <SPACE> lappend chars 12 \\\\ \\ [list t \\] \\ # math symbol, circled asterix lappend chars 13 \\u229b \u229b [list t \u229b] \u229b # test all control characters ... (and DEL) # more characters: above ascii = unicode BMP. # Grammar for all test cases below, with the actual character mapped # in (replacing @). set gtemplate "PEG a_pe_grammar ('@') END;" set etemplate "Parse error at position 0 (Line 0, column 0).\n... X ...\n ^\nExpected one of\n* The character '@'\n" # ------------------------------------------------------------------------- # While some of the C pieces are usually not required at runtime (like # C stack when RDE is also C), we are calling on the parser generator # here, which still may use a different implementation. So, no # shurtcuts, and full 16x expansion (2^4). TestAccelDo struct::set setimpl { TestAccelDo pt::parse::peg parseimpl { TestAccelDo pt::rde rdeimpl { TestAccelDo struct::stack stackimpl { source [localPath tests/pt_pgen.tests] } } } } # ------------------------------------------------------------------------- TestAccelExit struct::stack TestAccelExit pt::rde TestAccelExit pt::parse::peg TestAccelExit struct::set testsuiteCleanup return |
Changes to modules/pt/pt_rdengine.man.
1 | [comment {-*- text -*- doctools manpage}] | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | [vset VERSION 1.0.3] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::rde n [vset VERSION]] [include include/module.inc] [titledesc {Parsing Runtime Support, PARAM based}] [require pt::rde [opt [vset VERSION]]] [require snit] [require struct::stack 1.4] [require pt::ast 1.1] [description] [include include/ref_intro.inc] This package provides a class whose instances provide the runtime |
︙ | ︙ |
Changes to modules/pt/pt_rdengine.tcl.
1 2 | # -*- tcl -*- # | | | 1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ##################### ## Package description ## Implementation of the PackRat Machine (PARAM), a virtual machine on ## top of which parsers for Parsing Expression Grammars (PEGs) can be ## realized. This implementation is tied to Tcl for control flow. We |
︙ | ︙ | |||
180 181 182 183 184 185 186 | ## Ready namespace eval ::pt { # Export the constructor command. namespace export rde } | | | 180 181 182 183 184 185 186 187 | ## Ready namespace eval ::pt { # Export the constructor command. namespace export rde } package provide pt::rde 1.0.3 |
Changes to modules/pt/pt_rdengine_c.tcl.
1 2 | # -*- 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 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ##################### ## Package description ## Implementation of the PackRat Machine (PARAM), a virtual machine on ## top of which parsers for Parsing Expression Grammars (PEGs) can be ## realized. This implementation is written in C, for parsers written in ## Tcl. As such the parsers themselves are tied to Tcl for control flow. # ## RD stands for Recursive Descent. # # ## ### ##### ######## ############# ##################### ## Requisites package require Tcl 8.4 package require critcl # @sak notprovided pt_rde_critcl package provide pt_rde_critcl 1.3.3 # # ## ### ##### ######## ############# ##################### ## Implementation namespace eval ::pt { # # ## ### ##### ######## ############# ##################### |
︙ | ︙ | |||
72 73 74 75 76 77 78 | paramg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) paramg); } paramg->counter ++; | | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | paramg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) paramg); } paramg->counter ++; sprintf (paramg->buf, "rde%ld", paramg->counter); return paramg->buf; #undef KEY } static void PARAMdeleteCmd (ClientData clientData) |
︙ | ︙ | |||
160 161 162 163 164 165 166 | return TCL_OK; } } # # ## ### ##### ######## ############# ##################### ## Ready | | | 160 161 162 163 164 165 166 167 168 | return TCL_OK; } } # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::rde::critcl 1.0.3 return |
Changes to modules/pt/pt_rdengine_oo.tcl.
1 2 | # -*- tcl -*- # | | | 1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ##################### ## Package description ## Implementation of the PackRat Machine (PARAM), a virtual machine on ## top of which parsers for Parsing Expression Grammars (PEGs) can be ## realized. This implementation is tied to Tcl for control flow. We |
︙ | ︙ | |||
68 69 70 71 72 73 74 75 76 77 78 79 | if {$myok} { set n [$mystackast size] if {$n > 1} { set pos [$mystackloc peek] incr pos set children [lreverse [$mystackast peek [$mystackast size]]] ; # SaveToMark return [pt::ast new {} $pos $myloc {*}$children] ; # Reduce ALL } else { return [$mystackast peek] } } else { lassign $myerror loc messages | > > > > | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | if {$myok} { set n [$mystackast size] if {$n > 1} { set pos [$mystackloc peek] incr pos set children [lreverse [$mystackast peek [$mystackast size]]] ; # SaveToMark return [pt::ast new {} $pos $myloc {*}$children] ; # Reduce ALL } elseif {$n == 0} { # Match, but no AST. This is possible if the grammar # consists of only the start expression. return {} } else { return [$mystackast peek] } } else { lassign $myerror loc messages return -code error [list pt::rde $loc $messages] } } # # ## ### ##### ######## ############# ##################### ## API - State accessors method chan {} { return $mychan } |
︙ | ︙ | |||
355 356 357 358 359 360 361 | } if {$myok} { $mystackloc pop return -code return } set myloc [$mystackloc peek] | | | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | } if {$myok} { $mystackloc pop return -code return } set myloc [$mystackloc peek] $mystackerr push $myerror return } method si:voidvalue_branch {} { # i_error_pop_merge # i:ok_loc_pop_discard # i:ok_return |
︙ | ︙ | |||
586 587 588 589 590 591 592 | set n [string length $tok] set last [expr {$myloc + $n}] set max [string length $mytoken] incr myloc if {($last >= $max) && ![my ExtendTCN [expr {$last - $max + 1}]]} { set myok 0 | | | | | | 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | set n [string length $tok] set last [expr {$myloc + $n}] set max [string length $mytoken] incr myloc if {($last >= $max) && ![my ExtendTCN [expr {$last - $max + 1}]]} { set myok 0 set myerror [list $myloc [list [list str $tok]]] # i:fail_return return } set lex [string range $mytoken $myloc $last] set mycurrent [string index $mytoken $last] set myok [expr {$tok eq $lex}] if {$myok} { set myloc $last set myerror {} } else { set myerror [list $myloc [list [list str $tok]]] incr myloc -1 } return } method si:next_class {tok} { # Class = Choice of characters. No need for stack churn. # i_input_next "\{t $c\}" # i:fail_return # i_test_<user class> incr myloc if {($myloc >= [string length $mytoken]) && ![my ExtendTC]} { set myok 0 set myerror [list $myloc [list [list cl $tok]]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] # Note what is needle versus hay. The token, i.e. the string # of allowed characters is the hay in which the current # character is looked, making it the needle. set myok [expr {[string first $mycurrent $tok] >= 0}] if {$myok} { set myerror {} } else { set myerror [list $myloc [list [list cl $tok]]] incr myloc -1 } return } method si:next_char {tok} { # i_input_next "\{t $c\}" |
︙ | ︙ | |||
754 755 756 757 758 759 760 761 762 763 764 765 766 767 | } set mycurrent [string index $mytoken $myloc] set myok [string is ascii -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list ascii]] incr myloc -1 } else { set myerror {} } return } method si:next_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_ddigit" | > > > > > > > > > > > > > > > > > > > > > > > > | 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 | } set mycurrent [string index $mytoken $myloc] set myok [string is ascii -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list ascii]] incr myloc -1 } else { set myerror {} } return } method si:next_control {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_control" #Asm::Ins i_input_next control #Asm::Ins i:fail_return #Asm::Ins i_test_control incr myloc if {($myloc >= [string length $mytoken]) && ![my ExtendTC]} { set myok 0 set myerror [list $myloc [list control]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] set myok [string is control -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list control]] incr myloc -1 } else { set myerror {} } return } method si:next_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_ddigit" |
︙ | ︙ | |||
1111 1112 1113 1114 1115 1116 1117 | set mysvalue [pt::ast new $symbol $pos $myloc {*}$mysvalue] ; # Reduce $symbol } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | set mysvalue [pt::ast new $symbol $pos $myloc {*}$mysvalue] ; # Reduce $symbol } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:reduce_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] if {$myok} { $mystackast push $mysvalue } return } |
︙ | ︙ | |||
1154 1155 1156 1157 1158 1159 1160 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:void_leaf_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} if {$myok} { $mystackast push $mysvalue } return } |
︙ | ︙ | |||
1197 1198 1199 1200 1201 1202 1203 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:value_leaf_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] if {$myok} { $mystackast push $mysvalue } return } |
︙ | ︙ | |||
1226 1227 1228 1229 1230 1231 1232 | set mysvalue {} set at [$mystackloc pop] set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | > | | | 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 | set mysvalue {} set at [$mystackloc pop] set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:value_clear_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] return } method si:void_clear_symbol_end {symbol} { # i_value_clear # i_symbol_save $symbol # i_error_nonterminal $symbol # i_loc_pop_discard set mysvalue {} set at [$mystackloc pop] set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:void_clear_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} return } # # ## ### ##### ######## ############# ##################### ## API - Instructions - Control flow method i:ok_continue {} { |
︙ | ︙ | |||
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 | # Equal locations, merge the message lists. #set myerror [list $loe [struct::set union $msgse $msgsn]] set myerror [list $loe [lsort -uniq [list {*}$msgse {*}$msgsn]]] return } method i_error_nonterminal {symbol} { # Inlined: Errors, Expected. if {![llength $myerror]} return set pos [$mystackloc peek] incr pos lassign $myerror loc messages if {$loc != $pos} return set myerror [list $loc [list $symbol]] | > > > > > > > | 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 | # Equal locations, merge the message lists. #set myerror [list $loe [struct::set union $msgse $msgsn]] set myerror [list $loe [lsort -uniq [list {*}$msgse {*}$msgsn]]] return } method i_error_nonterminal {symbol} { # i_error_nonterminal -- Disabled. Generate only low-level # i_error_nonterminal -- errors until we have worked out how # i_error_nonterminal -- to integrate symbol information with # i_error_nonterminal -- them. Do not forget where this # i_error_nonterminal -- instruction is inlined. return # Inlined: Errors, Expected. if {![llength $myerror]} return set pos [$mystackloc peek] incr pos lassign $myerror loc messages if {$loc != $pos} return set myerror [list $loc [list $symbol]] |
︙ | ︙ | |||
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 | } method i_test_ascii {} { set myok [string is ascii -strict $mycurrent] my OkFail [pt::pe ascii] return } method i_test_char {tok} { set myok [expr {$tok eq $mycurrent}] my OkFail [pt::pe terminal $tok] return } | > > > > > > | 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 | } method i_test_ascii {} { set myok [string is ascii -strict $mycurrent] my OkFail [pt::pe ascii] return } method i_test_control {} { set myok [string is control -strict $mycurrent] my OkFail [pt::pe control] return } method i_test_char {tok} { set myok [expr {$tok eq $mycurrent}] my OkFail [pt::pe terminal $tok] return } |
︙ | ︙ | |||
1690 1691 1692 1693 1694 1695 1696 | # # ## ### ##### ######## ############# ##################### } # # ## ### ##### ######## ############# ##################### ## Ready | | | 1736 1737 1738 1739 1740 1741 1742 1743 1744 | # # ## ### ##### ######## ############# ##################### } # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::rde::oo 1.0.3 return |
Changes to modules/pt/pt_rdengine_tcl.tcl.
1 2 | # -*- 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 43 44 45 46 47 48 49 50 51 52 53 | # -*- tcl -*- # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ##################### ## Package description ## Implementation of the PackRat Machine (PARAM), a virtual machine on ## top of which parsers for Parsing Expression Grammars (PEGs) can be ## realized. This implementation is tied to Tcl for control flow. We ## (will) have alternate implementations written in TclOO, and critcl, ## all exporting the same API. # ## RD stands for Recursive Descent. # # ## ### ##### ######## ############# ##################### ## Requisites package require Tcl 8.5 package require snit package require struct::stack 1.5 ; # Requiring peekr, getr, trim* methods package require pt::ast package require pt::pe package require char ; # quoting # # ## ### ##### ######## ############# ##################### ## Implementation snit::type ::pt::rde_tcl { # # ## ### ##### ######## ############# ##################### ## API - Lifecycle constructor {} { set mystackloc [struct::stack ${selfns}::LOC] ; # LS set mystackerr [struct::stack ${selfns}::ERR] ; # ES set mystackast [struct::stack ${selfns}::AST] ; # ARS/AS set mystackmark [struct::stack ${selfns}::MARK] ; # s.a. return } #TRACE variable count 0 #variable count 0 method reset {{chan {}}} { ; #set count 0 ; #TRACE puts "[format %8d [incr count]] RDE reset" set mychan $chan ; # IN set mycurrent {} ; # CC set myloc -1 ; # CL set myok 0 ; # ST set msvalue {} ; # SV set myerror {} ; # ER set mytoken {} ; # TC |
︙ | ︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 | if {$myok} { set n [$mystackast size] if {$n > 1} { set pos [$mystackloc peek] incr pos set children [$mystackast peekr [$mystackast size]] ; # SaveToMark return [pt::ast new {} $pos $myloc {*}$children] ; # Reduce ALL } else { return [$mystackast peek] } } else { lassign $myerror loc messages | > > > > | > > | 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 | if {$myok} { set n [$mystackast size] if {$n > 1} { set pos [$mystackloc peek] incr pos set children [$mystackast peekr [$mystackast size]] ; # SaveToMark return [pt::ast new {} $pos $myloc {*}$children] ; # Reduce ALL } elseif {$n == 0} { # Match, but no AST. This is possible if the grammar # consists of only the start expression. return {} } else { return [$mystackast peek] } } else { lassign $myerror loc messages return -code error \ -errorcode {PT RDE SYNTAX} \ [list pt::rde $loc $messages] } } # # ## ### ##### ######## ############# ##################### ## API - State accessors method chan {} { return $mychan } |
︙ | ︙ | |||
123 124 125 126 127 128 129 | append mytoken $data return } # # ## ### ##### ######## ############# ##################### ## Common instruction sequences | | | | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | append mytoken $data return } # # ## ### ##### ######## ############# ##################### ## Common instruction sequences method si:void_state_push {} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_state_push" # i_loc_push # i_error_clear_push $mystackloc push $myloc set myerror {} $mystackerr push {} return } method si:void2_state_push {} { ; #TRACE puts "[format %8d [incr count]] RDE si:void2_state_push" # i_loc_push # i_error_push $mystackloc push $myloc $mystackerr push {} return } method si:value_state_push {} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_state_push" # i_ast_push # i_loc_push # i_error_clear_push $mystackmark push [$mystackast size] $mystackloc push $myloc set myerror {} $mystackerr push {} return } # - -- --- ----- -------- ------------- --------------------- method si:void_state_merge {} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_state_merge" # i_error_pop_merge # i_loc_pop_rewind/discard set olderror [$mystackerr pop] # We have either old or new error data, keep it. if {![llength $myerror]} { set myerror $olderror |
︙ | ︙ | |||
182 183 184 185 186 187 188 | set last [$mystackloc pop] if {$myok} return set myloc $last return } | | | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | set last [$mystackloc pop] if {$myok} return set myloc $last return } method si:void_state_merge_ok {} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_state_merge_ok" # i_error_pop_merge # i_loc_pop_rewind/discard # i_status_ok set olderror [$mystackerr pop] # We have either old or new error data, keep it. if {![llength $myerror]} { |
︙ | ︙ | |||
213 214 215 216 217 218 219 | set last [$mystackloc pop] if {$myok} return set myloc $last set myok 1 return } | | | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | set last [$mystackloc pop] if {$myok} return set myloc $last set myok 1 return } method si:value_state_merge {} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_state_merge" # i_error_pop_merge # i_ast_pop_rewind/discard # i_loc_pop_rewind/discard set olderror [$mystackerr pop] # We have either old or new error data, keep it. if {![llength $myerror]} { |
︙ | ︙ | |||
247 248 249 250 251 252 253 | $mystackast trim* $mark set myloc $last return } # - -- --- ----- -------- ------------- --------------------- | | | | | | | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | $mystackast trim* $mark set myloc $last return } # - -- --- ----- -------- ------------- --------------------- method si:value_notahead_start {} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_notahead_start" # i_loc_push # i_ast_push $mystackloc push $myloc $mystackmark push [$mystackast size] return } method si:void_notahead_exit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_notahead_exit" # i_loc_pop_rewind # i_status_negate set myloc [$mystackloc pop] set myok [expr {!$myok}] return } method si:value_notahead_exit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_notahead_exit" # i_ast_pop_discard/rewind # i_loc_pop_rewind # i_status_negate set mark [$mystackmark pop] if {$myok} { $mystackast trim* $mark } set myloc [$mystackloc pop] set myok [expr {!$myok}] return } # - -- --- ----- -------- ------------- --------------------- method si:kleene_abort {} { ; #TRACE puts "[format %8d [incr count]] RDE si:kleene_abort" # i_loc_pop_rewind/discard # i:fail_return set last [$mystackloc pop] if {$myok} return set myloc $last return -code return } method si:kleene_close {} { ; #TRACE puts "[format %8d [incr count]] RDE si:kleene_close" # i_error_pop_merge # i_loc_pop_rewind/discard # i:fail_status_ok # i:fail_return set olderror [$mystackerr pop] # We have either old or new error data, keep it. |
︙ | ︙ | |||
325 326 327 328 329 330 331 | set myok 1 set myloc $last return -code return } # - -- --- ----- -------- ------------- --------------------- | | | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | set myok 1 set myloc $last return -code return } # - -- --- ----- -------- ------------- --------------------- method si:voidvoid_branch {} { ; #TRACE puts "[format %8d [incr count]] RDE si:voidvoid_branch" # i_error_pop_merge # i:ok_loc_pop_discard # i:ok_return # i_loc_rewind # i_error_push set olderror [$mystackerr pop] |
︙ | ︙ | |||
356 357 358 359 360 361 362 | } if {$myok} { $mystackloc pop return -code return } set myloc [$mystackloc peek] | | | | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | } if {$myok} { $mystackloc pop return -code return } set myloc [$mystackloc peek] $mystackerr push $myerror return } method si:voidvalue_branch {} { ; #TRACE puts "[format %8d [incr count]] RDE si:voidvalue_branch" # i_error_pop_merge # i:ok_loc_pop_discard # i:ok_return # i_ast_push # i_loc_rewind # i_error_push |
︙ | ︙ | |||
397 398 399 400 401 402 403 | } $mystackmark push [$mystackast size] set myloc [$mystackloc peek] $mystackerr push {} return } | | | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | } $mystackmark push [$mystackast size] set myloc [$mystackloc peek] $mystackerr push {} return } method si:valuevoid_branch {} { ; #TRACE puts "[format %8d [incr count]] RDE si:valuevoid_branch" # i_error_pop_merge # i_ast_pop_rewind/discard # i:ok_loc_pop_discard # i:ok_return # i_loc_rewind # i_error_push |
︙ | ︙ | |||
434 435 436 437 438 439 440 | } $mystackast trim* $mark set myloc [$mystackloc peek] $mystackerr push {} return } | | | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | } $mystackast trim* $mark set myloc [$mystackloc peek] $mystackerr push {} return } method si:valuevalue_branch {} { ; #TRACE puts "[format %8d [incr count]] RDE si:valuevalue_branch" # i_error_pop_merge # i_ast_pop_discard # i:ok_loc_pop_discard # i:ok_return # i_ast_rewind # i_loc_rewind # i_error_push |
︙ | ︙ | |||
474 475 476 477 478 479 480 | set myloc [$mystackloc peek] $mystackerr push {} return } # - -- --- ----- -------- ------------- --------------------- | | | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | set myloc [$mystackloc peek] $mystackerr push {} return } # - -- --- ----- -------- ------------- --------------------- method si:voidvoid_part {} { ; #TRACE puts "[format %8d [incr count]] RDE si:voidvoid_part" # i_error_pop_merge # i:fail_loc_pop_rewind # i:fail_return # i_error_push set olderror [$mystackerr pop] # We have either old or new error data, keep it. |
︙ | ︙ | |||
506 507 508 509 510 511 512 | set myloc [$mystackloc pop] return -code return } $mystackerr push $myerror return } | | | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | set myloc [$mystackloc pop] return -code return } $mystackerr push $myerror return } method si:voidvalue_part {} { ; #TRACE puts "[format %8d [incr count]] RDE si:voidvalue_part" # i_error_pop_merge # i:fail_loc_pop_rewind # i:fail_return # i_ast_push # i_error_push set olderror [$mystackerr pop] |
︙ | ︙ | |||
540 541 542 543 544 545 546 | return -code return } $mystackmark push [$mystackast size] $mystackerr push $myerror return } | | | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | return -code return } $mystackmark push [$mystackast size] $mystackerr push $myerror return } method si:valuevalue_part {} { ; #TRACE puts "[format %8d [incr count]] RDE si:valuevalue_part" # i_error_pop_merge # i:fail_ast_pop_rewind # i:fail_loc_pop_rewind # i:fail_return # i_error_push set olderror [$mystackerr pop] |
︙ | ︙ | |||
576 577 578 579 580 581 582 | } $mystackerr push $myerror return } # - -- --- ----- -------- ------------- --------------------- | | | | | > > > > > > > > | | | | | | | | | | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | } $mystackerr push $myerror return } # - -- --- ----- -------- ------------- --------------------- method si:next_str {tok} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_str ($tok)" # String = sequence of characters. # No need for all the intermediate stack churn. set n [string length $tok] set last [expr {$myloc + $n}] set max [string length $mytoken] incr myloc if {($last >= $max) && ![ExtendTCN [expr {$last - $max + 1}]]} { set myok 0 set myerror [list $myloc [list [pt::pe str $tok]]] # i:fail_return return } set lex [string range $mytoken $myloc $last] set mycurrent [string index $mytoken $last] # ATTENTION: The error output of this instruction is different # from a regular sequence of si:next_char instructions. The # error location will be the start of the string token we # wanted to match, and the message will contain the entire # string token. In the regular sequence we would see the exact # point of the mismatch instead, with the message containing # the expected character. set myok [expr {$tok eq $lex}] if {$myok} { set myloc $last set myerror {} } else { set myerror [list $myloc [list [pt::pe str $tok]]] incr myloc -1 } return } method si:next_class {tok} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_class ($tok)" # Class = Choice of characters. No need for stack churn. # i_input_next "\{t $c\}" # i:fail_return # i_test_<user class> incr myloc if {($myloc >= [string length $mytoken]) && ![ExtendTC]} { set myok 0 set myerror [list $myloc [list [pt::pe class $tok]]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] # Note what is needle versus hay. The token, i.e. the string # of allowed characters is the hay in which the current # character is looked, making it the needle. set myok [expr {[string first $mycurrent $tok] >= 0}] if {$myok} { set myerror {} } else { set myerror [list $myloc [list [pt::pe class $tok]]] incr myloc -1 } return } method si:next_char {tok} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_char ($tok)" # i_input_next "\{t $c\}" # i:fail_return # i_test_char $c incr myloc if {($myloc >= [string length $mytoken]) && ![ExtendTC]} { set myok 0 set myerror [list $myloc [list [pt::pe terminal $tok]]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] set myok [expr {$tok eq $mycurrent}] if {$myok} { set myerror {} } else { set myerror [list $myloc [list [pt::pe terminal $tok]]] incr myloc -1 } return } method si:next_range {toks toke} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_range ($toks $toke)" #Asm::Ins i_input_next "\{.. $s $e\}" #Asm::Ins i:fail_return #Asm::Ins i_test_range $s $e incr myloc if {($myloc >= [string length $mytoken]) && ![ExtendTC]} { set myok 0 set myerror [list $myloc [list [pt::pe range $toks $toke]]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] set myok [expr { ([string compare $toks $mycurrent] <= 0) && |
︙ | ︙ | |||
755 756 757 758 759 760 761 762 763 764 765 766 767 768 | } set mycurrent [string index $mytoken $myloc] set myok [string is ascii -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list ascii]] incr myloc -1 } else { set myerror {} } return } method si:next_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_ddigit" | > > > > > > > > > > > > > > > > > > > > > > > > | 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 | } set mycurrent [string index $mytoken $myloc] set myok [string is ascii -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list ascii]] incr myloc -1 } else { set myerror {} } return } method si:next_control {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_control" #Asm::Ins i_input_next control #Asm::Ins i:fail_return #Asm::Ins i_test_control incr myloc if {($myloc >= [string length $mytoken]) && ![ExtendTC]} { set myok 0 set myerror [list $myloc [list control]] # i:fail_return return } set mycurrent [string index $mytoken $myloc] set myok [string is control -strict $mycurrent] if {!$myok} { set myerror [list $myloc [list control]] incr myloc -1 } else { set myerror {} } return } method si:next_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE si:next_ddigit" |
︙ | ︙ | |||
1003 1004 1005 1006 1007 1008 1009 | set myerror {} } return } # - -- --- ----- -------- ------------- --------------------- | | | | | | | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | set myerror {} } return } # - -- --- ----- -------- ------------- --------------------- method si:value_symbol_start {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_symbol_start ($symbol)" # if @runtime@ i_symbol_restore $symbol # i:found:ok_ast_value_push # i:found_return # i_loc_push # i_ast_push set k [list $myloc $symbol] if {[info exists mysymbol($k)]} { lassign $mysymbol($k) myloc myok myerror mysvalue if {$myok} { $mystackast push $mysvalue } return -code return } $mystackloc push $myloc $mystackmark push [$mystackast size] return } method si:value_void_symbol_start {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_void_symbol_start ($symbol)" # if @runtime@ i_symbol_restore $symbol # i:found_return # i_loc_push # i_ast_push set k [list $myloc $symbol] if {[info exists mysymbol($k)]} { lassign $mysymbol($k) myloc myok myerror mysvalue return -code return } $mystackloc push $myloc $mystackmark push [$mystackast size] return } method si:void_symbol_start {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_symbol_start ($symbol)" # if @runtime@ i_symbol_restore $symbol # i:found:ok_ast_value_push # i:found_return # i_loc_push set k [list $myloc $symbol] if {[info exists mysymbol($k)]} { lassign $mysymbol($k) myloc myok myerror mysvalue if {$myok} { $mystackast push $mysvalue } return -code return } $mystackloc push $myloc return } method si:void_void_symbol_start {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_void_symbol_start ($symbol)" # if @runtime@ i_symbol_restore $symbol # i:found_return # i_loc_push set k [list $myloc $symbol] if {[info exists mysymbol($k)]} { lassign $mysymbol($k) myloc myok myerror mysvalue return -code return } $mystackloc push $myloc return } method si:reduce_symbol_end {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:reduce_symbol_end ($symbol)" # i_value_clear/reduce $symbol # i_symbol_save $symbol # i_error_nonterminal $symbol # i_ast_pop_rewind # i_loc_pop_discard # i:ok_ast_value_push |
︙ | ︙ | |||
1112 1113 1114 1115 1116 1117 1118 | set mysvalue [pt::ast new $symbol $pos $myloc {*}$mysvalue] ; # Reduce $symbol } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | | 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | set mysvalue [pt::ast new $symbol $pos $myloc {*}$mysvalue] ; # Reduce $symbol } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:reduce_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] if {$myok} { $mystackast push $mysvalue } return } method si:void_leaf_symbol_end {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_leaf_symbol_end ($symbol)" # i_value_clear/leaf $symbol # i_symbol_save $symbol # i_error_nonterminal $symbol # i_loc_pop_discard # i:ok_ast_value_push set mysvalue {} |
︙ | ︙ | |||
1155 1156 1157 1158 1159 1160 1161 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | | 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:void_leaf_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} if {$myok} { $mystackast push $mysvalue } return } method si:value_leaf_symbol_end {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_leaf_symbol_end ($symbol)" # i_value_clear/leaf $symbol # i_symbol_save $symbol # i_error_nonterminal $symbol # i_loc_pop_discard # i_ast_pop_rewind # i:ok_ast_value_push |
︙ | ︙ | |||
1198 1199 1200 1201 1202 1203 1204 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] | > | | | > | | | > | | | 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 | set mysvalue [pt::ast new $symbol $pos $myloc] } } set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:value_leaf_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] if {$myok} { $mystackast push $mysvalue } return } method si:value_clear_symbol_end {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:value_clear_symbol_end ($symbol)" # i_value_clear # i_symbol_save $symbol # i_error_nonterminal $symbol # i_loc_pop_discard # i_ast_pop_rewind set mysvalue {} set at [$mystackloc pop] set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:value_clear_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} $mystackast trim* [$mystackmark pop] return } method si:void_clear_symbol_end {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE si:void_clear_symbol_end ($symbol)" # i_value_clear # i_symbol_save $symbol # i_error_nonterminal $symbol # i_loc_pop_discard set mysvalue {} set at [$mystackloc pop] set k [list $at $symbol] set mysymbol($k) [list $myloc $myok $myerror $mysvalue] # si:void_clear_symbol_end / i_error_nonterminal -- inlined -- disabled if {0} {if {[llength $myerror]} { set pos $at incr pos lassign $myerror loc messages if {$loc == $pos} { set myerror [list $loc [list [list n $symbol]]] } }} return } # # ## ### ##### ######## ############# ##################### ## API - Instructions - Control flow method i:ok_continue {} { ; #TRACE puts "[format %8d [incr count]] RDE i:ok_continue" |
︙ | ︙ | |||
1312 1313 1314 1315 1316 1317 1318 | ## API - Instructions - Error handling. method i_error_clear {} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_clear" set myerror {} return } | | | | | 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 | ## API - Instructions - Error handling. method i_error_clear {} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_clear" set myerror {} return } method i_error_push {} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_push ($myerror)" $mystackerr push $myerror return } method i_error_clear_push {} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_clear_push ()" set myerror {} $mystackerr push {} return } method i_error_pop_merge {} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_pop_merge ($myerror)-/-([$mystackerr peek])" set olderror [$mystackerr pop] # We have either old or new error data, keep it. if {![llength $myerror]} { set myerror $olderror ; return } if {![llength $olderror]} return |
︙ | ︙ | |||
1345 1346 1347 1348 1349 1350 1351 | if {$loe > $lon} return # Equal locations, merge the message lists, set-like. set myerror [list $loe [lsort -uniq [list {*}$msgse {*}$msgsn]]] return } | | > > > > > > > | > > > | > > > > | 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 | if {$loe > $lon} return # Equal locations, merge the message lists, set-like. set myerror [list $loe [lsort -uniq [list {*}$msgse {*}$msgsn]]] return } method i_error_nonterminal {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE i_error_nonterminal ($symbol)" # i_error_nonterminal -- Disabled. Generate only low-level # i_error_nonterminal -- errors until we have worked out how # i_error_nonterminal -- to integrate symbol information with # i_error_nonterminal -- them. Do not forget where this # i_error_nonterminal -- instruction is inlined. return # Inlined: Errors, Expected. if {![llength $myerror]} { #TRACE puts "[format %8d $count] RDE i_error_nonterminal ($symbol) no error" return } set pos [$mystackloc peek] incr pos lassign $myerror loc messages if {$loc != $pos} { #TRACE puts "[format %8d $count] RDE i_error_nonterminal ($symbol) -- $myerror != $pos" return } set myerror [list $loc [list [list n $symbol]]] TRACE puts "[format %8d $count] RDE i_error_nonterminal ($symbol) := $myerror" return } # # ## ### ##### ######## ############# ##################### ## API - Instructions - Basic input handling and tracking method i_loc_pop_rewind/discard {} { ; #TRACE puts "[format %8d [incr count]] RDE i_loc_pop_rewind/discard (ok $myok ([expr {$myok ? "keep $myloc drop" : "back@"}] [$mystackloc peek]))" |
︙ | ︙ | |||
1497 1498 1499 1500 1501 1502 1503 | ## API - Instructions - Semantic values. method i_value_clear {} { ; #TRACE puts "[format %8d [incr count]] RDE i_value_clear" set mysvalue {} return } | | | | 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 | ## API - Instructions - Semantic values. method i_value_clear {} { ; #TRACE puts "[format %8d [incr count]] RDE i_value_clear" set mysvalue {} return } method i_value_clear/leaf {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE i_value_clear/leaf ($symbol ok $myok ([expr {[$mystackloc peek]+1}])-@$myloc)" # not quite value_lead (guarded, and clear on fail) # Inlined clear, reduce, and optimized. # Clear ; if {$ok} {Reduce $symbol} set mysvalue {} if {!$myok} return set pos [$mystackloc peek] incr pos if {($pos - 1) == $myloc} { # The symbol did not process any input. As this is # signaled to be ok (*) we create a node covering an empty # range. (Ad *): Can happen for a RHS using toplevel # operators * or ?. set mysvalue [pt::ast new0 $symbol $pos] } else { set mysvalue [pt::ast new $symbol $pos $myloc] } return } method i_value_clear/reduce {symbol} { ; #TRACE puts "[format %8d [incr count]] RDE i_value_clear/reduce ($symbol)" set mysvalue {} if {!$myok} return set mark [$mystackmark peek];# Old size of stack before current nt pushed more. set newa [expr {[$mystackast size] - $mark}] set pos [$mystackloc peek] |
︙ | ︙ | |||
1553 1554 1555 1556 1557 1558 1559 | } return } # # ## ### ##### ######## ############# ##################### ## API - Instructions - Terminal matching | | | 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 | } return } # # ## ### ##### ######## ############# ##################### ## API - Instructions - Terminal matching method i_input_next {msg} { ; #TRACE puts "[format %8d [incr count]] RDE i_input_next ($msg)" # Inlined: Getch, Expected, ClearErrors # Satisfy from input cache if possible. incr myloc # May read from the input (ExtendTC), and remember the # information. Note: We are implicitly incrementing the # location! |
︙ | ︙ | |||
1584 1585 1586 1587 1588 1589 1590 | } else { set myerror [list $myloc [list [pt::pe terminal $tok]]] incr myloc -1 } return } | | | 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 | } else { set myerror [list $myloc [list [pt::pe terminal $tok]]] incr myloc -1 } return } method i_test_range {toks toke} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_range ($toks $toke)" set myok [expr { ([string compare $toks $mycurrent] <= 0) && ([string compare $mycurrent $toke] <= 0) }] ; # {} if {$myok} { set myerror {} } else { |
︙ | ︙ | |||
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 | } method i_test_ascii {} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_ascii" set myok [string is ascii -strict $mycurrent] OkFail ascii return } method i_test_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_ddigit" set myok [string match {[0-9]} $mycurrent] OkFail ddigit return } | > > > > > > | 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 | } method i_test_ascii {} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_ascii" set myok [string is ascii -strict $mycurrent] OkFail ascii return } method i_test_control {} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_control" set myok [string is control -strict $mycurrent] OkFail control return } method i_test_ddigit {} { ; #TRACE puts "[format %8d [incr count]] RDE i_test_ddigit" set myok [string match {[0-9]} $mycurrent] OkFail ddigit return } |
︙ | ︙ | |||
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 | typevariable ourmsg -array {} typeconstructor { set ourmsg(alnum) [pt::pe alnum] set ourmsg(alpha) [pt::pe alpha] set ourmsg(ascii) [pt::pe ascii] set ourmsg(ddigit) [pt::pe ddigit] set ourmsg(digit) [pt::pe digit] set ourmsg(graph) [pt::pe graph] set ourmsg(lower) [pt::pe lower] set ourmsg(print) [pt::pe printable] set ourmsg(punct) [pt::pe punct] set ourmsg(space) [pt::pe space] | > | 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 | typevariable ourmsg -array {} typeconstructor { set ourmsg(alnum) [pt::pe alnum] set ourmsg(alpha) [pt::pe alpha] set ourmsg(ascii) [pt::pe ascii] set ourmsg(control) [pt::pe control] set ourmsg(ddigit) [pt::pe ddigit] set ourmsg(digit) [pt::pe digit] set ourmsg(graph) [pt::pe graph] set ourmsg(lower) [pt::pe lower] set ourmsg(print) [pt::pe printable] set ourmsg(punct) [pt::pe punct] set ourmsg(space) [pt::pe space] |
︙ | ︙ |
Changes to modules/pt/pt_tclparam_config_snit.man.
1 | [comment {-*- text -*- doctools manpage}] | > | | | | | 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 | [vset VERSION 1.0.2] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::tclparam::configuration::snit n [vset VERSION]] [include include/module.inc] [titledesc {Tcl/PARAM, Canned configuration, Snit}] [require pt::tclparam::configuration::snit [opt [vset VERSION]]] [description] [include include/ref_intro.inc] This package is an adjunct to [package pt::peg::to::tclparam], to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package [package pt::peg::to::tclparam] to generate [package snit]-based parser packages. [para] It is a supporting package in the Core Layer of Parser Tools. [para][image arch_core_support][para] [section API] [list_begin definitions] [call [cmd ::pt::tclparam::configuration::snit] [method def] \ [arg name] [arg pkg] [arg version] [arg cmdprefix]] The command applies the configuration provided by this package to the [arg cmdprefix], causing the creation of [package snit]-based parsers whose class is [arg name], in package [arg pkg] with [arg version]. [para] The use of a command prefix as API allows application of the configuration to not only [package pt::peg::to::tclparam] ([cmd {pt::peg::to::tclparam configure}]), but also export manager instances and PEG containers ([cmd {$export configuration set}] and |
︙ | ︙ |
Changes to modules/pt/pt_tclparam_config_snit.tcl.
1 | # -*- tcl -*- | | | 1 2 3 4 5 6 7 8 9 | # -*- tcl -*- # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # Canned configuration for the converter to Tcl/PARAM representation, # causing generation of a proper snit class. # The requirements of the embedded template are not our requirements. # @mdgen NODEP: snit # @mdgen NODEP: pt::rde |
︙ | ︙ | |||
23 24 25 26 27 28 29 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. | | > > > > > | < < < < < | 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 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. proc ::pt::tclparam::configuration::snit::def {class pkg version cmd} { # TODO :: See if we can consolidate the API for converters, # TODO :: plugins, export manager, and container in some way. # TODO :: Container may make exporter manager available through # TODO :: public method. # class : is actually the name of the package to generate, and # will be prefixed with :: to make it a proper absolute # class and Tcl namespace name. lappend map @@PKG@@ $pkg lappend map @@VERSION@@ $version lappend map @@CLASS@@ $class lappend map \n\t \n ;# undent the template {*}$cmd -runtime-command {$myparser} #{*}$cmd -self-command {$self} #{*}$cmd -proc-command method {*}$cmd -self-command {} {*}$cmd -proc-command proc {*}$cmd -prelude {upvar 1 myparser myparser} {*}$cmd -namespace {} {*}$cmd -main MAIN {*}$cmd -indent 4 {*}$cmd -template [string trim \ [string map $map { ## -*- tcl -*- ## ## Snit-based Tcl/PARAM implementation of the parsing ## expression grammar ## ## @name@ ## |
︙ | ︙ | |||
119 120 121 122 123 124 125 | ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready | | | | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready package provide @@PKG@@ @@VERSION@@ return }]] return } # # ## ### ##### ######## ############# namespace eval ::pt::tclparam::configuration::snit {} # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::tclparam::configuration::snit 1.0.2 return |
Changes to modules/pt/pt_tclparam_config_tcloo.man.
1 | [comment {-*- text -*- doctools manpage}] | > | | | | | 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 | [vset VERSION 1.0.4] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::tclparam::configuration::tcloo n [vset VERSION]] [include include/module.inc] [titledesc {Tcl/PARAM, Canned configuration, Tcloo}] [require pt::tclparam::configuration::tcloo [opt [vset VERSION]]] [description] [include include/ref_intro.inc] This package is an adjunct to [package pt::peg::to::tclparam], to make the use of this highly configurable package easier by providing a canned configuration. When applied this configuration causes the package [package pt::peg::to::tclparam] to generate [package OO]-based parser packages. [para] It is a supporting package in the Core Layer of Parser Tools. [para][image arch_core_support][para] [section API] [list_begin definitions] [call [cmd ::pt::tclparam::configuration::tcloo] [method def] \ [arg name] [arg pkg] [arg version] [arg cmdprefix]] The command applies the configuration provided by this package to the [arg cmdprefix], causing the creation of [package OO]-based parsers whose class is [arg name], in package [arg pkg] with [arg version]. [para] The use of a command prefix as API allows application of the configuration to not only [package pt::peg::to::tclparam] ([cmd {pt::peg::to::tclparam configure}]), but also export manager instances and PEG containers ([cmd {$export configuration set}] and |
︙ | ︙ |
Changes to modules/pt/pt_tclparam_config_tcloo.tcl.
1 | # -*- tcl -*- | | | 1 2 3 4 5 6 7 8 9 | # -*- tcl -*- # Copyright (c) 2009-2014 Andreas Kupries <[email protected]> # Canned configuration for the converter to Tcl/PARAM representation, # causing generation of a proper TclOO class. # The requirements of the embedded template are not our requirements. # @mdgen NODEP: TclOO # @mdgen NODEP: pt::rde::oo |
︙ | ︙ | |||
23 24 25 26 27 28 29 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. | | > > > > > | < < < < < | 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 | # # ## ### ##### ######## ############# ## Public API # Check that the proposed serialization of an abstract syntax tree is # indeed such. proc ::pt::tclparam::configuration::tcloo::def {class pkg version cmd} { # TODO :: See if we can consolidate the API for converters, # TODO :: plugins, export manager, and container in some way. # TODO :: Container may make exporter manager available through # TODO :: public method. lappend map @@PKG@@ $pkg lappend map @@VERSION@@ $version lappend map @@CLASS@@ $class lappend map \n\t \n ;# undent the template {*}$cmd -runtime-command my {*}$cmd -self-command my {*}$cmd -proc-command method {*}$cmd -prelude {} {*}$cmd -namespace {} {*}$cmd -main MAIN {*}$cmd -indent 4 {*}$cmd -template [string trim \ [string map $map { ## -*- tcl -*- ## ## OO-based Tcl/PARAM implementation of the parsing ## expression grammar ## ## @name@ ## |
︙ | ︙ | |||
99 100 101 102 103 104 105 | ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready | | | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready package provide @@PKG@@ @@VERSION@@ return }]] return } # # ## ### ##### ######## ############# namespace eval ::pt::tclparam::configuration::tcloo {} # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::tclparam::configuration::tcloo 1.0.4 return |
Added modules/pt/pt_util.man.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | [vset VERSION 1] [comment {-*- text -*- doctools manpage}] [manpage_begin pt::util n [vset VERSION]] [include include/module.inc] [titledesc {General utilities}] [require pt::ast [opt [vset VERSION]]] [description] [include include/ref_intro.inc] This package provides general utility commands. [para] This is a supporting package in the Core Layer of Parser Tools. [para][image arch_core_support][para] [section API] [list_begin definitions] [comment {= = == === ===== ======== ============= =====================}] [call [cmd ::pt::util] [method error2readable] \ [arg error] [arg text]] This command takes the structured form of a syntax [arg error] as thrown by parser runtimes and the input [arg text] to the parser which caused that error and returns a string describing the error in a human-readable form. [para] The input [arg text] is required to convert the character position of the error into a more readable line/column format, and to provide excerpts of the input around the error position. [comment {= = == === ===== ======== ============= =====================}] [call [cmd ::pt::util] [method error2position] \ [arg error] [arg text]] This command takes the structured form of a syntax [arg error] as thrown by parser runtimes and the input [arg text] to the parser which caused that error and returns a 2-element list containing the line number and column index for the error's character position in the input, in this order. [comment {= = == === ===== ======== ============= =====================}] [call [cmd ::pt::util] [method error2text] [arg error]] This command takes the structured form of a syntax [arg error] as thrown by parser runtimes and returns a list of strings, each describing a possible expected input in a human-readable form. [comment {= = == === ===== ======== ============= =====================}] [list_end] [include include/feedback.inc] [manpage_end] |
Added modules/pt/pt_util.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 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | # -*- tcl -*- # Copyright (c) 2014 Andreas Kupries <[email protected]> # Utility commands for parser syntax errors. # # ## ### ##### ######## ############# ##################### ## Requirements package require Tcl 8.5 ; # Required runtime. package require char # # ## ### ##### ######## ############# ##################### ## namespace eval ::pt::util { namespace export error2readable error2position error2text namespace ensemble create namespace import ::char::quote } # # ## ### ##### ######## ############# ## Public API proc ::pt::util::error2readable {error text} { lassign $error _ location msgs lassign [Position $location $text] l c lappend map \n \\n lappend map \r \\r lappend map \t \\t # Get 10 chars before and after the failure point. Depending on # the relative position of input beginning and end we may get less # back of either. Special characters in the input (line endings, # tabs) are quoted to keep this on a single line. set prefix [string map $map [string range $text ${location}-10 $location]] set suffix [string map $map [string range $text ${location}+1 ${location}+10]] # Construct a line pointing to the failure position. By using the # transformed prefix as our source (length) no complex # calculations are required. It is implicit in the prefix/suffix # separation above. set n [string length $prefix] incr n -1 set point [string repeat - $n] append point ^ # Print our results. lappend lines "Parse error at position $location (Line $l, column $c)." lappend lines "... ${prefix}${suffix} ..." lappend lines " $point" lappend lines "Expected one of" lappend lines "* [join [Readables $msgs] "\n* "]" lappend lines "" return [join $lines \n] } proc ::pt::util::error2position {error text} { lassign $error _ location msgs return [Position $location $text] } proc ::pt::util::error2text {error} { lassign $error _ location msgs return [Readables $msgs] } # # ## ### ##### ######## ############# ## Internals proc ::pt::util::Position {location text} { incr location -1 # Computing the line/col of a position is quite easy. Split the # part before the location into lines (at eol), count them, and # look at the length of the last line in that. set prefix [string range $text 0 $location] set lines [split $prefix \n] set line [llength $lines] set col [string length [lindex $lines end]] return [list $line $col] } proc ::pt::util::Readables {msgs} { set cl {} set r {} foreach pe $msgs { switch -exact -- [lindex $pe 0] { t { # Fuse to multiple 't'-tags into a single 'cl'-tag. lappend cl [lindex $pe 1] } cl { # Fuse multiple 'cl'-tags into one. foreach c [split $details] { lappend cl $c } } default { lappend r [Readable $pe] } } } if {[set n [llength $cl]]} { if {$n > 1} { lappend r [Readable [list cl [join [lsort -dict $cl] {}]]] } else { lappend r [Readable [list t [lindex $cl 0]]] } } return [lsort -dict $r] } proc ::pt::util::Readable {pe} { set details [lassign $pe tag] switch -exact -- $tag { t { set details [quote string {*}$details] set m "The character '$details'" } n { set m "The symbol $details" } .. { set details [quote string {*}$details] set m "A character in range '[join $details '-']'" } str { set details [join [quote string {*}[split $details {}]] {}] set m "A string \"$details\"" } cl { set details [join [quote string {*}[split $details {}]] {}] set m "A character in set \{$details\}" } alpha { set m "A unicode alphabetical character" } alnum { set m "A unicode alphanumerical character" } ascii { set m "An ascii character" } digit { set m "A unicode digit character" } graph { set m "A unicode printing character, but not space" } lower { set m "A unicode lower-case alphabetical character" } print { set m "A unicode printing character, including space" } control { set m "A unicode control character" } punct { set m "A unicode punctuation character" } space { set m "A unicode space character" } upper { set m "A unicode upper-case alphabetical character" } wordchar { set m "A unicode word character (alphanumerics + connectors)" } xdigit { set m "A hexadecimal digit" } ddigit { set m "A decimal digit" } dot { set m "Any character" } default { set m [string totitle $tag] } } return $m } # # ## ### ##### ######## ############# ##################### ## Ready package provide pt::util 1 return |
Changes to modules/pt/rde_critcl/m.c.
︙ | ︙ | |||
15 16 17 18 19 20 21 | int param_AMARKED (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde amarked * [0] [1] */ | | | | | 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 | int param_AMARKED (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde amarked * [0] [1] */ long int mc, i; void** mv; Tcl_Obj** ov; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } rde_param_query_amark (p->p, &mc, &mv); ov = NALLOC (mc, Tcl_Obj*); for (i=0; i < mc; i++) { ov [i] = Tcl_NewIntObj ((long int) mv [i]); } Tcl_SetObjResult (interp, Tcl_NewListObj (mc, ov)); ckfree ((char*) ov); |
︙ | ︙ | |||
106 107 108 109 110 111 112 | return TCL_OK; } int param_COMPLETE (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { | > | < < < < | > > > > > > > > | > | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | return TCL_OK; } int param_COMPLETE (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* See also pt_cparam_config_critcl.tcl, COMPLETE(). * Syntax: rde complete * [0] [1] */ if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } if (rde_param_query_st (p->p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p->p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p->p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p->p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar consists of * only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p->p); Tcl_Obj* res = rde_param_query_er_tcl (p->p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } int param_CURRENT (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) |
︙ | ︙ | |||
270 271 272 273 274 275 276 | param_LMARKED (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde lmarked * [0] [1] */ long int lc, i; | | | | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | param_LMARKED (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde lmarked * [0] [1] */ long int lc, i; void** lv; Tcl_Obj** ov; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } rde_param_query_ls (p->p, &lc, &lv); ov = NALLOC (lc, Tcl_Obj*); for (i=0; i < lc; i++) { ov [i] = Tcl_NewIntObj ((long int) lv [i]); } Tcl_SetObjResult (interp, Tcl_NewListObj (lc, ov)); ckfree ((char*) ov); return TCL_OK; } |
︙ | ︙ | |||
393 394 395 396 397 398 399 | for(he = Tcl_FirstHashEntry(nc, &hs); he != NULL; he = Tcl_NextHashEntry(&hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; | | | | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | for(he = Tcl_FirstHashEntry(nc, &hs); he != NULL; he = Tcl_NextHashEntry(&hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; long int loc = (long int) Tcl_GetHashKey (nc, he); kv [0] = Tcl_NewIntObj (loc); tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { long int symid = (long int) Tcl_GetHashKey (tablePtr, hec); const char* sym = rde_param_query_string (p->p, symid); kv [1] = Tcl_NewStringObj (sym,-1); Tcl_ListObjAppendElement (interp, res, Tcl_NewListObj (2, kv)); } |
︙ | ︙ | |||
445 446 447 448 449 450 451 | for(he = Tcl_FirstHashEntry(nc, &hs); he != NULL; he = Tcl_NextHashEntry(&hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; | | | | 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | for(he = Tcl_FirstHashEntry(nc, &hs); he != NULL; he = Tcl_NextHashEntry(&hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; long int loc = (long int) Tcl_GetHashKey (nc, he); kv [0] = Tcl_NewIntObj (loc); tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); long int symid = (long int) Tcl_GetHashKey (tablePtr, hec); const char* sym = rde_param_query_string (p->p, symid); kv [1] = Tcl_NewStringObj (sym,-1); vv [0] = Tcl_NewIntObj (scs->CL); vv [1] = Tcl_NewIntObj (scs->ST); vv [2] = rde_param_query_er_tcl (p->p, scs->ER); |
︙ | ︙ | |||
722 723 724 725 726 727 728 | int param_I_er_nt (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_error_nonterminal SYMBOL * [0] [1] [2] */ | | | | 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 | int param_I_er_nt (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_error_nonterminal SYMBOL * [0] [1] [2] */ long int sym; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* * interning: n + space + symbol * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ sym = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, sym); return TCL_OK; } int param_I_er_popmerge (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) |
︙ | ︙ | |||
1079 1080 1081 1082 1083 1084 1085 | int param_I_symbol_restore (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_symbol_restore SYMBOL * [0] [1] [2] */ | > | | 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | int param_I_symbol_restore (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_symbol_restore SYMBOL * [0] [1] [2] */ long int sym; int found; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
1106 1107 1108 1109 1110 1111 1112 | int param_I_symbol_save (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_symbol_save SYMBOL * [0] [1] [2] */ | | | 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | int param_I_symbol_save (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_symbol_save SYMBOL * [0] [1] [2] */ long int sym; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
1140 1141 1142 1143 1144 1145 1146 | Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } if (!rde_param_query_st (p->p)) { rde_param_i_value_clear (p->p); } else { | | | 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } if (!rde_param_query_st (p->p)) { rde_param_i_value_clear (p->p); } else { long int sym; /* * We cannot save the interned string id in the Tcl_Obj*, because this * is already taken by the argument of param_I_er_nt aka * i_error_nonterminal, due to literal sharing in procedure bodies. */ |
︙ | ︙ | |||
1187 1188 1189 1190 1191 1192 1193 | Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } if (!rde_param_query_st (p->p)) { rde_param_i_value_clear (p->p); } else { | | | 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 | Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } if (!rde_param_query_st (p->p)) { rde_param_i_value_clear (p->p); } else { long int sym; /* * We cannot save the interned string id in the Tcl_Obj*, because this * is already taken by the argument of param_I_er_nt aka * i_error_nonterminal, due to literal sharing in procedure bodies. */ |
︙ | ︙ | |||
1209 1210 1211 1212 1213 1214 1215 | int param_I_input_next (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_input_next MSG * [0] [1] [2] */ | | | | 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 | int param_I_input_next (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_input_next MSG * [0] [1] [2] */ long int msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "msg"); return TCL_ERROR; } /* * interning: msg as is. Already has PE operator in the message. */ msg = rde_ot_intern0 (p, objv [2]); rde_param_i_input_next (p->p, msg); return TCL_OK; } int param_I_test_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) |
︙ | ︙ | |||
1280 1281 1282 1283 1284 1285 1286 | return TCL_OK; } int param_I_test_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { | | | > > > > > > > > > > > > > > > > > | 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 | return TCL_OK; } int param_I_test_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; char* ch; /* Syntax: rde i_test_char CHAR * [0] [1] [2] */ if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "tok"); return TCL_ERROR; } /* * interning: t + space + char */ ch = Tcl_GetString (objv [2]); msg = rde_ot_intern1 (p, "t", objv [2]); rde_param_i_test_char (p->p, ch, msg); return TCL_OK; } int param_I_test_control (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_test_control * [0] [1] */ if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } rde_param_i_test_control (p->p); return TCL_OK; } int param_I_test_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde i_test_ddigit |
︙ | ︙ | |||
1408 1409 1410 1411 1412 1413 1414 | return TCL_OK; } int param_I_test_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { | | | | | 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 | return TCL_OK; } int param_I_test_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; char* chs; char* che; /* Syntax: rde i_test_range START END * [0] [1] [2] [3] */ if (objc != 4) { Tcl_WrongNumArgs (interp, 2, objv, "toks toke"); return TCL_ERROR; } /* * interning: .. + space + char + space + char */ chs = Tcl_GetString (objv [2]); che = Tcl_GetString (objv [3]); msg = rde_ot_intern2 (p, "..", objv [2], objv[3]); rde_param_i_test_range (p->p, chs, che, msg); return TCL_OK; } int |
︙ | ︙ | |||
1755 1756 1757 1758 1759 1760 1761 | return TCL_OK; } int param_SI_next_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { | | | | | | | | 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 | return TCL_OK; } int param_SI_next_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; char* ch; /* Syntax: rde i_next_char CHAR * [0] [1] [2] */ if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "tok"); return TCL_ERROR; } /* * interning: t + space + char */ ch = Tcl_GetString (objv [2]); msg = rde_ot_intern1 (p, "t", objv [2]); rde_param_i_input_next (p->p, msg); if (rde_param_query_st (p->p)) { rde_param_i_test_char (p->p, ch, msg); } return TCL_OK; } int param_SI_next_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; char* chs; char* che; /* Syntax: rde i_next_range START END * [0] [1] [2] [3] */ if (objc != 4) { Tcl_WrongNumArgs (interp, 2, objv, "toks toke"); return TCL_ERROR; } /* * interning: .. + space + char + space + char */ chs = Tcl_GetString (objv [2]); che = Tcl_GetString (objv [3]); msg = rde_ot_intern2 (p, "..", objv [2], objv[3]); rde_param_i_input_next (p->p, msg); if (rde_param_query_st (p->p)) { rde_param_i_test_range (p->p, chs, che, msg); } return TCL_OK; } int param_SI_next_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_alnum * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "alnum"); |
︙ | ︙ | |||
1842 1843 1844 1845 1846 1847 1848 | int param_SI_next_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_alpha * [0] [1] */ | | | 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 | int param_SI_next_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_alpha * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "alpha"); |
︙ | ︙ | |||
1865 1866 1867 1868 1869 1870 1871 | int param_SI_next_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_ascii * [0] [1] */ | | > > > > > > > > > > > > > > > > > > > > > > > | | 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 | int param_SI_next_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_ascii * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "ascii"); rde_param_i_input_next (p->p, msg); if (rde_param_query_st (p->p)) { rde_param_i_test_ascii (p->p); } return TCL_OK; } int param_SI_next_control (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_control * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "control"); rde_param_i_input_next (p->p, msg); if (rde_param_query_st (p->p)) { rde_param_i_test_control (p->p); } return TCL_OK; } int param_SI_next_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_ddigit * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "ddigit"); |
︙ | ︙ | |||
1911 1912 1913 1914 1915 1916 1917 | int param_SI_next_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_digit * [0] [1] */ | | | 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 | int param_SI_next_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_digit * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "digit"); |
︙ | ︙ | |||
1934 1935 1936 1937 1938 1939 1940 | int param_SI_next_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_graph * [0] [1] */ | | | 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 | int param_SI_next_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_graph * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "graph"); |
︙ | ︙ | |||
1957 1958 1959 1960 1961 1962 1963 | int param_SI_next_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_lower * [0] [1] */ | | | 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 | int param_SI_next_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_lower * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "lower"); |
︙ | ︙ | |||
1980 1981 1982 1983 1984 1985 1986 | int param_SI_next_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_print * [0] [1] */ | | | 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 | int param_SI_next_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_print * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "print"); |
︙ | ︙ | |||
2003 2004 2005 2006 2007 2008 2009 | int param_SI_next_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_punct * [0] [1] */ | | | 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 | int param_SI_next_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_punct * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "punct"); |
︙ | ︙ | |||
2026 2027 2028 2029 2030 2031 2032 | int param_SI_next_space (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_space * [0] [1] */ | | | 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 | int param_SI_next_space (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_space * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "space"); |
︙ | ︙ | |||
2049 2050 2051 2052 2053 2054 2055 | int param_SI_next_upper (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_upper * [0] [1] */ | | | 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 | int param_SI_next_upper (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_upper * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "upper"); |
︙ | ︙ | |||
2072 2073 2074 2075 2076 2077 2078 | int param_SI_next_wordchar (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_wordchar * [0] [1] */ | | | 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 | int param_SI_next_wordchar (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_wordchar * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "wordchar"); |
︙ | ︙ | |||
2095 2096 2097 2098 2099 2100 2101 | int param_SI_next_xdigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_xdigit * [0] [1] */ | | | 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 | int param_SI_next_xdigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:next_xdigit * [0] [1] */ long int msg; if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } msg = param_intern (p, "xdigit"); |
︙ | ︙ | |||
2262 2263 2264 2265 2266 2267 2268 | int param_SI_value_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_symbol_start SYMBOL * [0] [1] [2] */ | > | | 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 | int param_SI_value_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_symbol_start SYMBOL * [0] [1] [2] */ long int sym; int found; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2297 2298 2299 2300 2301 2302 2303 | int param_SI_value_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_void_symbol_start SYMBOL * [0] [1] [2] */ | > | | 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 | int param_SI_value_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_void_symbol_start SYMBOL * [0] [1] [2] */ long int sym; int found; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2329 2330 2331 2332 2333 2334 2335 | int param_SI_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_symbol_start SYMBOL * [0] [1] [2] */ | > | | 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 | int param_SI_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_symbol_start SYMBOL * [0] [1] [2] */ long int sym; int found; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2363 2364 2365 2366 2367 2368 2369 | int param_SI_void_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_void_symbol_start SYMBOL * [0] [1] [2] */ | > | | 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 | int param_SI_void_void_symbol_start (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_void_symbol_start SYMBOL * [0] [1] [2] */ long int sym; int found; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2394 2395 2396 2397 2398 2399 2400 | int param_SI_reduce_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:reduce_symbol_end SYMBOL * [0] [1] [2] */ | | | 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 | int param_SI_reduce_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:reduce_symbol_end SYMBOL * [0] [1] [2] */ long int sym, msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2426 2427 2428 2429 2430 2431 2432 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ | | | | 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ msg = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, msg); rde_param_i_ast_pop_rewind (p->p); rde_param_i_loc_pop_discard (p->p); if (rde_param_query_st (p->p)) { rde_param_i_ast_value_push (p->p); } return TCL_OK; } int param_SI_void_leaf_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_leaf_symbol_end SYMBOL * [0] [1] [2] */ long int sym, msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2478 2479 2480 2481 2482 2483 2484 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ | | | | 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ msg = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, msg); rde_param_i_loc_pop_discard (p->p); if (rde_param_query_st (p->p)) { rde_param_i_ast_value_push (p->p); } return TCL_OK; } int param_SI_value_leaf_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_leaf_symbol_end SYMBOL * [0] [1] [2] */ long int sym, msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2529 2530 2531 2532 2533 2534 2535 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ | | | | 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ msg = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, msg); rde_param_i_ast_pop_rewind (p->p); rde_param_i_loc_pop_discard (p->p); if (rde_param_query_st (p->p)) { rde_param_i_ast_value_push (p->p); } return TCL_OK; } int param_SI_value_clear_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:value_clear_symbol_end SYMBOL * [0] [1] [2] */ long int sym, msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2576 2577 2578 2579 2580 2581 2582 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ | | | | 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ msg = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, msg); rde_param_i_ast_pop_rewind (p->p); rde_param_i_loc_pop_discard (p->p); return TCL_OK; } int param_SI_void_clear_symbol_end (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { /* Syntax: rde si:void_clear_symbol_end SYMBOL * [0] [1] [2] */ long int sym, msg; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "symbol"); return TCL_ERROR; } /* |
︙ | ︙ | |||
2619 2620 2621 2622 2623 2624 2625 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ | | > | | > | | | 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 | * * The obj literal here is very likely shared with the arguments of * i_symbol_save/restore, and i_value_leaf/reduce, and derivatives. This * here is the only point between these where we save the string id in the * Tcl_Obj*. */ msg = rde_ot_intern1 (p, "n", objv [2]); rde_param_i_error_nonterminal (p->p, msg); rde_param_i_loc_pop_discard (p->p); return TCL_OK; } int param_SI_next_str (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; int len, i; char* str; /* Syntax: rde i_next_char CHAR * [0] [1] [2] */ if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "tok"); return TCL_ERROR; } /* * interning: str + space + char */ str = Tcl_GetStringFromObj (objv [2], &len); msg = rde_ot_intern1 (p, "str", objv [2]); rde_param_i_next_str (p->p, str, msg); return TCL_OK; } int param_SI_next_class (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { long int msg; int len, i; char* class; /* Syntax: rde i_next_char CHAR * [0] [1] [2] */ if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "tok"); return TCL_ERROR; } /* * interning: cl + space + char */ class = Tcl_GetStringFromObj (objv [2], &len); msg = rde_ot_intern1 (p, "cl", objv [2]); rde_param_i_next_class (p->p, class, msg); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to modules/pt/rde_critcl/m.h.
︙ | ︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | int param_I_input_next (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); | > | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | int param_I_input_next (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_control (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_I_test_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); |
︙ | ︙ | |||
101 102 103 104 105 106 107 108 109 110 111 112 113 114 | int param_SI_valuevalue_part (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_space (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); | > | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | int param_SI_valuevalue_part (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_char (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_range (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_alnum (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_alpha (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_ascii (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_control (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_ddigit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_digit (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_graph (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_lower (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_print (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_punct (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); int param_SI_next_space (RDE_STATE p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv); |
︙ | ︙ |
Changes to modules/pt/rde_critcl/ms.c.
︙ | ︙ | |||
42 43 44 45 46 47 48 | "i_error_clear","i_error_nonterminal", "i_error_pop_merge", "i_error_push", "i:fail_loc_pop_rewind", "i_loc_pop_discard", "i_loc_pop_rewind/discard", "i_loc_pop_rewind", "i_loc_push", "i:fail_ast_pop_rewind", "i_ast_pop_discard", "i_ast_pop_discard/rewind", "i_ast_pop_rewind/discard", "i_ast_pop_rewind", "i_ast_push", "i:ok_ast_value_push", "i_symbol_restore", "i_symbol_save", "i_value_clear/leaf", "i_value_clear", "i_value_clear/reduce", | | | | 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 70 71 72 73 74 75 76 | "i_error_clear","i_error_nonterminal", "i_error_pop_merge", "i_error_push", "i:fail_loc_pop_rewind", "i_loc_pop_discard", "i_loc_pop_rewind/discard", "i_loc_pop_rewind", "i_loc_push", "i:fail_ast_pop_rewind", "i_ast_pop_discard", "i_ast_pop_discard/rewind", "i_ast_pop_rewind/discard", "i_ast_pop_rewind", "i_ast_push", "i:ok_ast_value_push", "i_symbol_restore", "i_symbol_save", "i_value_clear/leaf", "i_value_clear", "i_value_clear/reduce", "i_input_next", "i_test_alnum", "i_test_alpha", "i_test_ascii", "i_test_char", "i_test_control", "i_test_ddigit","i_test_digit", "i_test_graph", "i_test_lower", "i_test_print", "i_test_punct", "i_test_range", "i_test_space", "i_test_upper", "i_test_wordchar", "i_test_xdigit", "i:ok_ast_pop_discard", "i_ast_rewind", "i:ok_loc_pop_discard", "i_loc_rewind", "i_error_clear_push", "si:void_state_push", "si:value_state_push", "si:void_state_merge", "si:value_state_merge", "si:voidvoid_branch", "si:voidvalue_branch", "si:valuevoid_branch", "si:valuevalue_branch", "si:voidvoid_part", "si:voidvalue_part", "si:valuevalue_part", "si:next_char", "si:next_range", "si:next_alnum", "si:next_alpha", "si:next_ascii", "si:next_control", "si:next_ddigit","si:next_digit", "si:next_graph", "si:next_lower", "si:next_print", "si:next_punct", "si:next_space", "si:next_upper", "si:next_wordchar", "si:next_xdigit", "si:void2_state_push", "si:void_state_merge_ok", "si:value_notahead_start", |
︙ | ︙ | |||
100 101 102 103 104 105 106 | M_VALUE, M_F_continue, M_F_return, M_O_continue, M_O_return, M_I_st_fail, M_I_st_neg, M_I_st_ok, M_I_er_clear, M_I_er_nt, M_I_er_popmerge, M_I_er_push, M_F_loc_pop_rewind, M_I_loc_pop_discard, M_I_loc_pop_rewdis, M_I_loc_pop_rewind, M_I_loc_push, M_F_ast_pop_rewind, M_I_ast_pop_discard, M_I_ast_pop_disrew, M_I_ast_pop_rewdis, M_I_ast_pop_rewind, M_I_ast_push, M_O_ast_value_push, M_I_symbol_restore, M_I_symbol_save, M_I_value_cleaf, M_I_value_clear, M_I_value_creduce, | | | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | M_VALUE, M_F_continue, M_F_return, M_O_continue, M_O_return, M_I_st_fail, M_I_st_neg, M_I_st_ok, M_I_er_clear, M_I_er_nt, M_I_er_popmerge, M_I_er_push, M_F_loc_pop_rewind, M_I_loc_pop_discard, M_I_loc_pop_rewdis, M_I_loc_pop_rewind, M_I_loc_push, M_F_ast_pop_rewind, M_I_ast_pop_discard, M_I_ast_pop_disrew, M_I_ast_pop_rewdis, M_I_ast_pop_rewind, M_I_ast_push, M_O_ast_value_push, M_I_symbol_restore, M_I_symbol_save, M_I_value_cleaf, M_I_value_clear, M_I_value_creduce, M_I_input_next, M_I_test_alnum, M_I_test_alpha, M_I_test_ascii, M_I_test_char, M_I_test_control, M_I_test_ddigit, M_I_test_digit, M_I_test_graph, M_I_test_lower, M_I_test_print, M_I_test_punct, M_I_test_range, M_I_test_space, M_I_test_upper, M_I_test_wordchar, M_I_test_xdigit, M_O_ast_pop_discard, M_I_ast_rewind, M_O_loc_pop_discard, |
︙ | ︙ | |||
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | M_SI_valuevalue_part, M_SI_next_char, M_SI_next_range, M_SI_next_alnum, M_SI_next_alpha, M_SI_next_ascii, M_SI_next_ddigit, M_SI_next_digit, M_SI_next_graph, M_SI_next_lower, M_SI_next_print, M_SI_next_punct, M_SI_next_space, | > | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | M_SI_valuevalue_part, M_SI_next_char, M_SI_next_range, M_SI_next_alnum, M_SI_next_alpha, M_SI_next_ascii, M_SI_next_control, M_SI_next_ddigit, M_SI_next_digit, M_SI_next_graph, M_SI_next_lower, M_SI_next_print, M_SI_next_punct, M_SI_next_space, |
︙ | ︙ | |||
233 234 235 236 237 238 239 240 241 242 243 244 245 246 | case M_I_value_clear: res = param_I_value_clear (p, interp, objc, objv); break; case M_I_value_creduce: res = param_I_value_creduce (p, interp, objc, objv); break; case M_I_input_next: res = param_I_input_next (p, interp, objc, objv); break; case M_I_test_alnum: res = param_I_test_alnum (p, interp, objc, objv); break; case M_I_test_alpha: res = param_I_test_alpha (p, interp, objc, objv); break; case M_I_test_ascii: res = param_I_test_ascii (p, interp, objc, objv); break; case M_I_test_char: res = param_I_test_char (p, interp, objc, objv); break; case M_I_test_ddigit: res = param_I_test_ddigit (p, interp, objc, objv); break; case M_I_test_digit: res = param_I_test_digit (p, interp, objc, objv); break; case M_I_test_graph: res = param_I_test_graph (p, interp, objc, objv); break; case M_I_test_lower: res = param_I_test_lower (p, interp, objc, objv); break; case M_I_test_print: res = param_I_test_print (p, interp, objc, objv); break; case M_I_test_punct: res = param_I_test_punct (p, interp, objc, objv); break; case M_I_test_range: res = param_I_test_range (p, interp, objc, objv); break; | > | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | case M_I_value_clear: res = param_I_value_clear (p, interp, objc, objv); break; case M_I_value_creduce: res = param_I_value_creduce (p, interp, objc, objv); break; case M_I_input_next: res = param_I_input_next (p, interp, objc, objv); break; case M_I_test_alnum: res = param_I_test_alnum (p, interp, objc, objv); break; case M_I_test_alpha: res = param_I_test_alpha (p, interp, objc, objv); break; case M_I_test_ascii: res = param_I_test_ascii (p, interp, objc, objv); break; case M_I_test_char: res = param_I_test_char (p, interp, objc, objv); break; case M_I_test_control: res = param_I_test_control (p, interp, objc, objv); break; case M_I_test_ddigit: res = param_I_test_ddigit (p, interp, objc, objv); break; case M_I_test_digit: res = param_I_test_digit (p, interp, objc, objv); break; case M_I_test_graph: res = param_I_test_graph (p, interp, objc, objv); break; case M_I_test_lower: res = param_I_test_lower (p, interp, objc, objv); break; case M_I_test_print: res = param_I_test_print (p, interp, objc, objv); break; case M_I_test_punct: res = param_I_test_punct (p, interp, objc, objv); break; case M_I_test_range: res = param_I_test_range (p, interp, objc, objv); break; |
︙ | ︙ | |||
262 263 264 265 266 267 268 269 270 271 272 273 274 275 | case M_SI_valuevalue_part: res = param_SI_valuevalue_part (p, interp, objc, objv); break; case M_SI_next_char: res = param_SI_next_char (p, interp, objc, objv); break; case M_SI_next_range: res = param_SI_next_range (p, interp, objc, objv); break; case M_SI_next_alnum: res = param_SI_next_alnum (p, interp, objc, objv); break; case M_SI_next_alpha: res = param_SI_next_alpha (p, interp, objc, objv); break; case M_SI_next_ascii: res = param_SI_next_ascii (p, interp, objc, objv); break; case M_SI_next_ddigit: res = param_SI_next_ddigit (p, interp, objc, objv); break; case M_SI_next_digit: res = param_SI_next_digit (p, interp, objc, objv); break; case M_SI_next_graph: res = param_SI_next_graph (p, interp, objc, objv); break; case M_SI_next_lower: res = param_SI_next_lower (p, interp, objc, objv); break; case M_SI_next_print: res = param_SI_next_print (p, interp, objc, objv); break; case M_SI_next_punct: res = param_SI_next_punct (p, interp, objc, objv); break; case M_SI_next_space: res = param_SI_next_space (p, interp, objc, objv); break; | > | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | case M_SI_valuevalue_part: res = param_SI_valuevalue_part (p, interp, objc, objv); break; case M_SI_next_char: res = param_SI_next_char (p, interp, objc, objv); break; case M_SI_next_range: res = param_SI_next_range (p, interp, objc, objv); break; case M_SI_next_alnum: res = param_SI_next_alnum (p, interp, objc, objv); break; case M_SI_next_alpha: res = param_SI_next_alpha (p, interp, objc, objv); break; case M_SI_next_ascii: res = param_SI_next_ascii (p, interp, objc, objv); break; case M_SI_next_control: res = param_SI_next_control (p, interp, objc, objv); break; case M_SI_next_ddigit: res = param_SI_next_ddigit (p, interp, objc, objv); break; case M_SI_next_digit: res = param_SI_next_digit (p, interp, objc, objv); break; case M_SI_next_graph: res = param_SI_next_graph (p, interp, objc, objv); break; case M_SI_next_lower: res = param_SI_next_lower (p, interp, objc, objv); break; case M_SI_next_print: res = param_SI_next_print (p, interp, objc, objv); break; case M_SI_next_punct: res = param_SI_next_punct (p, interp, objc, objv); break; case M_SI_next_space: res = param_SI_next_space (p, interp, objc, objv); break; |
︙ | ︙ |
Changes to modules/pt/rde_critcl/ot.c.
︙ | ︙ | |||
21 22 23 24 25 26 27 | static Tcl_ObjType ot_type = { "tcllib/pt::rde/critcl", ot_free_rep, ot_dup_rep, ot_string_rep, ot_from_any }; | | > > > > | > > > > | > > > > | > > > > > > > > > | > | > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | < | < | < < < < < < < < < < | < < < | < < < < < < | < | < < | < < < < < < | < | < < < < < < < < < < > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | static Tcl_ObjType ot_type = { "tcllib/pt::rde/critcl", ot_free_rep, ot_dup_rep, ot_string_rep, ot_from_any }; static int IsCached (RDE_STATE p, Tcl_Obj* obj, long int* id); static long int Make (RDE_STATE p, Tcl_Obj* obj, const char* str); /* * = = == === ===== ======== ============= ===================== */ long int rde_ot_intern0 (RDE_STATE p, Tcl_Obj* detail) { long int id; TRACE (("rde_ot_intern0 (%p, %p = '%s')", p, detail, Tcl_GetString(detail))); if (IsCached (p, detail, &id)) { return id; } TRACE (("INTERNALIZE")); return Make (p, detail, Tcl_GetString (detail)); } long int rde_ot_intern1 (RDE_STATE p, const char* operator, Tcl_Obj* detail) { long int id; Tcl_DString buf; TRACE (("rde_ot_intern1 (%p, '%s' %p = '%s')", p, operator, detail, Tcl_GetString(detail))); if (IsCached (p, detail, &id)) { return id; } TRACE (("INTERNALIZE")); /* Create a list of operator + detail. * Using a DString. */ Tcl_DStringInit (&buf); Tcl_DStringAppendElement (&buf, operator); Tcl_DStringAppendElement (&buf, Tcl_GetString (detail)); id = Make (p, detail, Tcl_DStringValue (&buf)); Tcl_DStringFree (&buf); return id; } long int rde_ot_intern2 (RDE_STATE p, const char* operator, Tcl_Obj* detail1, Tcl_Obj* detail2) { long int id; Tcl_DString buf; TRACE (("rde_ot_intern2 (%p, '%s' %p = '%s', %p = '%s')", p, operator, detail1, Tcl_GetString(detail1) detail2, Tcl_GetString(detail2))); if (IsCached (p, detail1, &id)) { return id; } TRACE (("INTERNALIZE")); /* Create a list of operator + detail1 + detail2. * Using a DString. */ Tcl_DStringInit (&buf); Tcl_DStringAppendElement (&buf, operator); Tcl_DStringAppendElement (&buf, Tcl_GetString (detail1)); Tcl_DStringAppendElement (&buf, Tcl_GetString (detail2)); id = Make (p, detail1, Tcl_DStringValue (&buf)); Tcl_DStringFree (&buf); return id; } /* * = = == === ===== ======== ============= ===================== */ static int IsCached (RDE_STATE p, Tcl_Obj* obj, long int* id) { /* * Quick exit if we have a cached and valid value. */ if ((obj->typePtr == &ot_type) && (obj->internalRep.twoPtrValue.ptr1 == p)) { RDE_STRING* rs = (RDE_STRING*) obj->internalRep.twoPtrValue.ptr2; TRACE (("CACHED %p = %d", rs, rs->id)); *id = rs->id; return 1; } return 0; } static long int Make (RDE_STATE p, Tcl_Obj* obj, const char* str) { long int id = param_intern (p, str); RDE_STRING* rs = ALLOC (RDE_STRING); rs->next = p->sfirst; rs->self = obj; rs->id = id; p->sfirst = rs; /* Invalidate previous int.rep before setting our own. * Inlined copy of TclFreeIntRep() macro (tclInt.h) */ if ((obj)->typePtr && (obj)->typePtr->freeIntRepProc) { (obj)->typePtr->freeIntRepProc(obj); } obj->internalRep.twoPtrValue.ptr1 = p; obj->internalRep.twoPtrValue.ptr2 = rs; obj->typePtr = &ot_type; return id; } |
︙ | ︙ | |||
129 130 131 132 133 134 135 | RDE_STRING* iter = p->sfirst; while (iter->next != rs) { iter = iter->next; } iter->next = rs->next; } | | > > | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | RDE_STRING* iter = p->sfirst; while (iter->next != rs) { iter = iter->next; } iter->next = rs->next; } /* Drop the now un-tracked structure */ ckfree ((char*) rs); /* Nothing to release in the obj itself, just resetting references. */ obj->internalRep.twoPtrValue.ptr1 = NULL; obj->internalRep.twoPtrValue.ptr2 = NULL; } static void ot_dup_rep(Tcl_Obj* obj, Tcl_Obj* dup) { |
︙ | ︙ |
Changes to modules/pt/rde_critcl/ot.h.
1 2 3 4 5 6 7 8 9 10 11 | /* * = = == === ===== ======== ============= ===================== * == pt::rde (critcl) - Data Structures - ObjType for interned strings. */ #ifndef _RDE_DS_OT_H #define _RDE_DS_OT_H 1 #include "tcl.h" #include <p.h> /* State declarations */ | | > > > > > > > > > > | 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 | /* * = = == === ===== ======== ============= ===================== * == pt::rde (critcl) - Data Structures - ObjType for interned strings. */ #ifndef _RDE_DS_OT_H #define _RDE_DS_OT_H 1 #include "tcl.h" #include <p.h> /* State declarations */ long int rde_ot_intern0 (RDE_STATE p, Tcl_Obj* detail); long int rde_ot_intern1 (RDE_STATE p, const char* operator, Tcl_Obj* detail); long int rde_ot_intern2 (RDE_STATE p, const char* operator, Tcl_Obj* detail1, Tcl_Obj* detail2); #endif /* _RDE_DS_OT_H */ /* * Local Variables: * mode: c * c-basic-offset: 4 |
︙ | ︙ |
Changes to modules/pt/rde_critcl/p.c.
︙ | ︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | Tcl_InitHashTable (&p->str, TCL_STRING_KEYS); p->p = rde_param_new (p->numstr, p->string); /* * Fixed elements of the string table, as needed by the lower level PARAM * functions (class tests, see param.c, enum test_class). * * Maybe move the interning into the lower level, i.e. PARAM ? */ param_intern (p, "alnum"); param_intern (p, "alpha"); param_intern (p, "ascii"); param_intern (p, "ddigit"); param_intern (p, "digit"); param_intern (p, "graph"); param_intern (p, "lower"); | > > > | | 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 | Tcl_InitHashTable (&p->str, TCL_STRING_KEYS); p->p = rde_param_new (p->numstr, p->string); /* * Fixed elements of the string table, as needed by the lower level PARAM * functions (class tests, see param.c, enum test_class). * Further pt_peg_to_cparam.tcl, [::pt::peg::to::cparam::convert] * ** Keep in sync ** * * Maybe move the interning into the lower level, i.e. PARAM ? */ param_intern (p, "alnum"); param_intern (p, "alpha"); param_intern (p, "ascii"); param_intern (p, "control"); param_intern (p, "ddigit"); param_intern (p, "digit"); param_intern (p, "graph"); param_intern (p, "lower"); param_intern (p, "print"); param_intern (p, "punct"); param_intern (p, "space"); param_intern (p, "upper"); param_intern (p, "wordchar"); param_intern (p, "xdigit"); RETURN ("%p",p); |
︙ | ︙ | |||
105 106 107 108 109 110 111 | TRACE (("Tcl_Command %p",c)); p->c = c; RETURNVOID; } | | | > | | | | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | TRACE (("Tcl_Command %p",c)); p->c = c; RETURNVOID; } long int param_intern (RDE_STATE p, const char* literal) { long int res; int isnew; Tcl_HashEntry* hPtr; ENTER ("param_intern"); TRACE (("RDE_STATE %p",p)); TRACE (("CHAR* '%s'",literal)); hPtr = Tcl_FindHashEntry (&p->str, literal); if (hPtr) { res = (long int) Tcl_GetHashValue (hPtr); RETURN("CACHED %d",res); } hPtr = Tcl_CreateHashEntry(&p->str, literal, &isnew); ASSERT (isnew, "Should have found entry"); Tcl_SetHashValue (hPtr, p->numstr); if (p->numstr >= p->maxnum) { long int new; char** str; new = 2 * (p->maxnum ? p->maxnum : 8); TRACE (("extend to %d strings",new)); str = (char**) ckrealloc ((char*) p->string, new * sizeof(char*)); ASSERT (str,"Memory allocation failure for string table"); p->maxnum = new; |
︙ | ︙ |
Changes to modules/pt/rde_critcl/pInt.h.
︙ | ︙ | |||
24 25 26 27 28 29 30 | Tcl_HashTable str; /* Table to intern strings, i.e. convert them into * unique numerical indices for the PARAM instructions. */ /* And the counter mapping from ids to strings, this is handed to the * PARAM for use. */ | | | | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | Tcl_HashTable str; /* Table to intern strings, i.e. convert them into * unique numerical indices for the PARAM instructions. */ /* And the counter mapping from ids to strings, this is handed to the * PARAM for use. */ long int maxnum; /* NOTE -- */ long int numstr; /* This is, essentially, an RDE_STACK (char* elements) */ char** string; /* Convert over to that instead of replicating the code */ #ifdef RDE_TRACE int icount; /* Instruction counter, when tracing */ #endif } RDE_STATE_; long int param_intern (RDE_STATE p, const char* literal); #endif /* _P_H */ /* * Local Variables: * mode: c * c-basic-offset: 4 |
︙ | ︙ |
Changes to modules/pt/rde_critcl/param.c.
︙ | ︙ | |||
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; /* * = = == === ===== ======== ============= ===================== */ static void ast_node_free (void* n); static void error_state_free (void* es); | > > > > | | 58 59 60 61 62 63 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 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); /* See also p.c, param_new(), table of param_intern() calls. * ** Keep in sync ** */ typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; /* * = = == === ===== ======== ============= ===================== */ static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); |
︙ | ︙ | |||
295 296 297 298 299 300 301 | SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } |
︙ | ︙ | |||
348 349 350 351 352 353 354 | * quick return. */ res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | | | | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | * quick return. */ res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); /* * Note: We are peeking inside the (message) stack here and are * modifying it in place. This doesn't matter, we are using the stack * code for convenience, not for the ordering. */ qsort (mv, mc, sizeof (void*), er_int_compare); /* * Convert message ids to strings. We ignore duplicates, by comparing * to the last processed id. Here the sorting (see above) comes into * play, we know that duplicates are bunched together in runs, making * it easy to drop them. */ mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; /* inlined query_string */ ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } /* |
︙ | ︙ | |||
407 408 409 410 411 412 413 | SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void | | | > > > > > > | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } |
︙ | ︙ | |||
472 473 474 475 476 477 478 | { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } |
︙ | ︙ | |||
537 538 539 540 541 542 543 | SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > > > > > > > | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { /* * Disabled. Generate only low-level errors until we have worked out how * to integrate symbol information with them. Do not forget where this * instruction is inlined - No such exist, places using the instruction * directly call on this function. */ return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
636 637 638 639 640 641 642 | rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); |
︙ | ︙ | |||
698 699 700 701 702 703 704 | } /* * = = == === ===== ======== ============= ===================== */ SCOPE void | | | > > > | | 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 | } /* * = = == === ===== ======== ============= ===================== */ SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { /* * We are at a known position, we can and do take the associated * character out of the token cache. * * FUTURE :: keep track of what location the data stored in CC is * for. If the location is identical no extraction is required. This * may help when a choice repeatedly tests the same character. */ rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); /* Note: BOUNDS(n) <=> [0..(n-1)]. * cc_len in [1..utfmax] <=> cc_len-1 in [0...utfmax-1] <=> BOUNDS(utfmax) */ ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || |
︙ | ︙ | |||
780 781 782 783 784 785 786 | } /* * = = == === ===== ======== ============= ===================== */ SCOPE int | | | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | } /* * = = == === ===== ======== ============= ===================== */ SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; /* * 2-level hash table keyed by location, and symbol ... |
︙ | ︙ | |||
819 820 821 822 823 824 825 | SV_SET (p, scs->SV); return 1; } SCOPE void | | | 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; |
︙ | ︙ | |||
917 918 919 920 921 922 923 | SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > > | | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 | SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
968 969 970 971 972 973 974 | SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 | SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); |
︙ | ︙ | |||
1059 1060 1061 1062 1063 1064 1065 | SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 | SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; |
︙ | ︙ | |||
1125 1126 1127 1128 1129 1130 1131 | /* * = = == === ===== ======== ============= ===================== */ static int er_int_compare (const void* a, const void* b) { | > > > > | > > | > > | | | | | | | | | | | | | | | | > > > > > > > > | | | | | | | | | | | 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 | /* * = = == === ===== ======== ============= ===================== */ static int er_int_compare (const void* a, const void* b) { /* a, b = pointers to element, as void*. * Actual element type is (void*), and * actually stored data is (long int). */ const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } /* * = = == === ===== ======== ============= ===================== * == Super Instructions. */ SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } /* * = = == === ===== ======== ============= ===================== */ SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void |
︙ | ︙ | |||
1489 1490 1491 1492 1493 1494 1495 | SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 | SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } /* |
︙ | ︙ | |||
1578 1579 1580 1581 1582 1583 1584 | rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 | rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } |
︙ | ︙ | |||
1636 1637 1638 1639 1640 1641 1642 | if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > > > > > > > > > > | | 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 | if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } /* * = = == === ===== ======== ============= ===================== */ SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; /* Future: Place match string into a shared table of constants, like error * messages, indexed by code. Precomputed length information. * * NOTE how we are modifying the error location after the fact. The * message contains the entire string, so the location should be the * start of the string in the input, not somewhere in the middle. This * matches the Tcl runtimes. Here we have to adjust the stored location * due to our progress through the pattern. */ while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; |
︙ | ︙ |
Changes to modules/pt/rde_critcl/param.h.
︙ | ︙ | |||
41 42 43 44 45 46 47 | SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len); SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData); /* Accessors */ SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p); | | | > | | | | | | > | | | | | | | | | | | | | | | | > | | | | | | | | | | | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len); SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData); /* Accessors */ SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p); SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv); SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av); SCOPE const char* rde_param_query_in (RDE_PARAM p); SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len); SCOPE int rde_param_query_cl (RDE_PARAM p); SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p); SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er); SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev); SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv); SCOPE long int rde_param_query_lstop (RDE_PARAM p); SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p); SCOPE int rde_param_query_st (RDE_PARAM p); SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p); SCOPE long int rde_param_query_tc_size (RDE_PARAM p); SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len); SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id); /* Instructions */ SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p); SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p); SCOPE void rde_param_i_ast_push (RDE_PARAM p); SCOPE void rde_param_i_ast_rewind (RDE_PARAM p); SCOPE void rde_param_i_ast_value_push (RDE_PARAM p); SCOPE void rde_param_i_error_clear (RDE_PARAM p); SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s); SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p); SCOPE void rde_param_i_error_push (RDE_PARAM p); SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p); SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p); SCOPE void rde_param_i_loc_push (RDE_PARAM p); SCOPE void rde_param_i_loc_rewind (RDE_PARAM p); SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m); SCOPE void rde_param_i_status_fail (RDE_PARAM p); SCOPE void rde_param_i_status_ok (RDE_PARAM p); SCOPE void rde_param_i_status_negate (RDE_PARAM p); SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s); SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s); SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int m); SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int m); SCOPE void rde_param_i_test_alnum (RDE_PARAM p); SCOPE void rde_param_i_test_alpha (RDE_PARAM p); SCOPE void rde_param_i_test_ascii (RDE_PARAM p); SCOPE void rde_param_i_test_control (RDE_PARAM p); SCOPE void rde_param_i_test_ddigit (RDE_PARAM p); SCOPE void rde_param_i_test_digit (RDE_PARAM p); SCOPE void rde_param_i_test_graph (RDE_PARAM p); SCOPE void rde_param_i_test_lower (RDE_PARAM p); SCOPE void rde_param_i_test_print (RDE_PARAM p); SCOPE void rde_param_i_test_punct (RDE_PARAM p); SCOPE void rde_param_i_test_space (RDE_PARAM p); SCOPE void rde_param_i_test_upper (RDE_PARAM p); SCOPE void rde_param_i_test_wordchar (RDE_PARAM p); SCOPE void rde_param_i_test_xdigit (RDE_PARAM p); SCOPE void rde_param_i_value_clear (RDE_PARAM p); SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s); SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s); /* Super Instructions - Aggregated common instruction sequences. */ SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s); SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s); SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s); SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s); SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m); SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m); SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m); SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m); SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m); SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m); SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m); SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m); SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m); SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p); SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p); SCOPE void rde_param_i_notahead_exit (RDE_PARAM p); SCOPE void rde_param_i_state_push_2 (RDE_PARAM p); SCOPE void rde_param_i_state_push_void (RDE_PARAM p); |
︙ | ︙ | |||
161 162 163 164 165 166 167 | SCOPE int rde_param_i_seq_value2value (RDE_PARAM p); SCOPE int rde_param_i_bra_void2void (RDE_PARAM p); SCOPE int rde_param_i_bra_void2value (RDE_PARAM p); SCOPE int rde_param_i_bra_value2void (RDE_PARAM p); SCOPE int rde_param_i_bra_value2value (RDE_PARAM p); | | | | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | SCOPE int rde_param_i_seq_value2value (RDE_PARAM p); SCOPE int rde_param_i_bra_void2void (RDE_PARAM p); SCOPE int rde_param_i_bra_void2value (RDE_PARAM p); SCOPE int rde_param_i_bra_value2void (RDE_PARAM p); SCOPE int rde_param_i_bra_value2value (RDE_PARAM p); SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m); SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m); /* SKIP END */ #endif /* _RDE_DS_PARAM_H */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to modules/pt/rde_critcl/tc.c.
︙ | ︙ | |||
68 69 70 71 72 73 74 75 76 77 78 79 80 81 | char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } /* * Extend character buffer to hold the new string, and copy the string in. */ if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); | > > > > > > > > | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } /* * Nothing to append, nothing to do. Bail immediately. */ if (!len) { return tc->str + base; } /* * Extend character buffer to hold the new string, and copy the string in. */ if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); |
︙ | ︙ | |||
111 112 113 114 115 116 117 | return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); |
︙ | ︙ |
Added modules/pt/tests/char.tests.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | # -*- tcl -*- # Testsuite for char. # Called by the ../char.test driver file. test char-1.0 {char, wrong#args} -body { char } -returnCodes error \ -result {wrong # args: should be "char subcommand ?argument ...?"} test char-1.1 {char, bogus method} -body { char bogus } -returnCodes error \ -result {unknown or ambiguous subcommand "bogus": must be quote, or unquote} test char-1.2 {char, wrong#args} -body { char quote } -returnCodes error \ -result {wrong # args: should be "char quote subcommand ?argument ...?"} test char-1.3 {char, bogus method} -body { char quote bogus } -returnCodes error \ -result {unknown or ambiguous subcommand "bogus": must be comment, cstring, string, or tcl} #---------------------------------------------------------------------- test char-2.0 {char tcl, wrong#args} -body { char quote tcl } -returnCodes error -result {wrong # args: should be "char quote tcl ch ..."} test char-2.1 {char tcl, single char} -body { char quote tcl A } -result A test char-2.2 {char tcl, multi char} -body { char quote tcl A B } -result {A B} foreach {n label input expected} { 0 obrace \{ \\173 1 obrckt \[ \\133 2 dquote \" \\42 3 escape \033 \\33 4 lf \n \\n 5 space { } \\40 6 backslash \\ \\134 7 A A A 8 del \177 \\177 9 circast \u229b \\u229b } { test char-2.3.$n "char tcl, map $label" -body { char quote tcl $input } -result $expected # collect table columns for string and multi-arg tests. lappend ll $label lappend li $input lappend le $expected } test char-2.4 "char tcl, map string" -body { char quote tcl [join $li {}] } -result [join $le {}] test char-2.5 "char tcl, map multiple" -body { char quote tcl {*}$li } -result $le unset -nocomplain n label input expected ll li le #---------------------------------------------------------------------- test char-3.0 {char string, wrong#args} -body { char quote string } -returnCodes error -result {wrong # args: should be "char quote string ch ..."} test char-3.1 {char string, single char} -body { char quote string A } -result A test char-3.2 {char string, multi char} -body { char quote string A B } -result {A B} foreach {n label input expected} { 0 obrace \{ \{ 1 obrckt \[ \[ 2 dquote \" \" 3 escape \033 <ESC> 4 lf \n <LF> 5 space { } <SPACE> 6 backslash \\ \\ 7 A A A 8 del \177 <DEL> 9 circast \u229b \u229b } { test char-3.3.$n "char string, map $label" -body { char quote string $input } -result $expected # collect table columns for string and multi-arg tests. lappend ll $label lappend li $input lappend le $expected } test char-3.4 "char string, map string" -body { char quote string [join $li {}] } -result [join $le {}] test char-3.5 "char string, map multiple" -body { char quote string {*}$li } -result $le unset -nocomplain n label input expected ll li le #---------------------------------------------------------------------- test char-4.0 {char cstring, wrong#args} -body { char quote cstring } -returnCodes error -result {wrong # args: should be "char quote cstring ch ..."} test char-4.1 {char cstring, single char} -body { char quote cstring A } -result A test char-4.2 {char cstring, multi char} -body { char quote cstring A B } -result {A B} foreach {n label input expected} { 0 obrace \{ \\173 1 obrckt \[ \[ 2 dquote \" \\\" 3 escape \033 \\33 4 lf \n \\n 5 space { } { } 6 backslash \\ \\\\ 7 A A A 8 del \177 \\177 9 circast \u229b \\342\\212\\233 } { test char-4.3.$n "char cstring, map $label" -body { char quote cstring $input } -result $expected # collect table columns for string and multi-arg tests. lappend ll $label lappend li $input lappend le $expected } test char-4.4 "char cstring, map string" -body { char quote cstring [join $li {}] } -result [join $le {}] test char-4.5 "char cstring, map multiple" -body { char quote cstring {*}$li } -result $le unset -nocomplain n label input expected ll li le #---------------------------------------------------------------------- test char-5.0 {char comment, wrong#args} -body { char quote comment } -returnCodes error -result {wrong # args: should be "char quote comment ch ..."} test char-5.1 {char comment, single char} -body { char quote comment A } -result A test char-5.2 {char comment, multi char} -body { char quote comment A B } -result {A B} foreach {n label input expected} { 0 obrace \{ \\\{ 1 obrckt \[ \[ 2 dquote \" \\\" 3 escape \033 \\33 4 lf \n \\n 5 space { } <blank> 6 backslash \\ \\ 7 A A A 8 del \177 \\177 9 circast \u229b \\u229b } { test char-5.3.$n "char comment, map $label" -body { char quote comment $input } -result $expected # collect table columns for string and multi-arg tests. lappend ll $label lappend li $input lappend le $expected } test char-5.4 "char comment, map string" -body { char quote comment [join $li {}] } -result [join $le {}] test char-5.5 "char comment, map multiple" -body { char quote comment {*}$li } -result $le unset -nocomplain n label input expected ll li le #---------------------------------------------------------------------- return |
Changes to modules/pt/tests/common.
1 2 3 | # -*- tcl -*- # Code common to the various control files. # | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 67 68 69 70 71 72 73 74 75 | # -*- tcl -*- # Code common to the various control files. # # Copyright (c) 2009-2014 by Andreas Kupries <[email protected]> # All rights reserved. # # RCS: @(#) $Id: common,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ # ------------------------------------------------------------------------- # Similar to TestFiles in devtools/testutilities.tcl, but not # identical. Here we do not expect source'able test suites, but data # files, organized in sections under a main directory. proc TestFilesProcess {maindir section inset outset -> nv lv iv dv ev script {optionalok 0}} { upvar 1 $nv n $lv label $dv data $ev expected $iv inputfile set pattern $maindir/$section/$inset/* set files [TestFilesGlob $pattern] if {![llength $files]} { if {$optionalok} return return -code error "No files matching \"$pattern\"" } foreach src $files { if {[string match *README* $src]} continue if {[file isdirectory $src]} continue set srcname [file tail $src] set exp [localPath $maindir]/$section/$outset/$srcname set data [fileutil::cat -translation binary -encoding utf-8 $src] set expected [string trim [fileutil::cat -translation binary -encoding utf-8 $exp]] set expected [string map [list \ @sak @sak \ @line @line \ {@ %d} {@ %d} \ {@ %p} {@ %p} \ @ $::tcltest::testsDirectory] $expected] regexp -- {^([0-9]+)} $srcname -> n regsub -all -- {^[0-9]+} $srcname {} label scan $n %d n set label [string trim [string map {_ { }} $label]] set inputfile $src uplevel 1 $script } return } proc TestFilesProcessIn {maindir section inset -> nv lv iv dv script} { upvar 1 $nv n $lv label $dv data $iv inputfile set pattern $maindir/$section/$inset/* set files [TestFilesGlob $pattern] if {![llength $files]} { return -code error "No files matching \"$pattern\"" } foreach src $files { if {[string match *README* $src]} continue if {[file isdirectory $src]} continue set srcname [file tail $src] set data [fileutil::cat -translation binary -encoding utf-8 $src] regexp -- {^([0-9]+)} $srcname -> n regsub -all -- {^[0-9]+} $srcname {} label scan $n %d n set label [string trim [string map {_ { }} $label]] set inputfile $src |
︙ | ︙ | |||
236 237 238 239 240 241 242 243 244 245 | return -code error "$ta/$a at $tb/$b, children mismatch" } foreach ca [$ta children $a] cb [$tb children $b] { match_node $ta $ca $tb $cb } return } # ------------------------------------------------------------------------- return | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | return -code error "$ta/$a at $tb/$b, children mismatch" } foreach ca [$ta children $a] cb [$tb children $b] { match_node $ta $ca $tb $cb } return } # ------------------------------------------------------------------------- ## Dynamically create a parser for a PE grammar stored in a string. ## Different types: ## - critcl -- Run through critcl tool for compilation at test time. ## - oo ## - container -- interpreter loaded from a container ## - snit proc make-parser {format glabel grammar} { global pcounter if {![info exist pcounter]} { set pcounter 0 } set debug 0 set keep 0 # should be preloaded by test suite. if {[catch { package present pt::pgen }]} { error "pt::pgen package required and not loaded. Please fix your testsuite." } # Options per format. # container : -name # critcl : -class -name # oo : -class -name # snit : -class -name set gc GC[incr pcounter] lappend cmd pt::pgen peg $grammar $format -name G if {$format ne "container"} { lappend cmd -class $gc } try { set code [eval $cmd] } trap {PT RDE SYNTAX} {e o} { error [pt::util error2readable $e $grammar] } # debugging generator output if {$debug} { set k [expr {$keep ? [open $gc$format w] : "stdout"}] puts $k "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $format ($glabel)" puts $k $code puts $k "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $format ($glabel)" if {$keep} { close $k } } # Now do format-specific post-processing of the generated code to # get a proper parser object. switch -exact -- $format { container { # should be preloaded by test suite. if {[catch { package present pt::peg::interp }]} { error "pt::peg::interp package required and not loaded. Please fix your testsuite." } # Instantiate container class (transient). eval $code # Instantiate container (transient). set c [G %AUTO%] # Instantiate PEG interpreter, and configure with grammar in container. set p [pt::peg::interp %AUTO%] $p use $c # Clean up the transient pieces (container class and instance). $c destroy G destroy } snit { # Instantiate the parser class. # ATTENTION: We chop the last 2 lines of the code first, # unwanted "package provide" and "return" commands. eval [join [lrange [split $code \n] 0 end-2] \n] # Instantiate a parser based on the class. set p [$gc %AUTO%] # Note: Cannot destroy class now, would destroy instance as well. } oo { # Instantiate the parser class. # ATTENTION: We chop the last 2 lines of the code first, # unwanted "package provide" and "return" commands. eval [join [lrange [split $code \n] 0 end-2] \n] # Instantiate a parser based on the class. set p [$gc new] # Note: Cannot destroy class now, would destroy instance as well. } critcl { # Instantiate the parser class. # ATTENTION: We chop the last line of the code first, # unwanted "return" command. # # ATTENTION: We muck with [info script] to distinguish the # multiple parsers going through this file and procedure # from each other. Without doing this they would all map # to the same file and critcl bailing on us for code # redefinition after a compile & link for that file. set here [info script] info script $gc eval [join [lrange [split $code \n] 0 end-1] \n] # Above invoked critcl's collection of the C fragments. # We have made sure (in "pt_pgen.test" and # "tests/pt_pgen.tests") that the critcl package is # available (we use it in run&compile mode). # Hidden in the execution of the command instantiating the # parser is the compilation, link and load of the C # pieces, via $auto_index() and [unknown]. set p [${gc}::${gc}_critcl] info script $here } } # Provide parser instance. if {$debug} { puts "P = ($p)" puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $format ($glabel)" puts "** [join [info loaded] "\n** "]" puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $format ($glabel)" puts %% puts %%% } return $p } # ------------------------------------------------------------------------- return |
Added modules/pt/tests/data/gr/README.txt.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | This directory contains the test cases for pt_pgen.test, via tests/pt_pgen.tests Organization: * def/<n>_<foo> Primary test cases. Per primary test case FOO we have * ok-FOO Test inputs which result in a sucessful parse. We must have files here. * ok-FOO-res Per test input file TIF in ok-FOO we have an associated result file here, also named TIF, containing the output of the parser, i.e. the generated AST, in raw form, on that input. * fail-FOO Test inputs which result in a failed parse. This directory can be empty or missing. Because some expressions (X*, X?) cannot fail. NOTE: If an expression can fail, please create test cases which demonstrate this. * fail-FOO-<backend>-res Per test input file TIF in fail-FOO we have an associated result file here, also named TIF, containing the error thrown by the parser (implemented via <backend>) on that input. Possible <backend>s are: container Parser is the PEG interpreter. Plain Tcl, possibly accelerated through C-level implementations for stacks and the like. critcl Fully C-based parser, embedded in Critcl. oo Premade parser with a Tcl runtime using the TclOO object system. Possibly accelerated through C-level implementations for stacks and the like. snit Premade parser with a Tcl runtime using the snit object system. Possibly accelerated through C-level implementations for stacks and the like. |
Added modules/pt/tests/data/gr/TODO.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | Constructions not yet covered by the test suite ... Operator Covered Notes -------- ------- ----- . dot y .. range y char range alnum y alpha y ascii y cl y general char class, fused char choice control y ddigit y digit y graph y lower y n nonterminal y printable y punct y space y str y fused char sequence t terminal y general terminal char upper y wordchar y xdigit y / choice y x sequence y * repeat0 y kleene + repeat1 y pos.kleene ? optional y ! notahead lookahead predicate, assert non-match -------- ------- ----- & ahead lookahead predicate, assert match -------- ------- ----- epsilon n internal, not directly accessible only indirectly through "?" -------- ------- |
Added modules/pt/tests/data/gr/def/0_sequence.
> > | 1 2 | PEG a_pe_grammar ('a' 'b' 'c') END; |
Added modules/pt/tests/data/gr/def/10_kleene.
> > | 1 2 | PEG a_pe_grammar ('a'* 'b') END; |
Added modules/pt/tests/data/gr/def/11_sym-kleene.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- 'a'* 'b'; END; |
Added modules/pt/tests/data/gr/def/12_alnum.
> > | 1 2 | PEG a_pe_grammar (<alnum>) END; |
Added modules/pt/tests/data/gr/def/13_sym-alnum.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <alnum>; END; |
Added modules/pt/tests/data/gr/def/14_alpha.
> > | 1 2 | PEG a_pe_grammar (<alpha>) END; |
Added modules/pt/tests/data/gr/def/15_sym-alpha.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <alpha>; END; |
Added modules/pt/tests/data/gr/def/16_ascii.
> > | 1 2 | PEG a_pe_grammar (<ascii>) END; |
Added modules/pt/tests/data/gr/def/17_sym-ascii.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <ascii>; END; |
Added modules/pt/tests/data/gr/def/18_control.
> > | 1 2 | PEG a_pe_grammar (<control>) END; |
Added modules/pt/tests/data/gr/def/19_sym-control.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <control>; END; |
Added modules/pt/tests/data/gr/def/1_sym-sequence.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- 'a' 'b' 'c'; END; |
Added modules/pt/tests/data/gr/def/20_ddigit.
> > | 1 2 | PEG a_pe_grammar (<ddigit>) END; |
Added modules/pt/tests/data/gr/def/21_sym-ddigit.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <ddigit>; END; |
Added modules/pt/tests/data/gr/def/22_digit.
> > | 1 2 | PEG a_pe_grammar (<digit>) END; |
Added modules/pt/tests/data/gr/def/23_sym-digit.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <digit>; END; |
Added modules/pt/tests/data/gr/def/24_graph.
> > | 1 2 | PEG a_pe_grammar (<graph>) END; |
Added modules/pt/tests/data/gr/def/25_sym-graph.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <graph>; END; |
Added modules/pt/tests/data/gr/def/26_lower.
> > | 1 2 | PEG a_pe_grammar (<lower>) END; |
Added modules/pt/tests/data/gr/def/27_sym-lower.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <lower>; END; |
Added modules/pt/tests/data/gr/def/28_print.
> > | 1 2 | PEG a_pe_grammar (<print>) END; |
Added modules/pt/tests/data/gr/def/29_sym-print.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <print>; END; |
Added modules/pt/tests/data/gr/def/2_choice.
> > | 1 2 | PEG a_pe_grammar ('alpha' / 'anumeric' / 'digit') END; |
Added modules/pt/tests/data/gr/def/30_punct.
> > | 1 2 | PEG a_pe_grammar (<punct>) END; |
Added modules/pt/tests/data/gr/def/31_sym-punct.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <punct>; END; |
Added modules/pt/tests/data/gr/def/32_space.
> > | 1 2 | PEG a_pe_grammar (<space>) END; |
Added modules/pt/tests/data/gr/def/33_sym-space.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <space>; END; |
Added modules/pt/tests/data/gr/def/34_upper.
> > | 1 2 | PEG a_pe_grammar (<upper>) END; |
Added modules/pt/tests/data/gr/def/35_sym-upper.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <upper>; END; |
Added modules/pt/tests/data/gr/def/36_wordchar.
> > | 1 2 | PEG a_pe_grammar (<wordchar>) END; |
Added modules/pt/tests/data/gr/def/37_sym-wordchar.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <wordchar>; END; |
Added modules/pt/tests/data/gr/def/38_xdigit.
> > | 1 2 | PEG a_pe_grammar (<xdigit>) END; |
Added modules/pt/tests/data/gr/def/39_sym-xdigit.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <xdigit>; END; |
Added modules/pt/tests/data/gr/def/3_sym-choice.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- 'alpha' / 'anumeric' / 'digit'; END; |
Added modules/pt/tests/data/gr/def/40_dot.
> > | 1 2 | PEG a_pe_grammar (.) END; |
Added modules/pt/tests/data/gr/def/41_sym-dot.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- .; END; |
Added modules/pt/tests/data/gr/def/42_optional.
> > | 1 2 | PEG a_pe_grammar ("have"? "not") END; |
Added modules/pt/tests/data/gr/def/43_sym-optional.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- "have"? "not"; END; |
Added modules/pt/tests/data/gr/def/44_notahead.
> > > | 1 2 3 | # An identifier is an alphanumeric string which is not a keyword. PEG a_pe_grammar (!("serial"!<alnum>) (<alpha> <alnum>+ !<alnum>)) END; |
Added modules/pt/tests/data/gr/def/45_sym-notahead.
> > > > | 1 2 3 4 | # An identifier is an alphanumeric string which is not a keyword. PEG a_pe_grammar (N) N <- !("serial"!<alnum>) (<alpha> <alnum>+ !<alnum>); END; |
Added modules/pt/tests/data/gr/def/46_ahead.
> > | 1 2 | PEG a_pe_grammar (<alpha> <alnum>+ &'=') END; |
Added modules/pt/tests/data/gr/def/47_sym-ahead.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- <alpha> <alnum>+ &'='; END; |
Added modules/pt/tests/data/gr/def/4_class.
> > | 1 2 | PEG a_pe_grammar ([axe]) END; |
Added modules/pt/tests/data/gr/def/5_sym-class.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- [axe]; END; |
Added modules/pt/tests/data/gr/def/6_range.
> > | 1 2 | PEG a_pe_grammar ("0x" [A-F]) END; |
Added modules/pt/tests/data/gr/def/7_sym-range.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- "0x" [A-F]; END; |
Added modules/pt/tests/data/gr/def/8_pkleene.
> > | 1 2 | PEG a_pe_grammar ('a'+ 'b') END; |
Added modules/pt/tests/data/gr/def/9_sym-pkleene.
> > > | 1 2 3 | PEG a_pe_grammar (N) N <- 'a'+ 'b'; END; |
Added modules/pt/tests/data/gr/fail-ahead-container-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-ahead-critcl-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-ahead-oo-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-ahead-snit-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-ahead/0_notmatch.
> | 1 | abba, |
Added modules/pt/tests/data/gr/fail-alnum-container-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-alnum-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-alnum-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-alnum-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-alnum/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-alpha-container-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-alpha-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-alpha-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-alpha-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-alpha/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-ascii-container-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-ascii-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-ascii-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-ascii-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-ascii/0_outside.
> | 1 | |
Added modules/pt/tests/data/gr/fail-choice-container-res/0_aleph.
> | 1 | 1 {pt::rde 2 {{t p}}} |
Added modules/pt/tests/data/gr/fail-choice-container-res/1_anumber.
> | 1 | 1 {pt::rde 4 {{t e}}} |
Added modules/pt/tests/data/gr/fail-choice-container-res/2_digup.
> | 1 | 1 {pt::rde 3 {{t i}}} |
Added modules/pt/tests/data/gr/fail-choice-container-res/3_other.
> | 1 | 1 {pt::rde 0 {{t a} {t d}}} |
Added modules/pt/tests/data/gr/fail-choice-critcl-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-critcl-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-critcl-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-critcl-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-oo-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-oo-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-oo-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-oo-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-snit-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-snit-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-snit-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice-snit-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-choice/0_aleph.
> | 1 | aleph |
Added modules/pt/tests/data/gr/fail-choice/1_anumber.
> | 1 | anumber |
Added modules/pt/tests/data/gr/fail-choice/2_digup.
> | 1 | digup |
Added modules/pt/tests/data/gr/fail-choice/3_other.
> | 1 | other |
Added modules/pt/tests/data/gr/fail-class-container-res/0_beta.
> | 1 | 1 {pt::rde 0 {{t a} {t e} {t x}}} |
Added modules/pt/tests/data/gr/fail-class-critcl-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-class-oo-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-class-snit-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-class/0_beta.
> | 1 | beta |
Added modules/pt/tests/data/gr/fail-control-container-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-control-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-control-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-control-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-control/0_outside.
> | 1 | A |
Added modules/pt/tests/data/gr/fail-ddigit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-ddigit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-ddigit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-ddigit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-ddigit/0_outside.
> | 1 | F |
Added modules/pt/tests/data/gr/fail-digit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-digit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-digit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-digit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-digit/0_outside.
> | 1 | F |
Added modules/pt/tests/data/gr/fail-dot-container-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-dot-critcl-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-dot-oo-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-dot-snit-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-dot/0_none.
Added modules/pt/tests/data/gr/fail-graph-container-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-graph-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-graph-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-graph-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-graph/0_outside.
> | 1 |
Added modules/pt/tests/data/gr/fail-lower-container-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-lower-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-lower-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-lower-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-lower/0_outside.
> | 1 | A |
Added modules/pt/tests/data/gr/fail-notahead-container-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-notahead-critcl-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-notahead-oo-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-notahead-snit-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-notahead/0_keyword.
> | 1 | serial |
Added modules/pt/tests/data/gr/fail-pkleene-container-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-pkleene-critcl-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-pkleene-oo-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-pkleene-snit-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-pkleene/0_b.
> | 1 | b |
Added modules/pt/tests/data/gr/fail-print-container-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-print-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-print-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-print-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-print/0_outside.
> | 1 |
Added modules/pt/tests/data/gr/fail-punct-container-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-punct-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-punct-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-punct-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-punct/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-range-container-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-range-critcl-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-range-oo-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-range-snit-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-range/0_beta.
> | 1 | 0xbeta |
Added modules/pt/tests/data/gr/fail-sequence-container-res/0_abe.
> | 1 | 1 {pt::rde 2 {{t c}}} |
Added modules/pt/tests/data/gr/fail-sequence-container-res/1_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sequence-critcl-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence-critcl-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence-oo-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence-oo-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence-snit-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence-snit-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sequence/0_abe.
> | 1 | abe |
Added modules/pt/tests/data/gr/fail-sequence/1_b.
> | 1 | b |
Added modules/pt/tests/data/gr/fail-space-container-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-space-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-space-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-space-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-space/0_outside.
> | 1 | X |
Added modules/pt/tests/data/gr/fail-sym-ahead-container-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-sym-ahead-critcl-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-sym-ahead-oo-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-sym-ahead-snit-res/0_notmatch.
> | 1 | 1 {pt::rde 4 {alnum {t =}}} |
Added modules/pt/tests/data/gr/fail-sym-ahead/0_notmatch.
> | 1 | abba, |
Added modules/pt/tests/data/gr/fail-sym-alnum-container-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-sym-alnum-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-sym-alnum-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-sym-alnum-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 alnum} |
Added modules/pt/tests/data/gr/fail-sym-alnum/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-sym-alpha-container-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-sym-alpha-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-sym-alpha-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-sym-alpha-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 alpha} |
Added modules/pt/tests/data/gr/fail-sym-alpha/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-sym-ascii-container-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-sym-ascii-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-sym-ascii-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-sym-ascii-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 ascii} |
Added modules/pt/tests/data/gr/fail-sym-ascii/0_outside.
> | 1 | |
Added modules/pt/tests/data/gr/fail-sym-choice-container-res/0_aleph.
> | 1 | 1 {pt::rde 2 {{t p}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-container-res/1_anumber.
> | 1 | 1 {pt::rde 4 {{t e}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-container-res/2_digup.
> | 1 | 1 {pt::rde 3 {{t i}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-container-res/3_other.
> | 1 | 1 {pt::rde 0 {{t a} {t d}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-critcl-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-critcl-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-critcl-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-critcl-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-oo-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-oo-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-oo-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-oo-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-snit-res/0_aleph.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-snit-res/1_anumber.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-snit-res/2_digup.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice-snit-res/3_other.
> | 1 | 1 {pt::rde 0 {{str alpha} {str anumeric} {str digit}}} |
Added modules/pt/tests/data/gr/fail-sym-choice/0_aleph.
> | 1 | aleph |
Added modules/pt/tests/data/gr/fail-sym-choice/1_anumber.
> | 1 | anumber |
Added modules/pt/tests/data/gr/fail-sym-choice/2_digup.
> | 1 | digup |
Added modules/pt/tests/data/gr/fail-sym-choice/3_other.
> | 1 | other |
Added modules/pt/tests/data/gr/fail-sym-class-container-res/0_beta.
> | 1 | 1 {pt::rde 0 {{t a} {t e} {t x}}} |
Added modules/pt/tests/data/gr/fail-sym-class-critcl-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-sym-class-oo-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-sym-class-snit-res/0_beta.
> | 1 | 1 {pt::rde 0 {{cl axe}}} |
Added modules/pt/tests/data/gr/fail-sym-class/0_beta.
> | 1 | beta |
Added modules/pt/tests/data/gr/fail-sym-control-container-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-sym-control-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-sym-control-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-sym-control-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 control} |
Added modules/pt/tests/data/gr/fail-sym-control/0_outside.
> | 1 | A |
Added modules/pt/tests/data/gr/fail-sym-ddigit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-sym-ddigit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-sym-ddigit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-sym-ddigit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 ddigit} |
Added modules/pt/tests/data/gr/fail-sym-ddigit/0_outside.
> | 1 | F |
Added modules/pt/tests/data/gr/fail-sym-digit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-sym-digit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-sym-digit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-sym-digit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 digit} |
Added modules/pt/tests/data/gr/fail-sym-digit/0_outside.
> | 1 | F |
Added modules/pt/tests/data/gr/fail-sym-dot-container-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-sym-dot-critcl-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-sym-dot-oo-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-sym-dot-snit-res/0_none.
> | 1 | 1 {pt::rde 0 dot} |
Added modules/pt/tests/data/gr/fail-sym-dot/0_none.
Added modules/pt/tests/data/gr/fail-sym-graph-container-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-sym-graph-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-sym-graph-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-sym-graph-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 graph} |
Added modules/pt/tests/data/gr/fail-sym-graph/0_outside.
> | 1 |
Added modules/pt/tests/data/gr/fail-sym-lower-container-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-sym-lower-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-sym-lower-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-sym-lower-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 lower} |
Added modules/pt/tests/data/gr/fail-sym-lower/0_outside.
> | 1 | A |
Added modules/pt/tests/data/gr/fail-sym-notahead-container-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-sym-notahead-critcl-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-sym-notahead-oo-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-sym-notahead-snit-res/0_keyword.
> | 1 | 1 {pt::rde 6 alnum} |
Added modules/pt/tests/data/gr/fail-sym-notahead/0_keyword.
> | 1 | serial |
Added modules/pt/tests/data/gr/fail-sym-pkleene-container-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sym-pkleene-critcl-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sym-pkleene-oo-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sym-pkleene-snit-res/0_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sym-pkleene/0_b.
> | 1 | b |
Added modules/pt/tests/data/gr/fail-sym-print-container-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-sym-print-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-sym-print-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-sym-print-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 print} |
Added modules/pt/tests/data/gr/fail-sym-print/0_outside.
> | 1 |
Added modules/pt/tests/data/gr/fail-sym-punct-container-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-sym-punct-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-sym-punct-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-sym-punct-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 punct} |
Added modules/pt/tests/data/gr/fail-sym-punct/0_outside.
> | 1 | = |
Added modules/pt/tests/data/gr/fail-sym-range-container-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-sym-range-critcl-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-sym-range-oo-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-sym-range-snit-res/0_beta.
> | 1 | 1 {pt::rde 2 {{.. A F}}} |
Added modules/pt/tests/data/gr/fail-sym-range/0_beta.
> | 1 | 0xbeta |
Added modules/pt/tests/data/gr/fail-sym-sequence-container-res/0_abe.
> | 1 | 1 {pt::rde 2 {{t c}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-container-res/1_b.
> | 1 | 1 {pt::rde 0 {{t a}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-critcl-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-critcl-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-oo-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-oo-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-snit-res/0_abe.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence-snit-res/1_b.
> | 1 | 1 {pt::rde 0 {{str abc}}} |
Added modules/pt/tests/data/gr/fail-sym-sequence/0_abe.
> | 1 | abe |
Added modules/pt/tests/data/gr/fail-sym-sequence/1_b.
> | 1 | b |
Added modules/pt/tests/data/gr/fail-sym-space-container-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-sym-space-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-sym-space-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-sym-space-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 space} |
Added modules/pt/tests/data/gr/fail-sym-space/0_outside.
> | 1 | X |
Added modules/pt/tests/data/gr/fail-sym-upper-container-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-sym-upper-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-sym-upper-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-sym-upper-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-sym-upper/0_outside.
> | 1 | a |
Added modules/pt/tests/data/gr/fail-sym-wordchar-container-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-sym-wordchar-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-sym-wordchar-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-sym-wordchar-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-sym-wordchar/0_outside.
> | 1 | : |
Added modules/pt/tests/data/gr/fail-sym-xdigit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-sym-xdigit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-sym-xdigit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-sym-xdigit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-sym-xdigit/0_outside.
> | 1 | g |
Added modules/pt/tests/data/gr/fail-upper-container-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-upper-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-upper-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-upper-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 upper} |
Added modules/pt/tests/data/gr/fail-upper/0_outside.
> | 1 | a |
Added modules/pt/tests/data/gr/fail-wordchar-container-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-wordchar-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-wordchar-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-wordchar-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 wordchar} |
Added modules/pt/tests/data/gr/fail-wordchar/0_outside.
> | 1 | : |
Added modules/pt/tests/data/gr/fail-xdigit-container-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-xdigit-critcl-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-xdigit-oo-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-xdigit-snit-res/0_outside.
> | 1 | 1 {pt::rde 0 xdigit} |
Added modules/pt/tests/data/gr/fail-xdigit/0_outside.
> | 1 | g |
Added modules/pt/tests/data/gr/ok-ahead-res/0_match.
Added modules/pt/tests/data/gr/ok-ahead/0_match.
> | 1 | abba= |
Added modules/pt/tests/data/gr/ok-alnum-res/0_inside.
Added modules/pt/tests/data/gr/ok-alnum/0_inside.
> | 1 | A |
Added modules/pt/tests/data/gr/ok-alpha-res/0_inside.
Added modules/pt/tests/data/gr/ok-alpha/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-ascii-res/0_inside.
Added modules/pt/tests/data/gr/ok-ascii/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-choice-res/0_alpha.
Added modules/pt/tests/data/gr/ok-choice-res/1_digit.
Added modules/pt/tests/data/gr/ok-choice-res/2_anumeric.
Added modules/pt/tests/data/gr/ok-choice/0_alpha.
> | 1 | alpha |
Added modules/pt/tests/data/gr/ok-choice/1_digit.
> | 1 | digit |
Added modules/pt/tests/data/gr/ok-choice/2_anumeric.
> | 1 | anumeric |
Added modules/pt/tests/data/gr/ok-class-res/0_a.
Added modules/pt/tests/data/gr/ok-class-res/1_x.
Added modules/pt/tests/data/gr/ok-class-res/2_e.
Added modules/pt/tests/data/gr/ok-class/0_a.
> | 1 | a |
Added modules/pt/tests/data/gr/ok-class/1_x.
> | 1 | x |
Added modules/pt/tests/data/gr/ok-class/2_e.
> | 1 | e |
Added modules/pt/tests/data/gr/ok-control-res/0_inside.
Added modules/pt/tests/data/gr/ok-control/0_inside.
> | 1 |
Added modules/pt/tests/data/gr/ok-ddigit-res/0_inside.
Added modules/pt/tests/data/gr/ok-ddigit/0_inside.
> | 1 | 5 |
Added modules/pt/tests/data/gr/ok-digit-res/0_inside.
Added modules/pt/tests/data/gr/ok-digit/0_inside.
> | 1 | 5 |
Added modules/pt/tests/data/gr/ok-dot-res/0_any.
Added modules/pt/tests/data/gr/ok-dot/0_any.
> | 1 | % |
Added modules/pt/tests/data/gr/ok-graph-res/0_inside.
Added modules/pt/tests/data/gr/ok-graph/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-kleene-res/0_aaab.
Added modules/pt/tests/data/gr/ok-kleene-res/1_aab.
Added modules/pt/tests/data/gr/ok-kleene-res/2_ab.
Added modules/pt/tests/data/gr/ok-kleene-res/3_b.
Added modules/pt/tests/data/gr/ok-kleene/0_aaab.
> | 1 | aaab |
Added modules/pt/tests/data/gr/ok-kleene/1_aab.
> | 1 | aab |
Added modules/pt/tests/data/gr/ok-kleene/2_ab.
> | 1 | ab |
Added modules/pt/tests/data/gr/ok-kleene/3_b.
> | 1 | b |
Added modules/pt/tests/data/gr/ok-lower-res/0_inside.
Added modules/pt/tests/data/gr/ok-lower/0_inside.
> | 1 | a |
Added modules/pt/tests/data/gr/ok-notahead-res/0_ident.
Added modules/pt/tests/data/gr/ok-notahead-res/1_identifierb.
Added modules/pt/tests/data/gr/ok-notahead/0_ident.
> | 1 | identifier |
Added modules/pt/tests/data/gr/ok-notahead/1_identifierb.
> | 1 | serialized |
Added modules/pt/tests/data/gr/ok-optional-res/0_have.
Added modules/pt/tests/data/gr/ok-optional-res/1_havenot.
Added modules/pt/tests/data/gr/ok-optional/0_have.
> | 1 | havenot |
Added modules/pt/tests/data/gr/ok-optional/1_havenot.
> | 1 | not |
Added modules/pt/tests/data/gr/ok-pkleene-res/0_aaab.
Added modules/pt/tests/data/gr/ok-pkleene-res/1_aab.
Added modules/pt/tests/data/gr/ok-pkleene-res/2_ab.
Added modules/pt/tests/data/gr/ok-pkleene/0_aaab.
> | 1 | aaab |
Added modules/pt/tests/data/gr/ok-pkleene/1_aab.
> | 1 | aab |
Added modules/pt/tests/data/gr/ok-pkleene/2_ab.
> | 1 | ab |
Added modules/pt/tests/data/gr/ok-print-res/0_inside.
Added modules/pt/tests/data/gr/ok-print/0_inside.
> | 1 | = |
Added modules/pt/tests/data/gr/ok-punct-res/0_inside.
Added modules/pt/tests/data/gr/ok-punct/0_inside.
> | 1 | . |
Added modules/pt/tests/data/gr/ok-range-res/0_a.
Added modules/pt/tests/data/gr/ok-range/0_a.
> | 1 | 0xA |
Added modules/pt/tests/data/gr/ok-sequence-res/0_abc.
Added modules/pt/tests/data/gr/ok-sequence/0_abc.
> | 1 | abc |
Added modules/pt/tests/data/gr/ok-space-res/0_inside.
Added modules/pt/tests/data/gr/ok-space/0_inside.
> | 1 |
Added modules/pt/tests/data/gr/ok-sym-ahead-res/0_match.
> | 1 | N 0 3 |
Added modules/pt/tests/data/gr/ok-sym-ahead/0_match.
> | 1 | abba= |
Added modules/pt/tests/data/gr/ok-sym-alnum-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-alnum/0_inside.
> | 1 | A |
Added modules/pt/tests/data/gr/ok-sym-alpha-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-alpha/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-sym-ascii-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-ascii/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-sym-choice-res/0_alpha.
> | 1 | N 0 4 |
Added modules/pt/tests/data/gr/ok-sym-choice-res/1_digit.
> | 1 | N 0 4 |
Added modules/pt/tests/data/gr/ok-sym-choice-res/2_anumeric.
> | 1 | N 0 7 |
Added modules/pt/tests/data/gr/ok-sym-choice/0_alpha.
> | 1 | alpha |
Added modules/pt/tests/data/gr/ok-sym-choice/1_digit.
> | 1 | digit |
Added modules/pt/tests/data/gr/ok-sym-choice/2_anumeric.
> | 1 | anumeric |
Added modules/pt/tests/data/gr/ok-sym-class-res/0_a.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-class-res/1_x.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-class-res/2_e.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-class/0_a.
> | 1 | a |
Added modules/pt/tests/data/gr/ok-sym-class/1_x.
> | 1 | x |
Added modules/pt/tests/data/gr/ok-sym-class/2_e.
> | 1 | e |
Added modules/pt/tests/data/gr/ok-sym-control-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-control/0_inside.
> | 1 |
Added modules/pt/tests/data/gr/ok-sym-ddigit-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-ddigit/0_inside.
> | 1 | 5 |
Added modules/pt/tests/data/gr/ok-sym-digit-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-digit/0_inside.
> | 1 | 5 |
Added modules/pt/tests/data/gr/ok-sym-dot-res/0_any.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-dot/0_any.
> | 1 | % |
Added modules/pt/tests/data/gr/ok-sym-graph-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-graph/0_inside.
> | 1 | X |
Added modules/pt/tests/data/gr/ok-sym-kleene-res/0_aaab.
> | 1 | N 0 3 |
Added modules/pt/tests/data/gr/ok-sym-kleene-res/1_aab.
> | 1 | N 0 2 |
Added modules/pt/tests/data/gr/ok-sym-kleene-res/2_ab.
> | 1 | N 0 1 |
Added modules/pt/tests/data/gr/ok-sym-kleene-res/3_b.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-kleene/0_aaab.
> | 1 | aaab |
Added modules/pt/tests/data/gr/ok-sym-kleene/1_aab.
> | 1 | aab |
Added modules/pt/tests/data/gr/ok-sym-kleene/2_ab.
> | 1 | ab |
Added modules/pt/tests/data/gr/ok-sym-kleene/3_b.
> | 1 | b |
Added modules/pt/tests/data/gr/ok-sym-lower-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-lower/0_inside.
> | 1 | a |
Added modules/pt/tests/data/gr/ok-sym-notahead-res/0_ident.
> | 1 | N 0 9 |
Added modules/pt/tests/data/gr/ok-sym-notahead-res/1_identifierb.
> | 1 | N 0 9 |
Added modules/pt/tests/data/gr/ok-sym-notahead/0_ident.
> | 1 | identifier |
Added modules/pt/tests/data/gr/ok-sym-notahead/1_identifierb.
> | 1 | serialized |
Added modules/pt/tests/data/gr/ok-sym-optional-res/0_have.
> | 1 | N 0 6 |
Added modules/pt/tests/data/gr/ok-sym-optional-res/1_havenot.
> | 1 | N 0 2 |
Added modules/pt/tests/data/gr/ok-sym-optional/0_have.
> | 1 | havenot |
Added modules/pt/tests/data/gr/ok-sym-optional/1_havenot.
> | 1 | not |
Added modules/pt/tests/data/gr/ok-sym-pkleene-res/0_aaab.
> | 1 | N 0 3 |
Added modules/pt/tests/data/gr/ok-sym-pkleene-res/1_aab.
> | 1 | N 0 2 |
Added modules/pt/tests/data/gr/ok-sym-pkleene-res/2_ab.
> | 1 | N 0 1 |
Added modules/pt/tests/data/gr/ok-sym-pkleene/0_aaab.
> | 1 | aaab |
Added modules/pt/tests/data/gr/ok-sym-pkleene/1_aab.
> | 1 | aab |
Added modules/pt/tests/data/gr/ok-sym-pkleene/2_ab.
> | 1 | ab |
Added modules/pt/tests/data/gr/ok-sym-print-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-print/0_inside.
> | 1 | = |
Added modules/pt/tests/data/gr/ok-sym-punct-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-punct/0_inside.
> | 1 | . |
Added modules/pt/tests/data/gr/ok-sym-range-res/0_a.
> | 1 | N 0 2 |
Added modules/pt/tests/data/gr/ok-sym-range/0_a.
> | 1 | 0xA |
Added modules/pt/tests/data/gr/ok-sym-sequence-res/0_abc.
> | 1 | N 0 2 |
Added modules/pt/tests/data/gr/ok-sym-sequence/0_abc.
> | 1 | abc |
Added modules/pt/tests/data/gr/ok-sym-space-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-space/0_inside.
> | 1 |
Added modules/pt/tests/data/gr/ok-sym-upper-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-upper/0_inside.
> | 1 | A |
Added modules/pt/tests/data/gr/ok-sym-wordchar-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-wordchar/0_inside.
> | 1 | _ |
Added modules/pt/tests/data/gr/ok-sym-xdigit-res/0_inside.
> | 1 | N 0 0 |
Added modules/pt/tests/data/gr/ok-sym-xdigit/0_inside.
> | 1 | f |
Added modules/pt/tests/data/gr/ok-upper-res/0_inside.
Added modules/pt/tests/data/gr/ok-upper/0_inside.
> | 1 | A |
Added modules/pt/tests/data/gr/ok-wordchar-res/0_inside.
Added modules/pt/tests/data/gr/ok-wordchar/0_inside.
> | 1 | _ |
Added modules/pt/tests/data/gr/ok-xdigit-res/0_inside.
Added modules/pt/tests/data/gr/ok-xdigit/0_inside.
> | 1 | f |
Changes to modules/pt/tests/data/ok/peg_container-bulk/3_peg_itself.
1 2 3 4 | snit::type a_pe_grammar { constructor {} { install myg using pt::peg::container ${selfns}::G $myg start {n Grammar} | | | 1 2 3 4 5 6 7 8 9 10 11 12 | snit::type a_pe_grammar { constructor {} { install myg using pt::peg::container ${selfns}::G $myg start {n Grammar} $myg add ALNUM ALPHA AND APOSTROPH ASCII Attribute Char CharOctalFull CharOctalPart CharSpecial CharUnescaped CharUnicode Class CLOSE CLOSEB COLON COMMENT CONTROL DAPOSTROPH DDIGIT Definition DIGIT DOT EOF EOL Expression Final Grammar GRAPH Header Ident Identifier IS LEAF Literal LOWER NOT OPEN OPENB PEG PLUS Prefix Primary PRINTABLE PUNCT QUESTION Range SEMICOLON Sequence SLASH SPACE STAR StartExpr Suffix TO UPPER VOID WHITESPACE WORDCHAR XDIGIT $myg modes { ALNUM leaf ALPHA leaf AND leaf APOSTROPH void ASCII leaf Attribute value |
︙ | ︙ | |||
23 24 25 26 27 28 29 | COMMENT void CONTROL leaf DAPOSTROPH void DDIGIT leaf Definition value DIGIT leaf DOT leaf | < | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | COMMENT void CONTROL leaf DAPOSTROPH void DDIGIT leaf Definition value DIGIT leaf DOT leaf EOF void EOL void Expression value Final void Grammar value GRAPH leaf Header value |
︙ | ︙ | |||
86 87 88 89 90 91 92 | COMMENT {x {t #} {* {x {! {n EOL}} dot}} {n EOL}} CONTROL {x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}} DAPOSTROPH {t \42} DDIGIT {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} Definition {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}} DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} DOT {x {t .} {n WHITESPACE}} | < | | | 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 | COMMENT {x {t #} {* {x {! {n EOL}} dot}} {n EOL}} CONTROL {x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}} DAPOSTROPH {t \42} DDIGIT {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} Definition {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}} DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} DOT {x {t .} {n WHITESPACE}} EOF {! dot} EOL {/ {t \n} {t \r}} Expression {x {n Sequence} {* {x {n SLASH} {n Sequence}}}} Final {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}} Grammar {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}} GRAPH {x {t <} {t g} {t r} {t a} {t p} {t h} {t >} {n WHITESPACE}} Header {x {n PEG} {n Identifier} {n StartExpr}} Ident {x {/ {t _} {t :} alpha} {* {/ {t _} {t :} alnum}}} Identifier {x {n Ident} {n WHITESPACE}} IS {x {t <} {t -} {n WHITESPACE}} LEAF {x {t l} {t e} {t a} {t f} {n WHITESPACE}} Literal {/ {x {n APOSTROPH} {* {x {! {n APOSTROPH}} {n Char}}} {n APOSTROPH} {n WHITESPACE}} {x {n DAPOSTROPH} {* {x {! {n DAPOSTROPH}} {n Char}}} {n DAPOSTROPH} {n WHITESPACE}}} LOWER {x {t <} {t l} {t o} {t w} {t e} {t r} {t >} {n WHITESPACE}} NOT {x {t !} {n WHITESPACE}} OPEN {x {t \50} {n WHITESPACE}} OPENB {t \133} PEG {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}} PLUS {x {t +} {n WHITESPACE}} Prefix {x {? {/ {n AND} {n NOT}}} {n Suffix}} Primary {/ {n ALNUM} {n ALPHA} {n ASCII} {n CONTROL} {n DDIGIT} {n DIGIT} {n GRAPH} {n LOWER} {n PRINTABLE} {n PUNCT} {n SPACE} {n UPPER} {n WORDCHAR} {n XDIGIT} {n Identifier} {x {n OPEN} {n Expression} {n CLOSE}} {n Literal} {n Class} {n DOT}} PRINTABLE {x {t <} {t p} {t r} {t i} {t n} {t t} {t >} {n WHITESPACE}} PUNCT {x {t <} {t p} {t u} {t n} {t c} {t t} {t >} {n WHITESPACE}} QUESTION {x {t ?} {n WHITESPACE}} Range {/ {x {n Char} {n TO} {n Char}} {n Char}} |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_container-incremental/3_peg_itself.
︙ | ︙ | |||
91 92 93 94 95 96 97 | $myg mode DIGIT leaf $myg rule DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} $myg add DOT $myg mode DOT leaf $myg rule DOT {x {t .} {n WHITESPACE}} | < < < < | | 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 | $myg mode DIGIT leaf $myg rule DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} $myg add DOT $myg mode DOT leaf $myg rule DOT {x {t .} {n WHITESPACE}} $myg add EOF $myg mode EOF void $myg rule EOF {! dot} $myg add EOL $myg mode EOL void $myg rule EOL {/ {t \n} {t \r}} $myg add Expression $myg mode Expression value $myg rule Expression {x {n Sequence} {* {x {n SLASH} {n Sequence}}}} $myg add Final $myg mode Final void $myg rule Final {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}} $myg add Grammar $myg mode Grammar value $myg rule Grammar {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}} $myg add GRAPH $myg mode GRAPH leaf |
︙ | ︙ | |||
161 162 163 164 165 166 167 | $myg add OPENB $myg mode OPENB void $myg rule OPENB {t \133} $myg add PEG $myg mode PEG void | | | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | $myg add OPENB $myg mode OPENB void $myg rule OPENB {t \133} $myg add PEG $myg mode PEG void $myg rule PEG {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}} $myg add PLUS $myg mode PLUS leaf $myg rule PLUS {x {t +} {n WHITESPACE}} $myg add Prefix $myg mode Prefix value |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_container-templated-bulk/3_peg_itself.
1 2 3 4 5 6 7 8 9 10 11 12 | # -*- tcl -*- # Parsing Expression Grammar 'TEMPLATE'. # Generated for unknown, from file 'TEST' package require Tcl 8.5 package require snit package require pt::peg::container snit::type TEMPLATE { constructor {} { install myg using pt::peg::container ${selfns}::G $myg start {n Grammar} | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # -*- tcl -*- # Parsing Expression Grammar 'TEMPLATE'. # Generated for unknown, from file 'TEST' package require Tcl 8.5 package require snit package require pt::peg::container snit::type TEMPLATE { constructor {} { install myg using pt::peg::container ${selfns}::G $myg start {n Grammar} $myg add ALNUM ALPHA AND APOSTROPH ASCII Attribute Char CharOctalFull CharOctalPart CharSpecial CharUnescaped CharUnicode Class CLOSE CLOSEB COLON COMMENT CONTROL DAPOSTROPH DDIGIT Definition DIGIT DOT EOF EOL Expression Final Grammar GRAPH Header Ident Identifier IS LEAF Literal LOWER NOT OPEN OPENB PEG PLUS Prefix Primary PRINTABLE PUNCT QUESTION Range SEMICOLON Sequence SLASH SPACE STAR StartExpr Suffix TO UPPER VOID WHITESPACE WORDCHAR XDIGIT $myg modes { ALNUM leaf ALPHA leaf AND leaf APOSTROPH void ASCII leaf Attribute value |
︙ | ︙ | |||
31 32 33 34 35 36 37 | COMMENT void CONTROL leaf DAPOSTROPH void DDIGIT leaf Definition value DIGIT leaf DOT leaf | < | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | COMMENT void CONTROL leaf DAPOSTROPH void DDIGIT leaf Definition value DIGIT leaf DOT leaf EOF void EOL void Expression value Final void Grammar value GRAPH leaf Header value |
︙ | ︙ | |||
94 95 96 97 98 99 100 | COMMENT {x {t #} {* {x {! {n EOL}} dot}} {n EOL}} CONTROL {x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}} DAPOSTROPH {t \42} DDIGIT {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} Definition {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}} DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} DOT {x {t .} {n WHITESPACE}} | < | | | 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 | COMMENT {x {t #} {* {x {! {n EOL}} dot}} {n EOL}} CONTROL {x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}} DAPOSTROPH {t \42} DDIGIT {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} Definition {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}} DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} DOT {x {t .} {n WHITESPACE}} EOF {! dot} EOL {/ {t \n} {t \r}} Expression {x {n Sequence} {* {x {n SLASH} {n Sequence}}}} Final {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}} Grammar {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}} GRAPH {x {t <} {t g} {t r} {t a} {t p} {t h} {t >} {n WHITESPACE}} Header {x {n PEG} {n Identifier} {n StartExpr}} Ident {x {/ {t _} {t :} alpha} {* {/ {t _} {t :} alnum}}} Identifier {x {n Ident} {n WHITESPACE}} IS {x {t <} {t -} {n WHITESPACE}} LEAF {x {t l} {t e} {t a} {t f} {n WHITESPACE}} Literal {/ {x {n APOSTROPH} {* {x {! {n APOSTROPH}} {n Char}}} {n APOSTROPH} {n WHITESPACE}} {x {n DAPOSTROPH} {* {x {! {n DAPOSTROPH}} {n Char}}} {n DAPOSTROPH} {n WHITESPACE}}} LOWER {x {t <} {t l} {t o} {t w} {t e} {t r} {t >} {n WHITESPACE}} NOT {x {t !} {n WHITESPACE}} OPEN {x {t \50} {n WHITESPACE}} OPENB {t \133} PEG {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}} PLUS {x {t +} {n WHITESPACE}} Prefix {x {? {/ {n AND} {n NOT}}} {n Suffix}} Primary {/ {n ALNUM} {n ALPHA} {n ASCII} {n CONTROL} {n DDIGIT} {n DIGIT} {n GRAPH} {n LOWER} {n PRINTABLE} {n PUNCT} {n SPACE} {n UPPER} {n WORDCHAR} {n XDIGIT} {n Identifier} {x {n OPEN} {n Expression} {n CLOSE}} {n Literal} {n Class} {n DOT}} PRINTABLE {x {t <} {t p} {t r} {t i} {t n} {t t} {t >} {n WHITESPACE}} PUNCT {x {t <} {t p} {t u} {t n} {t c} {t t} {t >} {n WHITESPACE}} QUESTION {x {t ?} {n WHITESPACE}} Range {/ {x {n Char} {n TO} {n Char}} {n Char}} |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_container-templated-incremental/3_peg_itself.
︙ | ︙ | |||
99 100 101 102 103 104 105 | $myg mode DIGIT leaf $myg rule DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} $myg add DOT $myg mode DOT leaf $myg rule DOT {x {t .} {n WHITESPACE}} | < < < < | | 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 | $myg mode DIGIT leaf $myg rule DIGIT {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} $myg add DOT $myg mode DOT leaf $myg rule DOT {x {t .} {n WHITESPACE}} $myg add EOF $myg mode EOF void $myg rule EOF {! dot} $myg add EOL $myg mode EOL void $myg rule EOL {/ {t \n} {t \r}} $myg add Expression $myg mode Expression value $myg rule Expression {x {n Sequence} {* {x {n SLASH} {n Sequence}}}} $myg add Final $myg mode Final void $myg rule Final {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}} $myg add Grammar $myg mode Grammar value $myg rule Grammar {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}} $myg add GRAPH $myg mode GRAPH leaf |
︙ | ︙ | |||
169 170 171 172 173 174 175 | $myg add OPENB $myg mode OPENB void $myg rule OPENB {t \133} $myg add PEG $myg mode PEG void | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | $myg add OPENB $myg mode OPENB void $myg rule OPENB {t \133} $myg add PEG $myg mode PEG void $myg rule PEG {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}} $myg add PLUS $myg mode PLUS leaf $myg rule PLUS {x {t +} {n WHITESPACE}} $myg add Prefix $myg mode Prefix value |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/0_basic_arithmetic.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1705 1706 1707 1708 1709 1710 1711 | static void sym_Sign (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 | static void sym_Sign (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [35] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "cl */", /* 27 = */ "n MulOp", /* 28 = */ "MulOp", /* 29 = */ "n Number", /* 30 = */ "Number", /* 31 = */ "n Sign", /* 32 = */ "Sign", /* 33 = */ "n Term", /* 34 = */ "Term" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'AddOp' */ static void sym_AddOp (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 16)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 16, 15); return; } /* * value Symbol 'Digit' */ static void sym_Digit (RDE_PARAM p) { /* * [0123456789] */ if (rde_param_i_symbol_start (p, 19)) return ; rde_param_i_next_class (p, "0123456789", 17); rde_param_i_symbol_done_leaf (p, 19, 18); return; } /* * value Symbol 'Expression' */ |
︙ | ︙ | |||
1787 1788 1789 1790 1791 1792 1793 | * (Factor) * * * x * (MulOp) * (Factor) */ | | | | 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (p, 23)) return ; choice_20 (p); rde_param_i_symbol_done_d_reduce (p, 23, 22); return; } static void choice_20 (RDE_PARAM p) { /* * / * x |
︙ | ︙ | |||
1825 1826 1827 1828 1829 1830 1831 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); | | | | 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 20); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } static void sequence_18 (RDE_PARAM p) { /* * x |
︙ | ︙ | |||
1897 1898 1899 1900 1901 1902 1903 | * (Term) * * * x * (AddOp) * (Term) */ | | | | 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (p, 25)) return ; sequence_30 (p); rde_param_i_symbol_done_d_reduce (p, 25, 24); return; } static void sequence_30 (RDE_PARAM p) { /* * x * (Term) |
︙ | ︙ | |||
1961 1962 1963 1964 1965 1966 1967 | */ static void sym_MulOp (RDE_PARAM p) { /* * [\u002a\u002f] */ | | | | | | | 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 | */ static void sym_MulOp (RDE_PARAM p) { /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (p, 28)) return ; rde_param_i_next_class (p, "*/", 26); rde_param_i_symbol_done_leaf (p, 28, 27); return; } /* * value Symbol 'Number' */ static void sym_Number (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (p, 30)) return ; sequence_41 (p); rde_param_i_symbol_done_d_reduce (p, 30, 29); return; } static void sequence_41 (RDE_PARAM p) { /* * x * ? |
︙ | ︙ | |||
2041 2042 2043 2044 2045 2046 2047 | */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ | | | | | | | 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 | */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 32)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 32, 31); return; } /* * value Symbol 'Term' */ static void sym_Term (RDE_PARAM p) { /* * (Number) */ if (rde_param_i_symbol_start_d (p, 34)) return ; sym_Number (p); rde_param_i_symbol_done_d_reduce (p, 34, 33); return; } } ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# |
︙ | ︙ | |||
2102 2103 2104 2105 2106 2107 2108 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/10_notahead.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1689 1690 1691 1692 1693 1694 1695 | static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | > > > > > > > > > > > > > > | 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 | static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { |
︙ | ︙ | |||
1716 1717 1718 1719 1720 1721 1722 | /* * x * ! * 'a' * (IDENTIFIER) */ | | | | 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | /* * x * ! * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_6 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_6 (RDE_PARAM p) { /* * x * ! |
︙ | ︙ | |||
1746 1747 1748 1749 1750 1751 1752 | static void notahead_3 (RDE_PARAM p) { /* * ! * 'a' */ rde_param_i_loc_push (p); | | | 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 | static void notahead_3 (RDE_PARAM p) { /* * ! * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); rde_param_i_notahead_exit (p); return; } } ## END of GENERATED CODE. DO NOT EDIT. |
︙ | ︙ | |||
1791 1792 1793 1794 1795 1796 1797 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/11_epsilon.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1687 1688 1689 1690 1691 1692 1693 | static void choice_3 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 | static void choice_3 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { choice_3 (p); return; } static void choice_3 (RDE_PARAM p) { /* * / * 'a' * <epsilon> */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_bra_void2void(p)) return; rde_param_i_status_ok (p); rde_param_i_state_merge_void (p); return; } } |
︙ | ︙ | |||
1755 1756 1757 1758 1759 1760 1761 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/1_functions.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1690 1691 1692 1693 1694 1695 1696 | static void sequence_9 (RDE_PARAM p); static void sym_Sinus (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | | | 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 | static void sequence_9 (RDE_PARAM p); static void sym_Sinus (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [22] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "n Expression", /* 15 = */ "Expression", /* 16 = */ "n Function", /* 17 = */ "Function", /* 18 = */ "str sin(", /* 19 = */ "t )", /* 20 = */ "n Sinus", /* 21 = */ "Sinus" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * (Function) */ if (rde_param_i_symbol_start_d (p, 15)) return ; sym_Function (p); rde_param_i_symbol_done_d_reduce (p, 15, 14); return; } /* * value Symbol 'Function' */ static void sym_Function (RDE_PARAM p) { /* * (Sinus) */ if (rde_param_i_symbol_start_d (p, 17)) return ; sym_Sinus (p); rde_param_i_symbol_done_d_reduce (p, 17, 16); return; } /* * value Symbol 'Sinus' */ static void sym_Sinus (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (p, 21)) return ; sequence_9 (p); rde_param_i_symbol_done_d_reduce (p, 21, 20); return; } static void sequence_9 (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "sin(", 18); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 19); rde_param_i_state_merge_value (p); return; } } ## END of GENERATED CODE. DO NOT EDIT. |
︙ | ︙ | |||
1816 1817 1818 1819 1820 1821 1822 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/2_fun_arithmetic.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1708 1709 1710 1711 1712 1713 1714 | static void sym_Sinus (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 | static void sym_Sinus (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [40] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "n Function", /* 27 = */ "Function", /* 28 = */ "cl */", /* 29 = */ "n MulOp", /* 30 = */ "MulOp", /* 31 = */ "n Number", /* 32 = */ "Number", /* 33 = */ "n Sign", /* 34 = */ "Sign", /* 35 = */ "str sin(", /* 36 = */ "n Sinus", /* 37 = */ "Sinus", /* 38 = */ "n Term", /* 39 = */ "Term" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'AddOp' */ static void sym_AddOp (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 16)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 16, 15); return; } /* * value Symbol 'Digit' */ static void sym_Digit (RDE_PARAM p) { /* * [0123456789] */ if (rde_param_i_symbol_start (p, 19)) return ; rde_param_i_next_class (p, "0123456789", 17); rde_param_i_symbol_done_leaf (p, 19, 18); return; } /* * value Symbol 'Expression' */ |
︙ | ︙ | |||
1796 1797 1798 1799 1800 1801 1802 | * (Factor) * * * x * (MulOp) * (Factor) */ | | | | 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 | * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (p, 23)) return ; choice_21 (p); rde_param_i_symbol_done_d_reduce (p, 23, 22); return; } static void choice_21 (RDE_PARAM p) { /* * / * (Function) |
︙ | ︙ | |||
1837 1838 1839 1840 1841 1842 1843 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); | | | | 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 20); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } static void sequence_19 (RDE_PARAM p) { /* * x |
︙ | ︙ | |||
1909 1910 1911 1912 1913 1914 1915 | * (Term) * * * x * (AddOp) * (Term) */ | | | | 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 | * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (p, 25)) return ; sequence_31 (p); rde_param_i_symbol_done_d_reduce (p, 25, 24); return; } static void sequence_31 (RDE_PARAM p) { /* * x * (Term) |
︙ | ︙ | |||
1973 1974 1975 1976 1977 1978 1979 | */ static void sym_Function (RDE_PARAM p) { /* * (Sinus) */ | | | | | | | | | 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 | */ static void sym_Function (RDE_PARAM p) { /* * (Sinus) */ if (rde_param_i_symbol_start_d (p, 27)) return ; sym_Sinus (p); rde_param_i_symbol_done_d_reduce (p, 27, 26); return; } /* * value Symbol 'MulOp' */ static void sym_MulOp (RDE_PARAM p) { /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (p, 30)) return ; rde_param_i_next_class (p, "*/", 28); rde_param_i_symbol_done_leaf (p, 30, 29); return; } /* * value Symbol 'Number' */ static void sym_Number (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (p, 32)) return ; sequence_44 (p); rde_param_i_symbol_done_d_reduce (p, 32, 31); return; } static void sequence_44 (RDE_PARAM p) { /* * x * ? |
︙ | ︙ | |||
2068 2069 2070 2071 2072 2073 2074 | */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ | | | | | | | | | | | 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 34)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 34, 33); return; } /* * value Symbol 'Sinus' */ static void sym_Sinus (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (p, 37)) return ; sequence_52 (p); rde_param_i_symbol_done_d_reduce (p, 37, 36); return; } static void sequence_52 (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "sin(", 35); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Term' */ static void sym_Term (RDE_PARAM p) { /* * (Number) */ if (rde_param_i_symbol_start_d (p, 39)) return ; sym_Number (p); rde_param_i_symbol_done_d_reduce (p, 39, 38); return; } } ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# |
︙ | ︙ | |||
2165 2166 2167 2168 2169 2170 2171 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/3_peg_itself.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 | static void optional_137 (RDE_PARAM p); static void sequence_143 (RDE_PARAM p); static void sym_Definition (RDE_PARAM p); static void sequence_148 (RDE_PARAM p); static void sym_DIGIT (RDE_PARAM p); static void sequence_153 (RDE_PARAM p); static void sym_DOT (RDE_PARAM p); | < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > | 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 | static void optional_137 (RDE_PARAM p); static void sequence_143 (RDE_PARAM p); static void sym_Definition (RDE_PARAM p); static void sequence_148 (RDE_PARAM p); static void sym_DIGIT (RDE_PARAM p); static void sequence_153 (RDE_PARAM p); static void sym_DOT (RDE_PARAM p); static void notahead_157 (RDE_PARAM p); static void sym_EOF (RDE_PARAM p); static void sym_EOL (RDE_PARAM p); static void sequence_165 (RDE_PARAM p); static void kleene_167 (RDE_PARAM p); static void sequence_169 (RDE_PARAM p); static void sym_Expression (RDE_PARAM p); static void sequence_176 (RDE_PARAM p); static void sym_Final (RDE_PARAM p); static void kleene_182 (RDE_PARAM p); static void sequence_186 (RDE_PARAM p); static void sym_Grammar (RDE_PARAM p); static void sequence_191 (RDE_PARAM p); static void sym_GRAPH (RDE_PARAM p); static void sequence_197 (RDE_PARAM p); static void sym_Header (RDE_PARAM p); static void choice_202 (RDE_PARAM p); static void choice_206 (RDE_PARAM p); static void kleene_208 (RDE_PARAM p); static void sequence_210 (RDE_PARAM p); static void sym_Ident (RDE_PARAM p); static void sequence_215 (RDE_PARAM p); static void sym_Identifier (RDE_PARAM p); static void sequence_220 (RDE_PARAM p); static void sym_IS (RDE_PARAM p); static void sequence_225 (RDE_PARAM p); static void sym_LEAF (RDE_PARAM p); static void notahead_230 (RDE_PARAM p); static void sequence_233 (RDE_PARAM p); static void kleene_235 (RDE_PARAM p); static void sequence_239 (RDE_PARAM p); static void notahead_243 (RDE_PARAM p); static void sequence_246 (RDE_PARAM p); static void kleene_248 (RDE_PARAM p); static void sequence_252 (RDE_PARAM p); static void choice_254 (RDE_PARAM p); static void sym_Literal (RDE_PARAM p); static void sequence_259 (RDE_PARAM p); static void sym_LOWER (RDE_PARAM p); static void sequence_264 (RDE_PARAM p); static void sym_NOT (RDE_PARAM p); static void sequence_269 (RDE_PARAM p); static void sym_OPEN (RDE_PARAM p); static void sym_OPENB (RDE_PARAM p); static void notahead_278 (RDE_PARAM p); static void sequence_281 (RDE_PARAM p); static void sym_PEG (RDE_PARAM p); static void sequence_286 (RDE_PARAM p); static void sym_PLUS (RDE_PARAM p); static void choice_291 (RDE_PARAM p); static void optional_293 (RDE_PARAM p); static void sequence_296 (RDE_PARAM p); static void sym_Prefix (RDE_PARAM p); static void sequence_317 (RDE_PARAM p); static void choice_322 (RDE_PARAM p); static void sym_Primary (RDE_PARAM p); static void sequence_327 (RDE_PARAM p); static void sym_PRINTABLE (RDE_PARAM p); static void sequence_332 (RDE_PARAM p); static void sym_PUNCT (RDE_PARAM p); static void sequence_337 (RDE_PARAM p); static void sym_QUESTION (RDE_PARAM p); static void sequence_343 (RDE_PARAM p); static void choice_346 (RDE_PARAM p); static void sym_Range (RDE_PARAM p); static void sequence_351 (RDE_PARAM p); static void sym_SEMICOLON (RDE_PARAM p); static void poskleene_355 (RDE_PARAM p); static void sym_Sequence (RDE_PARAM p); static void sequence_360 (RDE_PARAM p); static void sym_SLASH (RDE_PARAM p); static void sequence_365 (RDE_PARAM p); static void sym_SPACE (RDE_PARAM p); static void sequence_370 (RDE_PARAM p); static void sym_STAR (RDE_PARAM p); static void sym_StartExpr (RDE_PARAM p); static void choice_382 (RDE_PARAM p); static void optional_384 (RDE_PARAM p); static void sequence_386 (RDE_PARAM p); static void sym_Suffix (RDE_PARAM p); static void sym_TO (RDE_PARAM p); static void sequence_393 (RDE_PARAM p); static void sym_UPPER (RDE_PARAM p); static void sequence_398 (RDE_PARAM p); static void sym_VOID (RDE_PARAM p); static void choice_403 (RDE_PARAM p); static void kleene_405 (RDE_PARAM p); static void sym_WHITESPACE (RDE_PARAM p); static void sequence_410 (RDE_PARAM p); static void sym_WORDCHAR (RDE_PARAM p); static void sequence_415 (RDE_PARAM p); static void sym_XDIGIT (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [178] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str <alnum>", /* 15 = */ "n ALNUM", /* 16 = */ "ALNUM", /* 17 = */ "str <alpha>", /* 18 = */ "n ALPHA", /* 19 = */ "ALPHA", /* 20 = */ "t &", /* 21 = */ "n AND", /* 22 = */ "AND", /* 23 = */ "t '", /* 24 = */ "n APOSTROPH", /* 25 = */ "APOSTROPH", /* 26 = */ "str <ascii>", /* 27 = */ "n ASCII", /* 28 = */ "ASCII", /* 29 = */ "n Attribute", /* 30 = */ "Attribute", /* 31 = */ "n Char", /* 32 = */ "Char", /* 33 = */ "t \\\\", /* 34 = */ ".. 0 2", /* 35 = */ ".. 0 7", /* 36 = */ "n CharOctalFull", /* 37 = */ "CharOctalFull", /* 38 = */ "n CharOctalPart", /* 39 = */ "CharOctalPart", /* 40 = */ "cl nrt'\\\"\\[\\]\\\\", /* 41 = */ "n CharSpecial", /* 42 = */ "CharSpecial", /* 43 = */ "dot", /* 44 = */ "n CharUnescaped", /* 45 = */ "CharUnescaped", /* 46 = */ "str \173\\u\175", /* 47 = */ "n CharUnicode", /* 48 = */ "CharUnicode", /* 49 = */ "n Class", /* 50 = */ "Class", /* 51 = */ "t )", /* 52 = */ "n CLOSE", /* 53 = */ "CLOSE", /* 54 = */ "t \\]", /* 55 = */ "n CLOSEB", /* 56 = */ "CLOSEB", /* 57 = */ "t :", /* 58 = */ "n COLON", /* 59 = */ "COLON", /* 60 = */ "t #", /* 61 = */ "n COMMENT", /* 62 = */ "COMMENT", /* 63 = */ "str <control>", /* 64 = */ "n CONTROL", /* 65 = */ "CONTROL", /* 66 = */ "t \173\"\175", /* 67 = */ "n DAPOSTROPH", /* 68 = */ "DAPOSTROPH", /* 69 = */ "str <ddigit>", /* 70 = */ "n DDIGIT", /* 71 = */ "DDIGIT", /* 72 = */ "n Definition", /* 73 = */ "Definition", /* 74 = */ "str <digit>", /* 75 = */ "n DIGIT", /* 76 = */ "DIGIT", /* 77 = */ "t .", /* 78 = */ "n DOT", /* 79 = */ "DOT", /* 80 = */ "n EOF", /* 81 = */ "EOF", /* 82 = */ "cl \173\n\r\175", /* 83 = */ "n EOL", /* 84 = */ "EOL", /* 85 = */ "n Expression", /* 86 = */ "Expression", /* 87 = */ "str END", /* 88 = */ "n Final", /* 89 = */ "Final", /* 90 = */ "n Grammar", /* 91 = */ "Grammar", /* 92 = */ "str <graph>", /* 93 = */ "n GRAPH", /* 94 = */ "GRAPH", /* 95 = */ "n Header", /* 96 = */ "Header", /* 97 = */ "cl _:", /* 98 = */ "n Ident", /* 99 = */ "Ident", /* 100 = */ "n Identifier", /* 101 = */ "Identifier", /* 102 = */ "str <-", /* 103 = */ "n IS", /* 104 = */ "IS", /* 105 = */ "str leaf", /* 106 = */ "n LEAF", /* 107 = */ "LEAF", /* 108 = */ "n Literal", /* 109 = */ "Literal", /* 110 = */ "str <lower>", /* 111 = */ "n LOWER", /* 112 = */ "LOWER", /* 113 = */ "t !", /* 114 = */ "n NOT", /* 115 = */ "NOT", /* 116 = */ "t (", /* 117 = */ "n OPEN", /* 118 = */ "OPEN", /* 119 = */ "t \173[\175", /* 120 = */ "n OPENB", /* 121 = */ "OPENB", /* 122 = */ "str PEG", /* 123 = */ "n PEG", /* 124 = */ "PEG", /* 125 = */ "t +", /* 126 = */ "n PLUS", /* 127 = */ "PLUS", /* 128 = */ "n Prefix", /* 129 = */ "Prefix", /* 130 = */ "n Primary", /* 131 = */ "Primary", /* 132 = */ "str <print>", /* 133 = */ "n PRINTABLE", /* 134 = */ "PRINTABLE", /* 135 = */ "str <punct>", /* 136 = */ "n PUNCT", /* 137 = */ "PUNCT", /* 138 = */ "t ?", /* 139 = */ "n QUESTION", /* 140 = */ "QUESTION", /* 141 = */ "n Range", /* 142 = */ "Range", /* 143 = */ "t \173;\175", /* 144 = */ "n SEMICOLON", /* 145 = */ "SEMICOLON", /* 146 = */ "n Sequence", /* 147 = */ "Sequence", /* 148 = */ "t /", /* 149 = */ "n SLASH", /* 150 = */ "SLASH", /* 151 = */ "str <space>", /* 152 = */ "n SPACE", /* 153 = */ "SPACE", /* 154 = */ "t *", /* 155 = */ "n STAR", /* 156 = */ "STAR", /* 157 = */ "n StartExpr", /* 158 = */ "StartExpr", /* 159 = */ "n Suffix", /* 160 = */ "Suffix", /* 161 = */ "t -", /* 162 = */ "n TO", /* 163 = */ "TO", /* 164 = */ "str <upper>", /* 165 = */ "n UPPER", /* 166 = */ "UPPER", /* 167 = */ "str void", /* 168 = */ "n VOID", /* 169 = */ "VOID", /* 170 = */ "n WHITESPACE", /* 171 = */ "WHITESPACE", /* 172 = */ "str <wordchar>", /* 173 = */ "n WORDCHAR", /* 174 = */ "WORDCHAR", /* 175 = */ "str <xdigit>", /* 176 = */ "n XDIGIT", /* 177 = */ "XDIGIT" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { |
︙ | ︙ | |||
2030 2031 2032 2033 2034 2035 2036 | static void sym_ALNUM (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 | static void sym_ALNUM (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_4 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_4 (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alnum>", 14); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'ALPHA' */ static void sym_ALPHA (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 19)) return ; sequence_9 (p); rde_param_i_symbol_done_leaf (p, 19, 18); return; } static void sequence_9 (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alpha>", 17); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'AND' */ static void sym_AND (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 22)) return ; sequence_14 (p); rde_param_i_symbol_done_leaf (p, 22, 21); return; } static void sequence_14 (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "&", 20); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'APOSTROPH' */ static void sym_APOSTROPH (RDE_PARAM p) { /* * ''' */ if (rde_param_i_symbol_void_start (p, 25)) return ; rde_param_i_next_char (p, "'", 23); rde_param_i_symbol_done_void (p, 25, 24); return; } /* * leaf Symbol 'ASCII' */ static void sym_ASCII (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 28)) return ; sequence_21 (p); rde_param_i_symbol_done_leaf (p, 28, 27); return; } static void sequence_21 (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ascii>", 26); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Attribute' */ static void sym_Attribute (RDE_PARAM p) { /* * x * / * (VOID) * (LEAF) * (COLON) */ if (rde_param_i_symbol_start_d (p, 30)) return ; sequence_29 (p); rde_param_i_symbol_done_d_reduce (p, 30, 29); return; } static void sequence_29 (RDE_PARAM p) { /* * x * / |
︙ | ︙ | |||
2227 2228 2229 2230 2231 2232 2233 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ | | | | 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ if (rde_param_i_symbol_start_d (p, 32)) return ; choice_37 (p); rde_param_i_symbol_done_d_reduce (p, 32, 31); return; } static void choice_37 (RDE_PARAM p) { /* * / * (CharSpecial) |
︙ | ︙ | |||
2270 2271 2272 2273 2274 2275 2276 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ | | | | | | | | | | | | | | | | | | | | | 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 37)) return ; sequence_44 (p); rde_param_i_symbol_done_leaf (p, 37, 36); return; } static void sequence_44 (RDE_PARAM p) { /* * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "2", 34); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharOctalPart' */ static void sym_CharOctalPart (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 39)) return ; sequence_52 (p); rde_param_i_symbol_done_leaf (p, 39, 38); return; } static void sequence_52 (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; optional_50 (p); rde_param_i_state_merge_void (p); return; } static void optional_50 (RDE_PARAM p) { /* * ? * range (0 .. 7) */ rde_param_i_state_push_2 (p); rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_ok (p); return; } /* * leaf Symbol 'CharSpecial' */ static void sym_CharSpecial (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ if (rde_param_i_symbol_start (p, 42)) return ; sequence_57 (p); rde_param_i_symbol_done_leaf (p, 42, 41); return; } static void sequence_57 (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_class (p, "nrt'\"[]\\", 40); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharUnescaped' */ static void sym_CharUnescaped (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ if (rde_param_i_symbol_start (p, 45)) return ; sequence_64 (p); rde_param_i_symbol_done_leaf (p, 45, 44); return; } static void sequence_64 (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ rde_param_i_state_push_void (p); notahead_61 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_61 (RDE_PARAM p) { /* * ! * '\' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "\\", 33); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'CharUnicode' */ |
︙ | ︙ | |||
2444 2445 2446 2447 2448 2449 2450 | * ? * x * <xdigit> * ? * <xdigit> */ | | | | | | 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 | * ? * x * <xdigit> * ? * <xdigit> */ if (rde_param_i_symbol_start (p, 48)) return ; sequence_82 (p); rde_param_i_symbol_done_leaf (p, 48, 47); return; } static void sequence_82 (RDE_PARAM p) { /* * x * "\u" * <xdigit> * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "\\u", 46); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_80 (p); rde_param_i_state_merge_void (p); return; } static void optional_80 (RDE_PARAM p) { |
︙ | ︙ | |||
2505 2506 2507 2508 2509 2510 2511 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); | | | 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_76 (p); rde_param_i_state_merge_void (p); return; } static void optional_76 (RDE_PARAM p) { |
︙ | ︙ | |||
2536 2537 2538 2539 2540 2541 2542 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); | | | | 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_72 (p); rde_param_i_state_merge_void (p); return; } static void optional_72 (RDE_PARAM p) { /* * ? * <xdigit> */ rde_param_i_state_push_2 (p); rde_param_i_next_xdigit (p, 13); rde_param_i_state_merge_ok (p); return; } /* * value Symbol 'Class' */ |
︙ | ︙ | |||
2572 2573 2574 2575 2576 2577 2578 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ | | | | 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 50)) return ; sequence_96 (p); rde_param_i_symbol_done_d_reduce (p, 50, 49); return; } static void sequence_96 (RDE_PARAM p) { /* * x * (OPENB) |
︙ | ︙ | |||
2659 2660 2661 2662 2663 2664 2665 | static void sym_CLOSE (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ | | | | | | | | | | | 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 | static void sym_CLOSE (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 53)) return ; sequence_101 (p); rde_param_i_symbol_done_void (p, 53, 52); return; } static void sequence_101 (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ")", 51); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'CLOSEB' */ static void sym_CLOSEB (RDE_PARAM p) { /* * ']' */ if (rde_param_i_symbol_void_start (p, 56)) return ; rde_param_i_next_char (p, "]", 54); rde_param_i_symbol_done_void (p, 56, 55); return; } /* * void Symbol 'COLON' */ static void sym_COLON (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 59)) return ; sequence_108 (p); rde_param_i_symbol_done_void (p, 59, 58); return; } static void sequence_108 (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ":", 57); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
2743 2744 2745 2746 2747 2748 2749 | * x * ! * (EOL) * <dot> * (EOL) */ | | | | | 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 | * x * ! * (EOL) * <dot> * (EOL) */ if (rde_param_i_symbol_void_start (p, 62)) return ; sequence_121 (p); rde_param_i_symbol_done_void (p, 62, 61); return; } static void sequence_121 (RDE_PARAM p) { /* * x * '#' * * * x * ! * (EOL) * <dot> * (EOL) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "#", 60); if (rde_param_i_seq_void2void(p)) return; kleene_118 (p); if (rde_param_i_seq_void2void(p)) return; sym_EOL (p); rde_param_i_state_merge_void (p); return; } |
︙ | ︙ | |||
2799 2800 2801 2802 2803 2804 2805 | * (EOL) * <dot> */ rde_param_i_state_push_void (p); notahead_113 (p); if (rde_param_i_seq_void2void(p)) return; | | | 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 | * (EOL) * <dot> */ rde_param_i_state_push_void (p); notahead_113 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_113 (RDE_PARAM p) { /* * ! |
︙ | ︙ | |||
2827 2828 2829 2830 2831 2832 2833 | static void sym_CONTROL (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ | | | | | | | | | | | 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 | static void sym_CONTROL (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 65)) return ; sequence_126 (p); rde_param_i_symbol_done_leaf (p, 65, 64); return; } static void sequence_126 (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<control>", 63); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'DAPOSTROPH' */ static void sym_DAPOSTROPH (RDE_PARAM p) { /* * '\"' */ if (rde_param_i_symbol_void_start (p, 68)) return ; rde_param_i_next_char (p, "\"", 66); rde_param_i_symbol_done_void (p, 68, 67); return; } /* * leaf Symbol 'DDIGIT' */ static void sym_DDIGIT (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 71)) return ; sequence_133 (p); rde_param_i_symbol_done_leaf (p, 71, 70); return; } static void sequence_133 (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ddigit>", 69); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
2910 2911 2912 2913 2914 2915 2916 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ | | | | 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ if (rde_param_i_symbol_start_d (p, 73)) return ; sequence_143 (p); rde_param_i_symbol_done_d_reduce (p, 73, 72); return; } static void sequence_143 (RDE_PARAM p) { /* * x * ? |
︙ | ︙ | |||
2964 2965 2966 2967 2968 2969 2970 | static void sym_DIGIT (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ | | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | | | | | | | | 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 | static void sym_DIGIT (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 76)) return ; sequence_148 (p); rde_param_i_symbol_done_leaf (p, 76, 75); return; } static void sequence_148 (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<digit>", 74); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'DOT' */ static void sym_DOT (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 79)) return ; sequence_153 (p); rde_param_i_symbol_done_leaf (p, 79, 78); return; } static void sequence_153 (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ".", 77); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'EOF' */ static void sym_EOF (RDE_PARAM p) { /* * ! * <dot> */ if (rde_param_i_symbol_void_start (p, 81)) return ; notahead_157 (p); rde_param_i_symbol_done_void (p, 81, 80); return; } static void notahead_157 (RDE_PARAM p) { /* * ! * <dot> */ rde_param_i_loc_push (p); rde_param_i_input_next (p, 43); rde_param_i_notahead_exit (p); return; } /* * void Symbol 'EOL' */ static void sym_EOL (RDE_PARAM p) { /* * [\n\r] */ if (rde_param_i_symbol_void_start (p, 84)) return ; rde_param_i_next_class (p, "\n\r", 82); rde_param_i_symbol_done_void (p, 84, 83); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ if (rde_param_i_symbol_start_d (p, 86)) return ; sequence_169 (p); rde_param_i_symbol_done_d_reduce (p, 86, 85); return; } static void sequence_169 (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ rde_param_i_state_push_value (p); sym_Sequence (p); if (rde_param_i_seq_value2value(p)) return; kleene_167 (p); rde_param_i_state_merge_value (p); return; } static void kleene_167 (RDE_PARAM p) { /* * * * x * (SLASH) * (Sequence) */ while (1) { rde_param_i_state_push_2 (p); sequence_165 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_165 (RDE_PARAM p) { /* * x * (SLASH) * (Sequence) */ rde_param_i_state_push_void (p); |
︙ | ︙ | |||
3168 3169 3170 3171 3172 3173 3174 | /* * void Symbol 'Final' */ static void sym_Final (RDE_PARAM p) { /* * x | | > | | | | | > > > | | 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 | /* * void Symbol 'Final' */ static void sym_Final (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 89)) return ; sequence_176 (p); rde_param_i_symbol_done_void (p, 89, 88); return; } static void sequence_176 (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "END", 87); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); if (rde_param_i_seq_void2void(p)) return; sym_SEMICOLON (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } |
︙ | ︙ | |||
3212 3213 3214 3215 3216 3217 3218 | * (Header) * * * (Definition) * (Final) * (EOF) */ | | | | | | | | 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 | * (Header) * * * (Definition) * (Final) * (EOF) */ if (rde_param_i_symbol_start_d (p, 91)) return ; sequence_186 (p); rde_param_i_symbol_done_d_reduce (p, 91, 90); return; } static void sequence_186 (RDE_PARAM p) { /* * x * (WHITESPACE) * (Header) * * * (Definition) * (Final) * (EOF) */ rde_param_i_state_push_void (p); sym_WHITESPACE (p); if (rde_param_i_seq_void2value(p)) return; sym_Header (p); if (rde_param_i_seq_value2value(p)) return; kleene_182 (p); if (rde_param_i_seq_value2value(p)) return; sym_Final (p); if (rde_param_i_seq_value2value(p)) return; sym_EOF (p); rde_param_i_state_merge_value (p); return; } static void kleene_182 (RDE_PARAM p) { /* * * * (Definition) */ while (1) { rde_param_i_state_push_2 (p); |
︙ | ︙ | |||
3268 3269 3270 3271 3272 3273 3274 | static void sym_GRAPH (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ | | | | | | | | | | | 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 | static void sym_GRAPH (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 94)) return ; sequence_191 (p); rde_param_i_symbol_done_leaf (p, 94, 93); return; } static void sequence_191 (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<graph>", 92); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Header' */ static void sym_Header (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ if (rde_param_i_symbol_start_d (p, 96)) return ; sequence_197 (p); rde_param_i_symbol_done_d_reduce (p, 96, 95); return; } static void sequence_197 (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ |
︙ | ︙ | |||
3341 3342 3343 3344 3345 3346 3347 | * <alpha> * * * / * [_:] * <alnum> */ | | | | | | | | | | | | | | | | | | | | 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 | * <alpha> * * * / * [_:] * <alnum> */ if (rde_param_i_symbol_start (p, 99)) return ; sequence_210 (p); rde_param_i_symbol_done_leaf (p, 99, 98); return; } static void sequence_210 (RDE_PARAM p) { /* * x * / * [_:] * <alpha> * * * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); choice_202 (p); if (rde_param_i_seq_void2void(p)) return; kleene_208 (p); rde_param_i_state_merge_void (p); return; } static void choice_202 (RDE_PARAM p) { /* * / * [_:] * <alpha> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alpha (p, 1); rde_param_i_state_merge_void (p); return; } static void kleene_208 (RDE_PARAM p) { /* * * * / * [_:] * <alnum> */ while (1) { rde_param_i_state_push_2 (p); choice_206 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_206 (RDE_PARAM p) { /* * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alnum (p, 0); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Identifier' */ static void sym_Identifier (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 101)) return ; sequence_215 (p); rde_param_i_symbol_done_d_reduce (p, 101, 100); return; } static void sequence_215 (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ rde_param_i_state_push_value (p); |
︙ | ︙ | |||
3456 3457 3458 3459 3460 3461 3462 | static void sym_IS (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ | | | | | | | | | | | | 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 | static void sym_IS (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 104)) return ; sequence_220 (p); rde_param_i_symbol_done_void (p, 104, 103); return; } static void sequence_220 (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<-", 102); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'LEAF' */ static void sym_LEAF (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 107)) return ; sequence_225 (p); rde_param_i_symbol_done_leaf (p, 107, 106); return; } static void sequence_225 (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "leaf", 105); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* |
︙ | ︙ | |||
3536 3537 3538 3539 3540 3541 3542 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ | | | | | | 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 109)) return ; choice_254 (p); rde_param_i_symbol_done_d_reduce (p, 109, 108); return; } static void choice_254 (RDE_PARAM p) { /* * / * x * (APOSTROPH) * * * x * ! |
︙ | ︙ | |||
3566 3567 3568 3569 3570 3571 3572 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (p); | | | | | | | | | | | | | | | | | | 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (p); sequence_239 (p); if (rde_param_i_bra_value2value(p)) return; sequence_252 (p); rde_param_i_state_merge_value (p); return; } static void sequence_239 (RDE_PARAM p) { /* * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_APOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_235 (p); if (rde_param_i_seq_value2value(p)) return; sym_APOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_235 (RDE_PARAM p) { /* * * * x * ! * (APOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_233 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_233 (RDE_PARAM p) { /* * x * ! * (APOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_230 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_230 (RDE_PARAM p) { /* * ! * (APOSTROPH) */ rde_param_i_loc_push (p); sym_APOSTROPH (p); rde_param_i_notahead_exit (p); return; } static void sequence_252 (RDE_PARAM p) { /* * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_DAPOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_248 (p); if (rde_param_i_seq_value2value(p)) return; sym_DAPOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_248 (RDE_PARAM p) { /* * * * x * ! * (DAPOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_246 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_246 (RDE_PARAM p) { /* * x * ! * (DAPOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_243 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_243 (RDE_PARAM p) { /* * ! * (DAPOSTROPH) */ rde_param_i_loc_push (p); sym_DAPOSTROPH (p); |
︙ | ︙ | |||
3724 3725 3726 3727 3728 3729 3730 | static void sym_LOWER (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | > > > > | | | | > > > > | > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 | static void sym_LOWER (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 112)) return ; sequence_259 (p); rde_param_i_symbol_done_leaf (p, 112, 111); return; } static void sequence_259 (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<lower>", 110); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'NOT' */ static void sym_NOT (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 115)) return ; sequence_264 (p); rde_param_i_symbol_done_leaf (p, 115, 114); return; } static void sequence_264 (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "!", 113); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPEN' */ static void sym_OPEN (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 118)) return ; sequence_269 (p); rde_param_i_symbol_done_void (p, 118, 117); return; } static void sequence_269 (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 116); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPENB' */ static void sym_OPENB (RDE_PARAM p) { /* * '[' */ if (rde_param_i_symbol_void_start (p, 121)) return ; rde_param_i_next_char (p, "[", 119); rde_param_i_symbol_done_void (p, 121, 120); return; } /* * void Symbol 'PEG' */ static void sym_PEG (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 124)) return ; sequence_281 (p); rde_param_i_symbol_done_void (p, 124, 123); return; } static void sequence_281 (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "PEG", 122); if (rde_param_i_seq_void2void(p)) return; notahead_278 (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } static void notahead_278 (RDE_PARAM p) { /* * ! * / * [_:] * <alnum> */ rde_param_i_loc_push (p); choice_206 (p); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'PLUS' */ static void sym_PLUS (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 127)) return ; sequence_286 (p); rde_param_i_symbol_done_leaf (p, 127, 126); return; } static void sequence_286 (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "+", 125); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Prefix' */ static void sym_Prefix (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ if (rde_param_i_symbol_start_d (p, 129)) return ; sequence_296 (p); rde_param_i_symbol_done_d_reduce (p, 129, 128); return; } static void sequence_296 (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ rde_param_i_state_push_value (p); optional_293 (p); if (rde_param_i_seq_value2value(p)) return; sym_Suffix (p); rde_param_i_state_merge_value (p); return; } static void optional_293 (RDE_PARAM p) { /* * ? * / * (AND) * (NOT) */ rde_param_i_state_push_2 (p); choice_291 (p); rde_param_i_state_merge_ok (p); return; } static void choice_291 (RDE_PARAM p) { /* * / * (AND) * (NOT) */ rde_param_i_state_push_value (p); |
︙ | ︙ | |||
3986 3987 3988 3989 3990 3991 3992 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ | | | | | | 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ if (rde_param_i_symbol_start_d (p, 131)) return ; choice_322 (p); rde_param_i_symbol_done_d_reduce (p, 131, 130); return; } static void choice_322 (RDE_PARAM p) { /* * / * (ALNUM) * (ALPHA) * (ASCII) * (CONTROL) * (DDIGIT) |
︙ | ︙ | |||
4050 4051 4052 4053 4054 4055 4056 | if (rde_param_i_bra_value2value(p)) return; sym_WORDCHAR (p); if (rde_param_i_bra_value2value(p)) return; sym_XDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_Identifier (p); if (rde_param_i_bra_value2value(p)) return; | | | | 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 | if (rde_param_i_bra_value2value(p)) return; sym_WORDCHAR (p); if (rde_param_i_bra_value2value(p)) return; sym_XDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_Identifier (p); if (rde_param_i_bra_value2value(p)) return; sequence_317 (p); if (rde_param_i_bra_value2value(p)) return; sym_Literal (p); if (rde_param_i_bra_value2value(p)) return; sym_Class (p); if (rde_param_i_bra_value2value(p)) return; sym_DOT (p); rde_param_i_state_merge_value (p); return; } static void sequence_317 (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ |
︙ | ︙ | |||
4090 4091 4092 4093 4094 4095 4096 | static void sym_PRINTABLE (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | static void sym_PRINTABLE (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 134)) return ; sequence_327 (p); rde_param_i_symbol_done_leaf (p, 134, 133); return; } static void sequence_327 (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<print>", 132); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'PUNCT' */ static void sym_PUNCT (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 137)) return ; sequence_332 (p); rde_param_i_symbol_done_leaf (p, 137, 136); return; } static void sequence_332 (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<punct>", 135); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'QUESTION' */ static void sym_QUESTION (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 140)) return ; sequence_337 (p); rde_param_i_symbol_done_leaf (p, 140, 139); return; } static void sequence_337 (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "?", 138); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Range' */ static void sym_Range (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ if (rde_param_i_symbol_start_d (p, 142)) return ; choice_346 (p); rde_param_i_symbol_done_d_reduce (p, 142, 141); return; } static void choice_346 (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ rde_param_i_state_push_value (p); sequence_343 (p); if (rde_param_i_bra_value2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void sequence_343 (RDE_PARAM p) { /* * x * (Char) * (TO) * (Char) */ |
︙ | ︙ | |||
4242 4243 4244 4245 4246 4247 4248 | static void sym_SEMICOLON (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ | | | | | | | | | | | 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 | static void sym_SEMICOLON (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 145)) return ; sequence_351 (p); rde_param_i_symbol_done_void (p, 145, 144); return; } static void sequence_351 (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ";", 143); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Sequence' */ static void sym_Sequence (RDE_PARAM p) { /* * + * (Prefix) */ if (rde_param_i_symbol_start_d (p, 147)) return ; poskleene_355 (p); rde_param_i_symbol_done_d_reduce (p, 147, 146); return; } static void poskleene_355 (RDE_PARAM p) { /* * + * (Prefix) */ rde_param_i_loc_push (p); sym_Prefix (p); |
︙ | ︙ | |||
4307 4308 4309 4310 4311 4312 4313 | static void sym_SLASH (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 | static void sym_SLASH (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 150)) return ; sequence_360 (p); rde_param_i_symbol_done_void (p, 150, 149); return; } static void sequence_360 (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "/", 148); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'SPACE' */ static void sym_SPACE (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 153)) return ; sequence_365 (p); rde_param_i_symbol_done_leaf (p, 153, 152); return; } static void sequence_365 (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<space>", 151); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'STAR' */ static void sym_STAR (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 156)) return ; sequence_370 (p); rde_param_i_symbol_done_leaf (p, 156, 155); return; } static void sequence_370 (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "*", 154); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'StartExpr' */ static void sym_StartExpr (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ if (rde_param_i_symbol_start_d (p, 158)) return ; sequence_317 (p); rde_param_i_symbol_done_d_reduce (p, 158, 157); return; } /* * value Symbol 'Suffix' */ static void sym_Suffix (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ if (rde_param_i_symbol_start_d (p, 160)) return ; sequence_386 (p); rde_param_i_symbol_done_d_reduce (p, 160, 159); return; } static void sequence_386 (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_value (p); sym_Primary (p); if (rde_param_i_seq_value2value(p)) return; optional_384 (p); rde_param_i_state_merge_value (p); return; } static void optional_384 (RDE_PARAM p) { /* * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_2 (p); choice_382 (p); rde_param_i_state_merge_ok (p); return; } static void choice_382 (RDE_PARAM p) { /* * / * (QUESTION) * (STAR) * (PLUS) */ |
︙ | ︙ | |||
4492 4493 4494 4495 4496 4497 4498 | */ static void sym_TO (RDE_PARAM p) { /* * '-' */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 | */ static void sym_TO (RDE_PARAM p) { /* * '-' */ if (rde_param_i_symbol_void_start (p, 163)) return ; rde_param_i_next_char (p, "-", 161); rde_param_i_symbol_done_void (p, 163, 162); return; } /* * leaf Symbol 'UPPER' */ static void sym_UPPER (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 166)) return ; sequence_393 (p); rde_param_i_symbol_done_leaf (p, 166, 165); return; } static void sequence_393 (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<upper>", 164); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'VOID' */ static void sym_VOID (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 169)) return ; sequence_398 (p); rde_param_i_symbol_done_leaf (p, 169, 168); return; } static void sequence_398 (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "void", 167); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'WHITESPACE' */ static void sym_WHITESPACE (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ if (rde_param_i_symbol_void_start (p, 171)) return ; kleene_405 (p); rde_param_i_symbol_done_void (p, 171, 170); return; } static void kleene_405 (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ while (1) { rde_param_i_state_push_2 (p); choice_403 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_403 (RDE_PARAM p) { /* * / * <space> * (COMMENT) */ rde_param_i_state_push_void (p); rde_param_i_next_space (p, 10); if (rde_param_i_bra_void2void(p)) return; sym_COMMENT (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'WORDCHAR' */ static void sym_WORDCHAR (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 174)) return ; sequence_410 (p); rde_param_i_symbol_done_leaf (p, 174, 173); return; } static void sequence_410 (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<wordchar>", 172); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'XDIGIT' */ static void sym_XDIGIT (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 177)) return ; sequence_415 (p); rde_param_i_symbol_done_leaf (p, 177, 176); return; } static void sequence_415 (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<xdigit>", 175); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } } |
︙ | ︙ | |||
4715 4716 4717 4718 4719 4720 4721 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/4_choice.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1686 1687 1688 1689 1690 1691 1692 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl abc" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { rde_param_i_next_class (p, "abc", 14); return; } } ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# |
︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/5_sequence.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1686 1687 1688 1689 1690 1691 1692 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str abc" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { rde_param_i_next_str (p, "abc", 14); return; } } ## END of GENERATED CODE. DO NOT EDIT. # # ## ### ###### ######## ############# |
︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/6_optional.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1687 1688 1689 1690 1691 1692 1693 | static void optional_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 | static void optional_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { optional_2 (p); return; } static void optional_2 (RDE_PARAM p) { /* * ? * 'a' */ rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); rde_param_i_state_merge_ok (p); return; } } ## END of GENERATED CODE. DO NOT EDIT. |
︙ | ︙ | |||
1752 1753 1754 1755 1756 1757 1758 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/7_kleene.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1687 1688 1689 1690 1691 1692 1693 | static void kleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 | static void kleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { kleene_2 (p); return; } static void kleene_2 (RDE_PARAM p) { /* * * * 'a' */ while (1) { rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_close(p)) return; } return; } } |
︙ | ︙ | |||
1754 1755 1756 1757 1758 1759 1760 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/8_pkleene.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1687 1688 1689 1690 1691 1692 1693 | static void poskleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | | 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 | static void poskleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { poskleene_2 (p); return; } static void poskleene_2 (RDE_PARAM p) { /* * + * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_abort(p)) return; while (1) { rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_close(p)) return; } return; } } |
︙ | ︙ | |||
1757 1758 1759 1760 1761 1762 1763 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_cparam-critcl/9_ahead.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## namespace eval ::PARSER { # # ## ### ##### ######## ############# ##################### ## Supporting code for the main command. catch { #critcl::cflags -g #critcl::debug memory symbols } # # ## ### ###### ######## ############# ## RDE runtime, inlined, and made static. # This is the C code for the RDE, i.e. the implementation |
︙ | ︙ | |||
382 383 384 385 386 387 388 389 390 391 392 393 394 395 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; | > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; |
︙ | ︙ | |||
411 412 413 414 415 416 417 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; | | | | | | | | | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } |
︙ | ︙ | |||
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); | > | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void | | | | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* |
︙ | ︙ | |||
686 687 688 689 690 691 692 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; | | | | | | | | | | > > > > > | 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 | if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int |
︙ | ︙ | |||
768 769 770 771 772 773 774 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); | | | | 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 | SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void |
︙ | ︙ | |||
816 817 818 819 820 821 822 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void | | > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } |
︙ | ︙ | |||
870 871 872 873 874 875 876 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void | | | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); |
︙ | ︙ | |||
912 913 914 915 916 917 918 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void | | > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { |
︙ | ︙ | |||
958 959 960 961 962 963 964 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int | | | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } |
︙ | ︙ | |||
981 982 983 984 985 986 987 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void | | | 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); |
︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void | > > > > > | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void | | | | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); |
︙ | ︙ | |||
1204 1205 1206 1207 1208 1209 1210 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { | | > > > | | | | | | | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) |
︙ | ︙ | |||
1499 1500 1501 1502 1503 1504 1505 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); | | | | > > > | | 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 | rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); |
︙ | ︙ | |||
1689 1690 1691 1692 1693 1694 1695 | static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | > > > > > > > > > > > > > > | 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 | static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { |
︙ | ︙ | |||
1716 1717 1718 1719 1720 1721 1722 | /* * x * & * 'a' * (IDENTIFIER) */ | | | | 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | /* * x * & * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_6 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_6 (RDE_PARAM p) { /* * x * & |
︙ | ︙ | |||
1746 1747 1748 1749 1750 1751 1752 | static void ahead_3 (RDE_PARAM p) { /* * & * 'a' */ rde_param_i_loc_push (p); | | | 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 | static void ahead_3 (RDE_PARAM p) { /* * & * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); rde_param_i_loc_pop_rewind (p); return; } } ## END of GENERATED CODE. DO NOT EDIT. |
︙ | ︙ | |||
1791 1792 1793 1794 1795 1796 1797 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; | | | 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { |
︙ | ︙ | |||
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { | > < < < < | > > > > > > > > > | > | 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 | rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } } # # ## ### ##### ######## ############# |
︙ | ︙ |
Added modules/pt/tests/data/ok/peg_cparam-tea/0_basic_arithmetic.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void sym_AddOp (RDE_PARAM p); static void sym_Digit (RDE_PARAM p); static void sequence_9 (RDE_PARAM p); static void sequence_14 (RDE_PARAM p); static void kleene_16 (RDE_PARAM p); static void sequence_18 (RDE_PARAM p); static void choice_20 (RDE_PARAM p); static void sym_Expression (RDE_PARAM p); static void sequence_26 (RDE_PARAM p); static void kleene_28 (RDE_PARAM p); static void sequence_30 (RDE_PARAM p); static void sym_Factor (RDE_PARAM p); static void sym_MulOp (RDE_PARAM p); static void optional_36 (RDE_PARAM p); static void poskleene_39 (RDE_PARAM p); static void sequence_41 (RDE_PARAM p); static void sym_Number (RDE_PARAM p); static void sym_Sign (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [35] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "cl */", /* 27 = */ "n MulOp", /* 28 = */ "MulOp", /* 29 = */ "n Number", /* 30 = */ "Number", /* 31 = */ "n Sign", /* 32 = */ "Sign", /* 33 = */ "n Term", /* 34 = */ "Term" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'AddOp' */ static void sym_AddOp (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 16)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 16, 15); return; } /* * value Symbol 'Digit' */ static void sym_Digit (RDE_PARAM p) { /* * [0123456789] */ if (rde_param_i_symbol_start (p, 19)) return ; rde_param_i_next_class (p, "0123456789", 17); rde_param_i_symbol_done_leaf (p, 19, 18); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * / * x * '\(' * (Expression) * '\)' * x * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (p, 23)) return ; choice_20 (p); rde_param_i_symbol_done_d_reduce (p, 23, 22); return; } static void choice_20 (RDE_PARAM p) { /* * / * x * '\(' * (Expression) * '\)' * x * (Factor) * * * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sequence_9 (p); if (rde_param_i_bra_value2value(p)) return; sequence_18 (p); rde_param_i_state_merge_value (p); return; } static void sequence_9 (RDE_PARAM p) { /* * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 20); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } static void sequence_18 (RDE_PARAM p) { /* * x * (Factor) * * * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sym_Factor (p); if (rde_param_i_seq_value2value(p)) return; kleene_16 (p); rde_param_i_state_merge_value (p); return; } static void kleene_16 (RDE_PARAM p) { /* * * * x * (MulOp) * (Factor) */ while (1) { rde_param_i_state_push_2 (p); sequence_14 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_14 (RDE_PARAM p) { /* * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sym_MulOp (p); if (rde_param_i_seq_value2value(p)) return; sym_Factor (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Factor' */ static void sym_Factor (RDE_PARAM p) { /* * x * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (p, 25)) return ; sequence_30 (p); rde_param_i_symbol_done_d_reduce (p, 25, 24); return; } static void sequence_30 (RDE_PARAM p) { /* * x * (Term) * * * x * (AddOp) * (Term) */ rde_param_i_state_push_value (p); sym_Term (p); if (rde_param_i_seq_value2value(p)) return; kleene_28 (p); rde_param_i_state_merge_value (p); return; } static void kleene_28 (RDE_PARAM p) { /* * * * x * (AddOp) * (Term) */ while (1) { rde_param_i_state_push_2 (p); sequence_26 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_26 (RDE_PARAM p) { /* * x * (AddOp) * (Term) */ rde_param_i_state_push_value (p); sym_AddOp (p); if (rde_param_i_seq_value2value(p)) return; sym_Term (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'MulOp' */ static void sym_MulOp (RDE_PARAM p) { /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (p, 28)) return ; rde_param_i_next_class (p, "*/", 26); rde_param_i_symbol_done_leaf (p, 28, 27); return; } /* * value Symbol 'Number' */ static void sym_Number (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (p, 30)) return ; sequence_41 (p); rde_param_i_symbol_done_d_reduce (p, 30, 29); return; } static void sequence_41 (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ rde_param_i_state_push_value (p); optional_36 (p); if (rde_param_i_seq_value2value(p)) return; poskleene_39 (p); rde_param_i_state_merge_value (p); return; } static void optional_36 (RDE_PARAM p) { /* * ? * (Sign) */ rde_param_i_state_push_2 (p); sym_Sign (p); rde_param_i_state_merge_ok (p); return; } static void poskleene_39 (RDE_PARAM p) { /* * + * (Digit) */ rde_param_i_loc_push (p); sym_Digit (p); if (rde_param_i_kleene_abort(p)) return; while (1) { rde_param_i_state_push_2 (p); sym_Digit (p); if (rde_param_i_kleene_close(p)) return; } return; } /* * value Symbol 'Sign' */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 32)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 32, 31); return; } /* * value Symbol 'Term' */ static void sym_Term (RDE_PARAM p) { /* * (Number) */ if (rde_param_i_symbol_start_d (p, 34)) return ; sym_Number (p); rde_param_i_symbol_done_d_reduce (p, 34, 33); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/10_notahead.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void notahead_3 (RDE_PARAM p); static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_TEST (p); return; } /* * value Symbol 'TEST' */ static void sym_TEST (RDE_PARAM p) { /* * x * ! * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_6 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_6 (RDE_PARAM p) { /* * x * ! * 'a' * (IDENTIFIER) */ rde_param_i_state_push_void (p); notahead_3 (p); if (rde_param_i_seq_void2void(p)) return; /* Undefined symbol 'IDENTIFIER' */; rde_param_i_status_fail (p); rde_param_i_state_merge_void (p); return; } static void notahead_3 (RDE_PARAM p) { /* * ! * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); rde_param_i_notahead_exit (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/11_epsilon.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void choice_3 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { choice_3 (p); return; } static void choice_3 (RDE_PARAM p) { /* * / * 'a' * <epsilon> */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_bra_void2void(p)) return; rde_param_i_status_ok (p); rde_param_i_state_merge_void (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/1_functions.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void sym_Expression (RDE_PARAM p); static void sym_Function (RDE_PARAM p); static void sequence_9 (RDE_PARAM p); static void sym_Sinus (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [22] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "n Expression", /* 15 = */ "Expression", /* 16 = */ "n Function", /* 17 = */ "Function", /* 18 = */ "str sin(", /* 19 = */ "t )", /* 20 = */ "n Sinus", /* 21 = */ "Sinus" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * (Function) */ if (rde_param_i_symbol_start_d (p, 15)) return ; sym_Function (p); rde_param_i_symbol_done_d_reduce (p, 15, 14); return; } /* * value Symbol 'Function' */ static void sym_Function (RDE_PARAM p) { /* * (Sinus) */ if (rde_param_i_symbol_start_d (p, 17)) return ; sym_Sinus (p); rde_param_i_symbol_done_d_reduce (p, 17, 16); return; } /* * value Symbol 'Sinus' */ static void sym_Sinus (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (p, 21)) return ; sequence_9 (p); rde_param_i_symbol_done_d_reduce (p, 21, 20); return; } static void sequence_9 (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "sin(", 18); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 19); rde_param_i_state_merge_value (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/2_fun_arithmetic.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void sym_AddOp (RDE_PARAM p); static void sym_Digit (RDE_PARAM p); static void sequence_10 (RDE_PARAM p); static void sequence_15 (RDE_PARAM p); static void kleene_17 (RDE_PARAM p); static void sequence_19 (RDE_PARAM p); static void choice_21 (RDE_PARAM p); static void sym_Expression (RDE_PARAM p); static void sequence_27 (RDE_PARAM p); static void kleene_29 (RDE_PARAM p); static void sequence_31 (RDE_PARAM p); static void sym_Factor (RDE_PARAM p); static void sym_Function (RDE_PARAM p); static void sym_MulOp (RDE_PARAM p); static void optional_39 (RDE_PARAM p); static void poskleene_42 (RDE_PARAM p); static void sequence_44 (RDE_PARAM p); static void sym_Number (RDE_PARAM p); static void sym_Sign (RDE_PARAM p); static void sequence_52 (RDE_PARAM p); static void sym_Sinus (RDE_PARAM p); static void sym_Term (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [40] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "n Function", /* 27 = */ "Function", /* 28 = */ "cl */", /* 29 = */ "n MulOp", /* 30 = */ "MulOp", /* 31 = */ "n Number", /* 32 = */ "Number", /* 33 = */ "n Sign", /* 34 = */ "Sign", /* 35 = */ "str sin(", /* 36 = */ "n Sinus", /* 37 = */ "Sinus", /* 38 = */ "n Term", /* 39 = */ "Term" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Expression (p); return; } /* * value Symbol 'AddOp' */ static void sym_AddOp (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 16)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 16, 15); return; } /* * value Symbol 'Digit' */ static void sym_Digit (RDE_PARAM p) { /* * [0123456789] */ if (rde_param_i_symbol_start (p, 19)) return ; rde_param_i_next_class (p, "0123456789", 17); rde_param_i_symbol_done_leaf (p, 19, 18); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * / * (Function) * x * '\(' * (Expression) * '\)' * x * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (p, 23)) return ; choice_21 (p); rde_param_i_symbol_done_d_reduce (p, 23, 22); return; } static void choice_21 (RDE_PARAM p) { /* * / * (Function) * x * '\(' * (Expression) * '\)' * x * (Factor) * * * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sym_Function (p); if (rde_param_i_bra_value2value(p)) return; sequence_10 (p); if (rde_param_i_bra_value2value(p)) return; sequence_19 (p); rde_param_i_state_merge_value (p); return; } static void sequence_10 (RDE_PARAM p) { /* * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 20); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } static void sequence_19 (RDE_PARAM p) { /* * x * (Factor) * * * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sym_Factor (p); if (rde_param_i_seq_value2value(p)) return; kleene_17 (p); rde_param_i_state_merge_value (p); return; } static void kleene_17 (RDE_PARAM p) { /* * * * x * (MulOp) * (Factor) */ while (1) { rde_param_i_state_push_2 (p); sequence_15 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_15 (RDE_PARAM p) { /* * x * (MulOp) * (Factor) */ rde_param_i_state_push_value (p); sym_MulOp (p); if (rde_param_i_seq_value2value(p)) return; sym_Factor (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Factor' */ static void sym_Factor (RDE_PARAM p) { /* * x * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (p, 25)) return ; sequence_31 (p); rde_param_i_symbol_done_d_reduce (p, 25, 24); return; } static void sequence_31 (RDE_PARAM p) { /* * x * (Term) * * * x * (AddOp) * (Term) */ rde_param_i_state_push_value (p); sym_Term (p); if (rde_param_i_seq_value2value(p)) return; kleene_29 (p); rde_param_i_state_merge_value (p); return; } static void kleene_29 (RDE_PARAM p) { /* * * * x * (AddOp) * (Term) */ while (1) { rde_param_i_state_push_2 (p); sequence_27 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_27 (RDE_PARAM p) { /* * x * (AddOp) * (Term) */ rde_param_i_state_push_value (p); sym_AddOp (p); if (rde_param_i_seq_value2value(p)) return; sym_Term (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Function' */ static void sym_Function (RDE_PARAM p) { /* * (Sinus) */ if (rde_param_i_symbol_start_d (p, 27)) return ; sym_Sinus (p); rde_param_i_symbol_done_d_reduce (p, 27, 26); return; } /* * value Symbol 'MulOp' */ static void sym_MulOp (RDE_PARAM p) { /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (p, 30)) return ; rde_param_i_next_class (p, "*/", 28); rde_param_i_symbol_done_leaf (p, 30, 29); return; } /* * value Symbol 'Number' */ static void sym_Number (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (p, 32)) return ; sequence_44 (p); rde_param_i_symbol_done_d_reduce (p, 32, 31); return; } static void sequence_44 (RDE_PARAM p) { /* * x * ? * (Sign) * + * (Digit) */ rde_param_i_state_push_value (p); optional_39 (p); if (rde_param_i_seq_value2value(p)) return; poskleene_42 (p); rde_param_i_state_merge_value (p); return; } static void optional_39 (RDE_PARAM p) { /* * ? * (Sign) */ rde_param_i_state_push_2 (p); sym_Sign (p); rde_param_i_state_merge_ok (p); return; } static void poskleene_42 (RDE_PARAM p) { /* * + * (Digit) */ rde_param_i_loc_push (p); sym_Digit (p); if (rde_param_i_kleene_abort(p)) return; while (1) { rde_param_i_state_push_2 (p); sym_Digit (p); if (rde_param_i_kleene_close(p)) return; } return; } /* * value Symbol 'Sign' */ static void sym_Sign (RDE_PARAM p) { /* * [-+] */ if (rde_param_i_symbol_start (p, 34)) return ; rde_param_i_next_class (p, "-+", 14); rde_param_i_symbol_done_leaf (p, 34, 33); return; } /* * value Symbol 'Sinus' */ static void sym_Sinus (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (p, 37)) return ; sequence_52 (p); rde_param_i_symbol_done_d_reduce (p, 37, 36); return; } static void sequence_52 (RDE_PARAM p) { /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "sin(", 35); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; rde_param_i_next_char (p, ")", 21); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Term' */ static void sym_Term (RDE_PARAM p) { /* * (Number) */ if (rde_param_i_symbol_start_d (p, 39)) return ; sym_Number (p); rde_param_i_symbol_done_d_reduce (p, 39, 38); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/3_peg_itself.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void sequence_4 (RDE_PARAM p); static void sym_ALNUM (RDE_PARAM p); static void sequence_9 (RDE_PARAM p); static void sym_ALPHA (RDE_PARAM p); static void sequence_14 (RDE_PARAM p); static void sym_AND (RDE_PARAM p); static void sym_APOSTROPH (RDE_PARAM p); static void sequence_21 (RDE_PARAM p); static void sym_ASCII (RDE_PARAM p); static void choice_26 (RDE_PARAM p); static void sequence_29 (RDE_PARAM p); static void sym_Attribute (RDE_PARAM p); static void choice_37 (RDE_PARAM p); static void sym_Char (RDE_PARAM p); static void sequence_44 (RDE_PARAM p); static void sym_CharOctalFull (RDE_PARAM p); static void optional_50 (RDE_PARAM p); static void sequence_52 (RDE_PARAM p); static void sym_CharOctalPart (RDE_PARAM p); static void sequence_57 (RDE_PARAM p); static void sym_CharSpecial (RDE_PARAM p); static void notahead_61 (RDE_PARAM p); static void sequence_64 (RDE_PARAM p); static void sym_CharUnescaped (RDE_PARAM p); static void optional_72 (RDE_PARAM p); static void sequence_74 (RDE_PARAM p); static void optional_76 (RDE_PARAM p); static void sequence_78 (RDE_PARAM p); static void optional_80 (RDE_PARAM p); static void sequence_82 (RDE_PARAM p); static void sym_CharUnicode (RDE_PARAM p); static void notahead_87 (RDE_PARAM p); static void sequence_90 (RDE_PARAM p); static void kleene_92 (RDE_PARAM p); static void sequence_96 (RDE_PARAM p); static void sym_Class (RDE_PARAM p); static void sequence_101 (RDE_PARAM p); static void sym_CLOSE (RDE_PARAM p); static void sym_CLOSEB (RDE_PARAM p); static void sequence_108 (RDE_PARAM p); static void sym_COLON (RDE_PARAM p); static void notahead_113 (RDE_PARAM p); static void sequence_116 (RDE_PARAM p); static void kleene_118 (RDE_PARAM p); static void sequence_121 (RDE_PARAM p); static void sym_COMMENT (RDE_PARAM p); static void sequence_126 (RDE_PARAM p); static void sym_CONTROL (RDE_PARAM p); static void sym_DAPOSTROPH (RDE_PARAM p); static void sequence_133 (RDE_PARAM p); static void sym_DDIGIT (RDE_PARAM p); static void optional_137 (RDE_PARAM p); static void sequence_143 (RDE_PARAM p); static void sym_Definition (RDE_PARAM p); static void sequence_148 (RDE_PARAM p); static void sym_DIGIT (RDE_PARAM p); static void sequence_153 (RDE_PARAM p); static void sym_DOT (RDE_PARAM p); static void notahead_157 (RDE_PARAM p); static void sym_EOF (RDE_PARAM p); static void sym_EOL (RDE_PARAM p); static void sequence_165 (RDE_PARAM p); static void kleene_167 (RDE_PARAM p); static void sequence_169 (RDE_PARAM p); static void sym_Expression (RDE_PARAM p); static void sequence_176 (RDE_PARAM p); static void sym_Final (RDE_PARAM p); static void kleene_182 (RDE_PARAM p); static void sequence_186 (RDE_PARAM p); static void sym_Grammar (RDE_PARAM p); static void sequence_191 (RDE_PARAM p); static void sym_GRAPH (RDE_PARAM p); static void sequence_197 (RDE_PARAM p); static void sym_Header (RDE_PARAM p); static void choice_202 (RDE_PARAM p); static void choice_206 (RDE_PARAM p); static void kleene_208 (RDE_PARAM p); static void sequence_210 (RDE_PARAM p); static void sym_Ident (RDE_PARAM p); static void sequence_215 (RDE_PARAM p); static void sym_Identifier (RDE_PARAM p); static void sequence_220 (RDE_PARAM p); static void sym_IS (RDE_PARAM p); static void sequence_225 (RDE_PARAM p); static void sym_LEAF (RDE_PARAM p); static void notahead_230 (RDE_PARAM p); static void sequence_233 (RDE_PARAM p); static void kleene_235 (RDE_PARAM p); static void sequence_239 (RDE_PARAM p); static void notahead_243 (RDE_PARAM p); static void sequence_246 (RDE_PARAM p); static void kleene_248 (RDE_PARAM p); static void sequence_252 (RDE_PARAM p); static void choice_254 (RDE_PARAM p); static void sym_Literal (RDE_PARAM p); static void sequence_259 (RDE_PARAM p); static void sym_LOWER (RDE_PARAM p); static void sequence_264 (RDE_PARAM p); static void sym_NOT (RDE_PARAM p); static void sequence_269 (RDE_PARAM p); static void sym_OPEN (RDE_PARAM p); static void sym_OPENB (RDE_PARAM p); static void notahead_278 (RDE_PARAM p); static void sequence_281 (RDE_PARAM p); static void sym_PEG (RDE_PARAM p); static void sequence_286 (RDE_PARAM p); static void sym_PLUS (RDE_PARAM p); static void choice_291 (RDE_PARAM p); static void optional_293 (RDE_PARAM p); static void sequence_296 (RDE_PARAM p); static void sym_Prefix (RDE_PARAM p); static void sequence_317 (RDE_PARAM p); static void choice_322 (RDE_PARAM p); static void sym_Primary (RDE_PARAM p); static void sequence_327 (RDE_PARAM p); static void sym_PRINTABLE (RDE_PARAM p); static void sequence_332 (RDE_PARAM p); static void sym_PUNCT (RDE_PARAM p); static void sequence_337 (RDE_PARAM p); static void sym_QUESTION (RDE_PARAM p); static void sequence_343 (RDE_PARAM p); static void choice_346 (RDE_PARAM p); static void sym_Range (RDE_PARAM p); static void sequence_351 (RDE_PARAM p); static void sym_SEMICOLON (RDE_PARAM p); static void poskleene_355 (RDE_PARAM p); static void sym_Sequence (RDE_PARAM p); static void sequence_360 (RDE_PARAM p); static void sym_SLASH (RDE_PARAM p); static void sequence_365 (RDE_PARAM p); static void sym_SPACE (RDE_PARAM p); static void sequence_370 (RDE_PARAM p); static void sym_STAR (RDE_PARAM p); static void sym_StartExpr (RDE_PARAM p); static void choice_382 (RDE_PARAM p); static void optional_384 (RDE_PARAM p); static void sequence_386 (RDE_PARAM p); static void sym_Suffix (RDE_PARAM p); static void sym_TO (RDE_PARAM p); static void sequence_393 (RDE_PARAM p); static void sym_UPPER (RDE_PARAM p); static void sequence_398 (RDE_PARAM p); static void sym_VOID (RDE_PARAM p); static void choice_403 (RDE_PARAM p); static void kleene_405 (RDE_PARAM p); static void sym_WHITESPACE (RDE_PARAM p); static void sequence_410 (RDE_PARAM p); static void sym_WORDCHAR (RDE_PARAM p); static void sequence_415 (RDE_PARAM p); static void sym_XDIGIT (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [178] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str <alnum>", /* 15 = */ "n ALNUM", /* 16 = */ "ALNUM", /* 17 = */ "str <alpha>", /* 18 = */ "n ALPHA", /* 19 = */ "ALPHA", /* 20 = */ "t &", /* 21 = */ "n AND", /* 22 = */ "AND", /* 23 = */ "t '", /* 24 = */ "n APOSTROPH", /* 25 = */ "APOSTROPH", /* 26 = */ "str <ascii>", /* 27 = */ "n ASCII", /* 28 = */ "ASCII", /* 29 = */ "n Attribute", /* 30 = */ "Attribute", /* 31 = */ "n Char", /* 32 = */ "Char", /* 33 = */ "t \\\\", /* 34 = */ ".. 0 2", /* 35 = */ ".. 0 7", /* 36 = */ "n CharOctalFull", /* 37 = */ "CharOctalFull", /* 38 = */ "n CharOctalPart", /* 39 = */ "CharOctalPart", /* 40 = */ "cl nrt'\\\"\\[\\]\\\\", /* 41 = */ "n CharSpecial", /* 42 = */ "CharSpecial", /* 43 = */ "dot", /* 44 = */ "n CharUnescaped", /* 45 = */ "CharUnescaped", /* 46 = */ "str \173\\u\175", /* 47 = */ "n CharUnicode", /* 48 = */ "CharUnicode", /* 49 = */ "n Class", /* 50 = */ "Class", /* 51 = */ "t )", /* 52 = */ "n CLOSE", /* 53 = */ "CLOSE", /* 54 = */ "t \\]", /* 55 = */ "n CLOSEB", /* 56 = */ "CLOSEB", /* 57 = */ "t :", /* 58 = */ "n COLON", /* 59 = */ "COLON", /* 60 = */ "t #", /* 61 = */ "n COMMENT", /* 62 = */ "COMMENT", /* 63 = */ "str <control>", /* 64 = */ "n CONTROL", /* 65 = */ "CONTROL", /* 66 = */ "t \173\"\175", /* 67 = */ "n DAPOSTROPH", /* 68 = */ "DAPOSTROPH", /* 69 = */ "str <ddigit>", /* 70 = */ "n DDIGIT", /* 71 = */ "DDIGIT", /* 72 = */ "n Definition", /* 73 = */ "Definition", /* 74 = */ "str <digit>", /* 75 = */ "n DIGIT", /* 76 = */ "DIGIT", /* 77 = */ "t .", /* 78 = */ "n DOT", /* 79 = */ "DOT", /* 80 = */ "n EOF", /* 81 = */ "EOF", /* 82 = */ "cl \173\n\r\175", /* 83 = */ "n EOL", /* 84 = */ "EOL", /* 85 = */ "n Expression", /* 86 = */ "Expression", /* 87 = */ "str END", /* 88 = */ "n Final", /* 89 = */ "Final", /* 90 = */ "n Grammar", /* 91 = */ "Grammar", /* 92 = */ "str <graph>", /* 93 = */ "n GRAPH", /* 94 = */ "GRAPH", /* 95 = */ "n Header", /* 96 = */ "Header", /* 97 = */ "cl _:", /* 98 = */ "n Ident", /* 99 = */ "Ident", /* 100 = */ "n Identifier", /* 101 = */ "Identifier", /* 102 = */ "str <-", /* 103 = */ "n IS", /* 104 = */ "IS", /* 105 = */ "str leaf", /* 106 = */ "n LEAF", /* 107 = */ "LEAF", /* 108 = */ "n Literal", /* 109 = */ "Literal", /* 110 = */ "str <lower>", /* 111 = */ "n LOWER", /* 112 = */ "LOWER", /* 113 = */ "t !", /* 114 = */ "n NOT", /* 115 = */ "NOT", /* 116 = */ "t (", /* 117 = */ "n OPEN", /* 118 = */ "OPEN", /* 119 = */ "t \173[\175", /* 120 = */ "n OPENB", /* 121 = */ "OPENB", /* 122 = */ "str PEG", /* 123 = */ "n PEG", /* 124 = */ "PEG", /* 125 = */ "t +", /* 126 = */ "n PLUS", /* 127 = */ "PLUS", /* 128 = */ "n Prefix", /* 129 = */ "Prefix", /* 130 = */ "n Primary", /* 131 = */ "Primary", /* 132 = */ "str <print>", /* 133 = */ "n PRINTABLE", /* 134 = */ "PRINTABLE", /* 135 = */ "str <punct>", /* 136 = */ "n PUNCT", /* 137 = */ "PUNCT", /* 138 = */ "t ?", /* 139 = */ "n QUESTION", /* 140 = */ "QUESTION", /* 141 = */ "n Range", /* 142 = */ "Range", /* 143 = */ "t \173;\175", /* 144 = */ "n SEMICOLON", /* 145 = */ "SEMICOLON", /* 146 = */ "n Sequence", /* 147 = */ "Sequence", /* 148 = */ "t /", /* 149 = */ "n SLASH", /* 150 = */ "SLASH", /* 151 = */ "str <space>", /* 152 = */ "n SPACE", /* 153 = */ "SPACE", /* 154 = */ "t *", /* 155 = */ "n STAR", /* 156 = */ "STAR", /* 157 = */ "n StartExpr", /* 158 = */ "StartExpr", /* 159 = */ "n Suffix", /* 160 = */ "Suffix", /* 161 = */ "t -", /* 162 = */ "n TO", /* 163 = */ "TO", /* 164 = */ "str <upper>", /* 165 = */ "n UPPER", /* 166 = */ "UPPER", /* 167 = */ "str void", /* 168 = */ "n VOID", /* 169 = */ "VOID", /* 170 = */ "n WHITESPACE", /* 171 = */ "WHITESPACE", /* 172 = */ "str <wordchar>", /* 173 = */ "n WORDCHAR", /* 174 = */ "WORDCHAR", /* 175 = */ "str <xdigit>", /* 176 = */ "n XDIGIT", /* 177 = */ "XDIGIT" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_Grammar (p); return; } /* * leaf Symbol 'ALNUM' */ static void sym_ALNUM (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_4 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_4 (RDE_PARAM p) { /* * x * "<alnum>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alnum>", 14); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'ALPHA' */ static void sym_ALPHA (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 19)) return ; sequence_9 (p); rde_param_i_symbol_done_leaf (p, 19, 18); return; } static void sequence_9 (RDE_PARAM p) { /* * x * "<alpha>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<alpha>", 17); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'AND' */ static void sym_AND (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 22)) return ; sequence_14 (p); rde_param_i_symbol_done_leaf (p, 22, 21); return; } static void sequence_14 (RDE_PARAM p) { /* * x * '&' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "&", 20); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'APOSTROPH' */ static void sym_APOSTROPH (RDE_PARAM p) { /* * ''' */ if (rde_param_i_symbol_void_start (p, 25)) return ; rde_param_i_next_char (p, "'", 23); rde_param_i_symbol_done_void (p, 25, 24); return; } /* * leaf Symbol 'ASCII' */ static void sym_ASCII (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 28)) return ; sequence_21 (p); rde_param_i_symbol_done_leaf (p, 28, 27); return; } static void sequence_21 (RDE_PARAM p) { /* * x * "<ascii>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ascii>", 26); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Attribute' */ static void sym_Attribute (RDE_PARAM p) { /* * x * / * (VOID) * (LEAF) * (COLON) */ if (rde_param_i_symbol_start_d (p, 30)) return ; sequence_29 (p); rde_param_i_symbol_done_d_reduce (p, 30, 29); return; } static void sequence_29 (RDE_PARAM p) { /* * x * / * (VOID) * (LEAF) * (COLON) */ rde_param_i_state_push_value (p); choice_26 (p); if (rde_param_i_seq_value2value(p)) return; sym_COLON (p); rde_param_i_state_merge_value (p); return; } static void choice_26 (RDE_PARAM p) { /* * / * (VOID) * (LEAF) */ rde_param_i_state_push_value (p); sym_VOID (p); if (rde_param_i_bra_value2value(p)) return; sym_LEAF (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Char' */ static void sym_Char (RDE_PARAM p) { /* * / * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ if (rde_param_i_symbol_start_d (p, 32)) return ; choice_37 (p); rde_param_i_symbol_done_d_reduce (p, 32, 31); return; } static void choice_37 (RDE_PARAM p) { /* * / * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ rde_param_i_state_push_value (p); sym_CharSpecial (p); if (rde_param_i_bra_value2value(p)) return; sym_CharOctalFull (p); if (rde_param_i_bra_value2value(p)) return; sym_CharOctalPart (p); if (rde_param_i_bra_value2value(p)) return; sym_CharUnicode (p); if (rde_param_i_bra_value2value(p)) return; sym_CharUnescaped (p); rde_param_i_state_merge_value (p); return; } /* * leaf Symbol 'CharOctalFull' */ static void sym_CharOctalFull (RDE_PARAM p) { /* * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 37)) return ; sequence_44 (p); rde_param_i_symbol_done_leaf (p, 37, 36); return; } static void sequence_44 (RDE_PARAM p) { /* * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "2", 34); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharOctalPart' */ static void sym_CharOctalPart (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ if (rde_param_i_symbol_start (p, 39)) return ; sequence_52 (p); rde_param_i_symbol_done_leaf (p, 39, 38); return; } static void sequence_52 (RDE_PARAM p) { /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_range (p, "0", "7", 35); if (rde_param_i_seq_void2void(p)) return; optional_50 (p); rde_param_i_state_merge_void (p); return; } static void optional_50 (RDE_PARAM p) { /* * ? * range (0 .. 7) */ rde_param_i_state_push_2 (p); rde_param_i_next_range (p, "0", "7", 35); rde_param_i_state_merge_ok (p); return; } /* * leaf Symbol 'CharSpecial' */ static void sym_CharSpecial (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ if (rde_param_i_symbol_start (p, 42)) return ; sequence_57 (p); rde_param_i_symbol_done_leaf (p, 42, 41); return; } static void sequence_57 (RDE_PARAM p) { /* * x * '\' * [nrt'\"[]\] */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "\\", 33); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_class (p, "nrt'\"[]\\", 40); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'CharUnescaped' */ static void sym_CharUnescaped (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ if (rde_param_i_symbol_start (p, 45)) return ; sequence_64 (p); rde_param_i_symbol_done_leaf (p, 45, 44); return; } static void sequence_64 (RDE_PARAM p) { /* * x * ! * '\' * <dot> */ rde_param_i_state_push_void (p); notahead_61 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_61 (RDE_PARAM p) { /* * ! * '\' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "\\", 33); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'CharUnicode' */ static void sym_CharUnicode (RDE_PARAM p) { /* * x * "\u" * <xdigit> * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ if (rde_param_i_symbol_start (p, 48)) return ; sequence_82 (p); rde_param_i_symbol_done_leaf (p, 48, 47); return; } static void sequence_82 (RDE_PARAM p) { /* * x * "\u" * <xdigit> * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "\\u", 46); if (rde_param_i_seq_void2void(p)) return; rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_80 (p); rde_param_i_state_merge_void (p); return; } static void optional_80 (RDE_PARAM p) { /* * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_2 (p); sequence_78 (p); rde_param_i_state_merge_ok (p); return; } static void sequence_78 (RDE_PARAM p) { /* * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_76 (p); rde_param_i_state_merge_void (p); return; } static void optional_76 (RDE_PARAM p) { /* * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_2 (p); sequence_74 (p); rde_param_i_state_merge_ok (p); return; } static void sequence_74 (RDE_PARAM p) { /* * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (p); rde_param_i_next_xdigit (p, 13); if (rde_param_i_seq_void2void(p)) return; optional_72 (p); rde_param_i_state_merge_void (p); return; } static void optional_72 (RDE_PARAM p) { /* * ? * <xdigit> */ rde_param_i_state_push_2 (p); rde_param_i_next_xdigit (p, 13); rde_param_i_state_merge_ok (p); return; } /* * value Symbol 'Class' */ static void sym_Class (RDE_PARAM p) { /* * x * (OPENB) * * * x * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 50)) return ; sequence_96 (p); rde_param_i_symbol_done_d_reduce (p, 50, 49); return; } static void sequence_96 (RDE_PARAM p) { /* * x * (OPENB) * * * x * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_OPENB (p); if (rde_param_i_seq_void2value(p)) return; kleene_92 (p); if (rde_param_i_seq_value2value(p)) return; sym_CLOSEB (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_92 (RDE_PARAM p) { /* * * * x * ! * (CLOSEB) * (Range) */ while (1) { rde_param_i_state_push_2 (p); sequence_90 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_90 (RDE_PARAM p) { /* * x * ! * (CLOSEB) * (Range) */ rde_param_i_state_push_void (p); notahead_87 (p); if (rde_param_i_seq_void2value(p)) return; sym_Range (p); rde_param_i_state_merge_value (p); return; } static void notahead_87 (RDE_PARAM p) { /* * ! * (CLOSEB) */ rde_param_i_loc_push (p); sym_CLOSEB (p); rde_param_i_notahead_exit (p); return; } /* * void Symbol 'CLOSE' */ static void sym_CLOSE (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 53)) return ; sequence_101 (p); rde_param_i_symbol_done_void (p, 53, 52); return; } static void sequence_101 (RDE_PARAM p) { /* * x * '\)' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ")", 51); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'CLOSEB' */ static void sym_CLOSEB (RDE_PARAM p) { /* * ']' */ if (rde_param_i_symbol_void_start (p, 56)) return ; rde_param_i_next_char (p, "]", 54); rde_param_i_symbol_done_void (p, 56, 55); return; } /* * void Symbol 'COLON' */ static void sym_COLON (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 59)) return ; sequence_108 (p); rde_param_i_symbol_done_void (p, 59, 58); return; } static void sequence_108 (RDE_PARAM p) { /* * x * ':' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ":", 57); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'COMMENT' */ static void sym_COMMENT (RDE_PARAM p) { /* * x * '#' * * * x * ! * (EOL) * <dot> * (EOL) */ if (rde_param_i_symbol_void_start (p, 62)) return ; sequence_121 (p); rde_param_i_symbol_done_void (p, 62, 61); return; } static void sequence_121 (RDE_PARAM p) { /* * x * '#' * * * x * ! * (EOL) * <dot> * (EOL) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "#", 60); if (rde_param_i_seq_void2void(p)) return; kleene_118 (p); if (rde_param_i_seq_void2void(p)) return; sym_EOL (p); rde_param_i_state_merge_void (p); return; } static void kleene_118 (RDE_PARAM p) { /* * * * x * ! * (EOL) * <dot> */ while (1) { rde_param_i_state_push_2 (p); sequence_116 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_116 (RDE_PARAM p) { /* * x * ! * (EOL) * <dot> */ rde_param_i_state_push_void (p); notahead_113 (p); if (rde_param_i_seq_void2void(p)) return; rde_param_i_input_next (p, 43); rde_param_i_state_merge_void (p); return; } static void notahead_113 (RDE_PARAM p) { /* * ! * (EOL) */ rde_param_i_loc_push (p); sym_EOL (p); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'CONTROL' */ static void sym_CONTROL (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 65)) return ; sequence_126 (p); rde_param_i_symbol_done_leaf (p, 65, 64); return; } static void sequence_126 (RDE_PARAM p) { /* * x * "<control>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<control>", 63); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'DAPOSTROPH' */ static void sym_DAPOSTROPH (RDE_PARAM p) { /* * '\"' */ if (rde_param_i_symbol_void_start (p, 68)) return ; rde_param_i_next_char (p, "\"", 66); rde_param_i_symbol_done_void (p, 68, 67); return; } /* * leaf Symbol 'DDIGIT' */ static void sym_DDIGIT (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 71)) return ; sequence_133 (p); rde_param_i_symbol_done_leaf (p, 71, 70); return; } static void sequence_133 (RDE_PARAM p) { /* * x * "<ddigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<ddigit>", 69); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Definition' */ static void sym_Definition (RDE_PARAM p) { /* * x * ? * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ if (rde_param_i_symbol_start_d (p, 73)) return ; sequence_143 (p); rde_param_i_symbol_done_d_reduce (p, 73, 72); return; } static void sequence_143 (RDE_PARAM p) { /* * x * ? * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ rde_param_i_state_push_value (p); optional_137 (p); if (rde_param_i_seq_value2value(p)) return; sym_Identifier (p); if (rde_param_i_seq_value2value(p)) return; sym_IS (p); if (rde_param_i_seq_value2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; sym_SEMICOLON (p); rde_param_i_state_merge_value (p); return; } static void optional_137 (RDE_PARAM p) { /* * ? * (Attribute) */ rde_param_i_state_push_2 (p); sym_Attribute (p); rde_param_i_state_merge_ok (p); return; } /* * leaf Symbol 'DIGIT' */ static void sym_DIGIT (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 76)) return ; sequence_148 (p); rde_param_i_symbol_done_leaf (p, 76, 75); return; } static void sequence_148 (RDE_PARAM p) { /* * x * "<digit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<digit>", 74); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'DOT' */ static void sym_DOT (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 79)) return ; sequence_153 (p); rde_param_i_symbol_done_leaf (p, 79, 78); return; } static void sequence_153 (RDE_PARAM p) { /* * x * '.' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ".", 77); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'EOF' */ static void sym_EOF (RDE_PARAM p) { /* * ! * <dot> */ if (rde_param_i_symbol_void_start (p, 81)) return ; notahead_157 (p); rde_param_i_symbol_done_void (p, 81, 80); return; } static void notahead_157 (RDE_PARAM p) { /* * ! * <dot> */ rde_param_i_loc_push (p); rde_param_i_input_next (p, 43); rde_param_i_notahead_exit (p); return; } /* * void Symbol 'EOL' */ static void sym_EOL (RDE_PARAM p) { /* * [\n\r] */ if (rde_param_i_symbol_void_start (p, 84)) return ; rde_param_i_next_class (p, "\n\r", 82); rde_param_i_symbol_done_void (p, 84, 83); return; } /* * value Symbol 'Expression' */ static void sym_Expression (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ if (rde_param_i_symbol_start_d (p, 86)) return ; sequence_169 (p); rde_param_i_symbol_done_d_reduce (p, 86, 85); return; } static void sequence_169 (RDE_PARAM p) { /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ rde_param_i_state_push_value (p); sym_Sequence (p); if (rde_param_i_seq_value2value(p)) return; kleene_167 (p); rde_param_i_state_merge_value (p); return; } static void kleene_167 (RDE_PARAM p) { /* * * * x * (SLASH) * (Sequence) */ while (1) { rde_param_i_state_push_2 (p); sequence_165 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_165 (RDE_PARAM p) { /* * x * (SLASH) * (Sequence) */ rde_param_i_state_push_void (p); sym_SLASH (p); if (rde_param_i_seq_void2value(p)) return; sym_Sequence (p); rde_param_i_state_merge_value (p); return; } /* * void Symbol 'Final' */ static void sym_Final (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 89)) return ; sequence_176 (p); rde_param_i_symbol_done_void (p, 89, 88); return; } static void sequence_176 (RDE_PARAM p) { /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "END", 87); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); if (rde_param_i_seq_void2void(p)) return; sym_SEMICOLON (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Grammar' */ static void sym_Grammar (RDE_PARAM p) { /* * x * (WHITESPACE) * (Header) * * * (Definition) * (Final) * (EOF) */ if (rde_param_i_symbol_start_d (p, 91)) return ; sequence_186 (p); rde_param_i_symbol_done_d_reduce (p, 91, 90); return; } static void sequence_186 (RDE_PARAM p) { /* * x * (WHITESPACE) * (Header) * * * (Definition) * (Final) * (EOF) */ rde_param_i_state_push_void (p); sym_WHITESPACE (p); if (rde_param_i_seq_void2value(p)) return; sym_Header (p); if (rde_param_i_seq_value2value(p)) return; kleene_182 (p); if (rde_param_i_seq_value2value(p)) return; sym_Final (p); if (rde_param_i_seq_value2value(p)) return; sym_EOF (p); rde_param_i_state_merge_value (p); return; } static void kleene_182 (RDE_PARAM p) { /* * * * (Definition) */ while (1) { rde_param_i_state_push_2 (p); sym_Definition (p); if (rde_param_i_kleene_close(p)) return; } return; } /* * leaf Symbol 'GRAPH' */ static void sym_GRAPH (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 94)) return ; sequence_191 (p); rde_param_i_symbol_done_leaf (p, 94, 93); return; } static void sequence_191 (RDE_PARAM p) { /* * x * "<graph>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<graph>", 92); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Header' */ static void sym_Header (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ if (rde_param_i_symbol_start_d (p, 96)) return ; sequence_197 (p); rde_param_i_symbol_done_d_reduce (p, 96, 95); return; } static void sequence_197 (RDE_PARAM p) { /* * x * (PEG) * (Identifier) * (StartExpr) */ rde_param_i_state_push_void (p); sym_PEG (p); if (rde_param_i_seq_void2value(p)) return; sym_Identifier (p); if (rde_param_i_seq_value2value(p)) return; sym_StartExpr (p); rde_param_i_state_merge_value (p); return; } /* * leaf Symbol 'Ident' */ static void sym_Ident (RDE_PARAM p) { /* * x * / * [_:] * <alpha> * * * / * [_:] * <alnum> */ if (rde_param_i_symbol_start (p, 99)) return ; sequence_210 (p); rde_param_i_symbol_done_leaf (p, 99, 98); return; } static void sequence_210 (RDE_PARAM p) { /* * x * / * [_:] * <alpha> * * * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); choice_202 (p); if (rde_param_i_seq_void2void(p)) return; kleene_208 (p); rde_param_i_state_merge_void (p); return; } static void choice_202 (RDE_PARAM p) { /* * / * [_:] * <alpha> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alpha (p, 1); rde_param_i_state_merge_void (p); return; } static void kleene_208 (RDE_PARAM p) { /* * * * / * [_:] * <alnum> */ while (1) { rde_param_i_state_push_2 (p); choice_206 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_206 (RDE_PARAM p) { /* * / * [_:] * <alnum> */ rde_param_i_state_push_void (p); rde_param_i_next_class (p, "_:", 97); if (rde_param_i_bra_void2void(p)) return; rde_param_i_next_alnum (p, 0); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Identifier' */ static void sym_Identifier (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 101)) return ; sequence_215 (p); rde_param_i_symbol_done_d_reduce (p, 101, 100); return; } static void sequence_215 (RDE_PARAM p) { /* * x * (Ident) * (WHITESPACE) */ rde_param_i_state_push_value (p); sym_Ident (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } /* * void Symbol 'IS' */ static void sym_IS (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 104)) return ; sequence_220 (p); rde_param_i_symbol_done_void (p, 104, 103); return; } static void sequence_220 (RDE_PARAM p) { /* * x * "<-" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<-", 102); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'LEAF' */ static void sym_LEAF (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 107)) return ; sequence_225 (p); rde_param_i_symbol_done_leaf (p, 107, 106); return; } static void sequence_225 (RDE_PARAM p) { /* * x * "leaf" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "leaf", 105); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Literal' */ static void sym_Literal (RDE_PARAM p) { /* * / * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (p, 109)) return ; choice_254 (p); rde_param_i_symbol_done_d_reduce (p, 109, 108); return; } static void choice_254 (RDE_PARAM p) { /* * / * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (p); sequence_239 (p); if (rde_param_i_bra_value2value(p)) return; sequence_252 (p); rde_param_i_state_merge_value (p); return; } static void sequence_239 (RDE_PARAM p) { /* * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_APOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_235 (p); if (rde_param_i_seq_value2value(p)) return; sym_APOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_235 (RDE_PARAM p) { /* * * * x * ! * (APOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_233 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_233 (RDE_PARAM p) { /* * x * ! * (APOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_230 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_230 (RDE_PARAM p) { /* * ! * (APOSTROPH) */ rde_param_i_loc_push (p); sym_APOSTROPH (p); rde_param_i_notahead_exit (p); return; } static void sequence_252 (RDE_PARAM p) { /* * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (p); sym_DAPOSTROPH (p); if (rde_param_i_seq_void2value(p)) return; kleene_248 (p); if (rde_param_i_seq_value2value(p)) return; sym_DAPOSTROPH (p); if (rde_param_i_seq_value2value(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_value (p); return; } static void kleene_248 (RDE_PARAM p) { /* * * * x * ! * (DAPOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (p); sequence_246 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void sequence_246 (RDE_PARAM p) { /* * x * ! * (DAPOSTROPH) * (Char) */ rde_param_i_state_push_void (p); notahead_243 (p); if (rde_param_i_seq_void2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void notahead_243 (RDE_PARAM p) { /* * ! * (DAPOSTROPH) */ rde_param_i_loc_push (p); sym_DAPOSTROPH (p); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'LOWER' */ static void sym_LOWER (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 112)) return ; sequence_259 (p); rde_param_i_symbol_done_leaf (p, 112, 111); return; } static void sequence_259 (RDE_PARAM p) { /* * x * "<lower>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<lower>", 110); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'NOT' */ static void sym_NOT (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 115)) return ; sequence_264 (p); rde_param_i_symbol_done_leaf (p, 115, 114); return; } static void sequence_264 (RDE_PARAM p) { /* * x * '!' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "!", 113); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPEN' */ static void sym_OPEN (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 118)) return ; sequence_269 (p); rde_param_i_symbol_done_void (p, 118, 117); return; } static void sequence_269 (RDE_PARAM p) { /* * x * '\(' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "(", 116); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'OPENB' */ static void sym_OPENB (RDE_PARAM p) { /* * '[' */ if (rde_param_i_symbol_void_start (p, 121)) return ; rde_param_i_next_char (p, "[", 119); rde_param_i_symbol_done_void (p, 121, 120); return; } /* * void Symbol 'PEG' */ static void sym_PEG (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 124)) return ; sequence_281 (p); rde_param_i_symbol_done_void (p, 124, 123); return; } static void sequence_281 (RDE_PARAM p) { /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "PEG", 122); if (rde_param_i_seq_void2void(p)) return; notahead_278 (p); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } static void notahead_278 (RDE_PARAM p) { /* * ! * / * [_:] * <alnum> */ rde_param_i_loc_push (p); choice_206 (p); rde_param_i_notahead_exit (p); return; } /* * leaf Symbol 'PLUS' */ static void sym_PLUS (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 127)) return ; sequence_286 (p); rde_param_i_symbol_done_leaf (p, 127, 126); return; } static void sequence_286 (RDE_PARAM p) { /* * x * '+' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "+", 125); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Prefix' */ static void sym_Prefix (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ if (rde_param_i_symbol_start_d (p, 129)) return ; sequence_296 (p); rde_param_i_symbol_done_d_reduce (p, 129, 128); return; } static void sequence_296 (RDE_PARAM p) { /* * x * ? * / * (AND) * (NOT) * (Suffix) */ rde_param_i_state_push_value (p); optional_293 (p); if (rde_param_i_seq_value2value(p)) return; sym_Suffix (p); rde_param_i_state_merge_value (p); return; } static void optional_293 (RDE_PARAM p) { /* * ? * / * (AND) * (NOT) */ rde_param_i_state_push_2 (p); choice_291 (p); rde_param_i_state_merge_ok (p); return; } static void choice_291 (RDE_PARAM p) { /* * / * (AND) * (NOT) */ rde_param_i_state_push_value (p); sym_AND (p); if (rde_param_i_bra_value2value(p)) return; sym_NOT (p); rde_param_i_state_merge_value (p); return; } /* * value Symbol 'Primary' */ static void sym_Primary (RDE_PARAM p) { /* * / * (ALNUM) * (ALPHA) * (ASCII) * (CONTROL) * (DDIGIT) * (DIGIT) * (GRAPH) * (LOWER) * (PRINTABLE) * (PUNCT) * (SPACE) * (UPPER) * (WORDCHAR) * (XDIGIT) * (Identifier) * x * (OPEN) * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ if (rde_param_i_symbol_start_d (p, 131)) return ; choice_322 (p); rde_param_i_symbol_done_d_reduce (p, 131, 130); return; } static void choice_322 (RDE_PARAM p) { /* * / * (ALNUM) * (ALPHA) * (ASCII) * (CONTROL) * (DDIGIT) * (DIGIT) * (GRAPH) * (LOWER) * (PRINTABLE) * (PUNCT) * (SPACE) * (UPPER) * (WORDCHAR) * (XDIGIT) * (Identifier) * x * (OPEN) * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ rde_param_i_state_push_value (p); sym_ALNUM (p); if (rde_param_i_bra_value2value(p)) return; sym_ALPHA (p); if (rde_param_i_bra_value2value(p)) return; sym_ASCII (p); if (rde_param_i_bra_value2value(p)) return; sym_CONTROL (p); if (rde_param_i_bra_value2value(p)) return; sym_DDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_DIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_GRAPH (p); if (rde_param_i_bra_value2value(p)) return; sym_LOWER (p); if (rde_param_i_bra_value2value(p)) return; sym_PRINTABLE (p); if (rde_param_i_bra_value2value(p)) return; sym_PUNCT (p); if (rde_param_i_bra_value2value(p)) return; sym_SPACE (p); if (rde_param_i_bra_value2value(p)) return; sym_UPPER (p); if (rde_param_i_bra_value2value(p)) return; sym_WORDCHAR (p); if (rde_param_i_bra_value2value(p)) return; sym_XDIGIT (p); if (rde_param_i_bra_value2value(p)) return; sym_Identifier (p); if (rde_param_i_bra_value2value(p)) return; sequence_317 (p); if (rde_param_i_bra_value2value(p)) return; sym_Literal (p); if (rde_param_i_bra_value2value(p)) return; sym_Class (p); if (rde_param_i_bra_value2value(p)) return; sym_DOT (p); rde_param_i_state_merge_value (p); return; } static void sequence_317 (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ rde_param_i_state_push_void (p); sym_OPEN (p); if (rde_param_i_seq_void2value(p)) return; sym_Expression (p); if (rde_param_i_seq_value2value(p)) return; sym_CLOSE (p); rde_param_i_state_merge_value (p); return; } /* * leaf Symbol 'PRINTABLE' */ static void sym_PRINTABLE (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 134)) return ; sequence_327 (p); rde_param_i_symbol_done_leaf (p, 134, 133); return; } static void sequence_327 (RDE_PARAM p) { /* * x * "<print>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<print>", 132); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'PUNCT' */ static void sym_PUNCT (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 137)) return ; sequence_332 (p); rde_param_i_symbol_done_leaf (p, 137, 136); return; } static void sequence_332 (RDE_PARAM p) { /* * x * "<punct>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<punct>", 135); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'QUESTION' */ static void sym_QUESTION (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 140)) return ; sequence_337 (p); rde_param_i_symbol_done_leaf (p, 140, 139); return; } static void sequence_337 (RDE_PARAM p) { /* * x * '?' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "?", 138); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Range' */ static void sym_Range (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ if (rde_param_i_symbol_start_d (p, 142)) return ; choice_346 (p); rde_param_i_symbol_done_d_reduce (p, 142, 141); return; } static void choice_346 (RDE_PARAM p) { /* * / * x * (Char) * (TO) * (Char) * (Char) */ rde_param_i_state_push_value (p); sequence_343 (p); if (rde_param_i_bra_value2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } static void sequence_343 (RDE_PARAM p) { /* * x * (Char) * (TO) * (Char) */ rde_param_i_state_push_value (p); sym_Char (p); if (rde_param_i_seq_value2value(p)) return; sym_TO (p); if (rde_param_i_seq_value2value(p)) return; sym_Char (p); rde_param_i_state_merge_value (p); return; } /* * void Symbol 'SEMICOLON' */ static void sym_SEMICOLON (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 145)) return ; sequence_351 (p); rde_param_i_symbol_done_void (p, 145, 144); return; } static void sequence_351 (RDE_PARAM p) { /* * x * ';' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, ";", 143); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'Sequence' */ static void sym_Sequence (RDE_PARAM p) { /* * + * (Prefix) */ if (rde_param_i_symbol_start_d (p, 147)) return ; poskleene_355 (p); rde_param_i_symbol_done_d_reduce (p, 147, 146); return; } static void poskleene_355 (RDE_PARAM p) { /* * + * (Prefix) */ rde_param_i_loc_push (p); sym_Prefix (p); if (rde_param_i_kleene_abort(p)) return; while (1) { rde_param_i_state_push_2 (p); sym_Prefix (p); if (rde_param_i_kleene_close(p)) return; } return; } /* * void Symbol 'SLASH' */ static void sym_SLASH (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (p, 150)) return ; sequence_360 (p); rde_param_i_symbol_done_void (p, 150, 149); return; } static void sequence_360 (RDE_PARAM p) { /* * x * '/' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "/", 148); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'SPACE' */ static void sym_SPACE (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 153)) return ; sequence_365 (p); rde_param_i_symbol_done_leaf (p, 153, 152); return; } static void sequence_365 (RDE_PARAM p) { /* * x * "<space>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<space>", 151); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'STAR' */ static void sym_STAR (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 156)) return ; sequence_370 (p); rde_param_i_symbol_done_leaf (p, 156, 155); return; } static void sequence_370 (RDE_PARAM p) { /* * x * '*' * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_char (p, "*", 154); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * value Symbol 'StartExpr' */ static void sym_StartExpr (RDE_PARAM p) { /* * x * (OPEN) * (Expression) * (CLOSE) */ if (rde_param_i_symbol_start_d (p, 158)) return ; sequence_317 (p); rde_param_i_symbol_done_d_reduce (p, 158, 157); return; } /* * value Symbol 'Suffix' */ static void sym_Suffix (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ if (rde_param_i_symbol_start_d (p, 160)) return ; sequence_386 (p); rde_param_i_symbol_done_d_reduce (p, 160, 159); return; } static void sequence_386 (RDE_PARAM p) { /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_value (p); sym_Primary (p); if (rde_param_i_seq_value2value(p)) return; optional_384 (p); rde_param_i_state_merge_value (p); return; } static void optional_384 (RDE_PARAM p) { /* * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_2 (p); choice_382 (p); rde_param_i_state_merge_ok (p); return; } static void choice_382 (RDE_PARAM p) { /* * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_value (p); sym_QUESTION (p); if (rde_param_i_bra_value2value(p)) return; sym_STAR (p); if (rde_param_i_bra_value2value(p)) return; sym_PLUS (p); rde_param_i_state_merge_value (p); return; } /* * void Symbol 'TO' */ static void sym_TO (RDE_PARAM p) { /* * '-' */ if (rde_param_i_symbol_void_start (p, 163)) return ; rde_param_i_next_char (p, "-", 161); rde_param_i_symbol_done_void (p, 163, 162); return; } /* * leaf Symbol 'UPPER' */ static void sym_UPPER (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 166)) return ; sequence_393 (p); rde_param_i_symbol_done_leaf (p, 166, 165); return; } static void sequence_393 (RDE_PARAM p) { /* * x * "<upper>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<upper>", 164); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'VOID' */ static void sym_VOID (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 169)) return ; sequence_398 (p); rde_param_i_symbol_done_leaf (p, 169, 168); return; } static void sequence_398 (RDE_PARAM p) { /* * x * "void" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "void", 167); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * void Symbol 'WHITESPACE' */ static void sym_WHITESPACE (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ if (rde_param_i_symbol_void_start (p, 171)) return ; kleene_405 (p); rde_param_i_symbol_done_void (p, 171, 170); return; } static void kleene_405 (RDE_PARAM p) { /* * * * / * <space> * (COMMENT) */ while (1) { rde_param_i_state_push_2 (p); choice_403 (p); if (rde_param_i_kleene_close(p)) return; } return; } static void choice_403 (RDE_PARAM p) { /* * / * <space> * (COMMENT) */ rde_param_i_state_push_void (p); rde_param_i_next_space (p, 10); if (rde_param_i_bra_void2void(p)) return; sym_COMMENT (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'WORDCHAR' */ static void sym_WORDCHAR (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 174)) return ; sequence_410 (p); rde_param_i_symbol_done_leaf (p, 174, 173); return; } static void sequence_410 (RDE_PARAM p) { /* * x * "<wordchar>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<wordchar>", 172); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* * leaf Symbol 'XDIGIT' */ static void sym_XDIGIT (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (p, 177)) return ; sequence_415 (p); rde_param_i_symbol_done_leaf (p, 177, 176); return; } static void sequence_415 (RDE_PARAM p) { /* * x * "<xdigit>" * (WHITESPACE) */ rde_param_i_state_push_void (p); rde_param_i_next_str (p, "<xdigit>", 175); if (rde_param_i_seq_void2void(p)) return; sym_WHITESPACE (p); rde_param_i_state_merge_void (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/4_choice.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl abc" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { rde_param_i_next_class (p, "abc", 14); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/5_sequence.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str abc" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { rde_param_i_next_str (p, "abc", 14); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/6_optional.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void optional_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { optional_2 (p); return; } static void optional_2 (RDE_PARAM p) { /* * ? * 'a' */ rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); rde_param_i_state_merge_ok (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/7_kleene.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void kleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { kleene_2 (p); return; } static void kleene_2 (RDE_PARAM p) { /* * * * 'a' */ while (1) { rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_close(p)) return; } return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/8_pkleene.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void poskleene_2 (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { poskleene_2 (p); return; } static void poskleene_2 (RDE_PARAM p) { /* * + * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_abort(p)) return; while (1) { rde_param_i_state_push_2 (p); rde_param_i_next_char (p, "a", 14); if (rde_param_i_kleene_close(p)) return; } return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Added modules/pt/tests/data/ok/peg_cparam-tea/9_ahead.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 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 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 | /************************************************************ ** ** TEA-based C/PARAM implementation of the parsing ** expression grammar ** ** TEMPLATE ** ** Generated from file TEST ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include <string.h> #include <tcl.h> #include <stdlib.h> #include <ctype.h> #define SCOPE static #line 1 "rde_critcl/util.h" #ifndef _RDE_UTIL_H #define _RDE_UTIL_H 1 #ifndef SCOPE #define SCOPE #endif #define ALLOC(type) (type *) ckalloc (sizeof (type)) #define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type)) #undef RDE_DEBUG #define RDE_DEBUG 1 #undef RDE_TRACE #ifdef RDE_DEBUG #define STOPAFTER(x) { static int count = (x); count --; if (!count) { Tcl_Panic ("stop"); } } #define XSTR(x) #x #define STR(x) XSTR(x) #define RANGEOK(i,n) ((0 <= (i)) && (i < (n))) #define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));} #define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " >= " STR(n)) #else #define STOPAFTER(x) #define ASSERT(x,msg) #define ASSERT_BOUNDS(i,n) #endif #ifdef RDE_TRACE SCOPE void trace_enter (const char* fun); SCOPE void trace_return (const char *pat, ...); SCOPE void trace_printf (const char *pat, ...); #define ENTER(fun) trace_enter (fun) #define RETURN(format,x) trace_return (format,x) ; return x #define RETURNVOID trace_return ("%s","(void)") ; return #define TRACE0(x) trace_printf0 x #define TRACE(x) trace_printf x #else #define ENTER(fun) #define RETURN(f,x) return x #define RETURNVOID return #define TRACE0(x) #define TRACE(x) #endif #endif #line 1 "rde_critcl/stack.h" #ifndef _RDE_DS_STACK_H #define _RDE_DS_STACK_H 1 typedef void (*RDE_STACK_CELL_FREE) (void* cell); typedef struct RDE_STACK_* RDE_STACK; static const int RDE_STACK_INITIAL_SIZE = 256; #endif #line 1 "rde_critcl/tc.h" #ifndef _RDE_DS_TC_H #define _RDE_DS_TC_H 1 typedef struct RDE_TC_* RDE_TC; #endif #line 1 "rde_critcl/param.h" #ifndef _RDE_DS_PARAM_H #define _RDE_DS_PARAM_H 1 typedef struct RDE_PARAM_* RDE_PARAM; typedef struct ERROR_STATE { int refCount; long int loc; RDE_STACK msg; } ERROR_STATE; typedef struct NC_STATE { long int CL; long int ST; Tcl_Obj* SV; ERROR_STATE* ER; } NC_STATE; #endif #line 1 "rde_critcl/util.c" #ifdef RDE_TRACE typedef struct F_STACK { const char* str; struct F_STACK* down; } F_STACK; static F_STACK* top = 0; static int level = 0; static void push (const char* str) { F_STACK* new = ALLOC (F_STACK); new->str = str; new->down = top; top = new; level += 4; } static void pop (void) { F_STACK* next = top->down; level -= 4; ckfree ((char*)top); top = next; } static void indent (void) { int i; for (i = 0; i < level; i++) { fwrite(" ", 1, 1, stdout); fflush (stdout); } if (top) { fwrite(top->str, 1, strlen(top->str), stdout); fflush (stdout); } fwrite(" ", 1, 1, stdout); fflush (stdout); } SCOPE void trace_enter (const char* fun) { push (fun); indent(); fwrite("ENTER\n", 1, 6, stdout); fflush (stdout); } static char msg [1024*1024]; SCOPE void trace_return (const char *pat, ...) { int len; va_list args; indent(); fwrite("RETURN = ", 1, 9, stdout); fflush (stdout); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); pop(); } SCOPE void trace_printf (const char *pat, ...) { int len; va_list args; indent(); va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } SCOPE void trace_printf0 (const char *pat, ...) { int len; va_list args; va_start(args, pat); len = vsprintf(msg, pat, args); va_end(args); msg[len++] = '\n'; msg[len] = '\0'; fwrite(msg, 1, len, stdout); fflush (stdout); } #endif #line 1 "rde_critcl/stack.c" typedef struct RDE_STACK_ { long int max; long int top; RDE_STACK_CELL_FREE freeCellProc; void** cell; } RDE_STACK_; SCOPE RDE_STACK rde_stack_new (RDE_STACK_CELL_FREE freeCellProc) { RDE_STACK s = ALLOC (RDE_STACK_); s->cell = NALLOC (RDE_STACK_INITIAL_SIZE, void*); s->max = RDE_STACK_INITIAL_SIZE; s->top = 0; s->freeCellProc = freeCellProc; return s; } SCOPE void rde_stack_del (RDE_STACK s) { if (s->freeCellProc && s->top) { long int i; for (i=0; i < s->top; i++) { ASSERT_BOUNDS(i,s->max); s->freeCellProc ( s->cell [i] ); } } ckfree ((char*) s->cell); ckfree ((char*) s); } SCOPE void rde_stack_push (RDE_STACK s, void* item) { if (s->top >= s->max) { long int new = s->max ? (2 * s->max) : RDE_STACK_INITIAL_SIZE; void** cell = (void**) ckrealloc ((char*) s->cell, new * sizeof(void*)); ASSERT (cell,"Memory allocation failure for RDE stack"); s->max = new; s->cell = cell; } ASSERT_BOUNDS(s->top,s->max); s->cell [s->top] = item; s->top ++; } SCOPE void* rde_stack_top (RDE_STACK s) { ASSERT_BOUNDS(s->top-1,s->max); return s->cell [s->top - 1]; } SCOPE void rde_stack_pop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; if (s->freeCellProc) { while (n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); n --; } } else { s->top -= n; } } SCOPE void rde_stack_trim (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad trimsize"); if (s->freeCellProc) { while (s->top > n) { s->top --; ASSERT_BOUNDS(s->top,s->max); s->freeCellProc ( s->cell [s->top] ); } } else { s->top = n; } } SCOPE void rde_stack_drop (RDE_STACK s, long int n) { ASSERT (n >= 0, "Bad pop count"); if (n == 0) return; s->top -= n; } SCOPE void rde_stack_move (RDE_STACK dst, RDE_STACK src) { ASSERT (dst->freeCellProc == src->freeCellProc, "Ownership mismatch"); while (src->top > 0) { src->top --; ASSERT_BOUNDS(src->top,src->max); rde_stack_push (dst, src->cell [src->top] ); } } SCOPE void rde_stack_get (RDE_STACK s, long int* cn, void*** cc) { *cn = s->top; *cc = s->cell; } SCOPE long int rde_stack_size (RDE_STACK s) { return s->top; } #line 1 "rde_critcl/tc.c" typedef struct RDE_TC_ { int max; int num; char* str; RDE_STACK off; } RDE_TC_; SCOPE RDE_TC rde_tc_new (void) { RDE_TC tc = ALLOC (RDE_TC_); tc->max = RDE_STACK_INITIAL_SIZE; tc->num = 0; tc->str = NALLOC (RDE_STACK_INITIAL_SIZE, char); tc->off = rde_stack_new (NULL); return tc; } SCOPE void rde_tc_del (RDE_TC tc) { rde_stack_del (tc->off); ckfree (tc->str); ckfree ((char*) tc); } SCOPE long int rde_tc_size (RDE_TC tc) { return rde_stack_size (tc->off); } SCOPE void rde_tc_clear (RDE_TC tc) { tc->num = 0; rde_stack_trim (tc->off, 0); } SCOPE char* rde_tc_append (RDE_TC tc, char* string, long int len) { long int base = tc->num; long int off = tc->num; char* ch; int clen; Tcl_UniChar uni; if (len < 0) { len = strlen (string); } if (!len) { return tc->str + base; } if ((tc->num + len) >= tc->max) { int new = len + (tc->max ? (2 * tc->max) : RDE_STACK_INITIAL_SIZE); char* str = ckrealloc (tc->str, new * sizeof(char)); ASSERT (str,"Memory allocation failure for token character array"); tc->max = new; tc->str = str; } tc->num += len; ASSERT_BOUNDS(tc->num,tc->max); ASSERT_BOUNDS(off,tc->max); ASSERT_BOUNDS(off+len-1,tc->max); ASSERT_BOUNDS(off+len-1,tc->num); memcpy (tc->str + off, string, len); ch = string; while (ch < (string + len)) { ASSERT_BOUNDS(off,tc->num); rde_stack_push (tc->off, (void*) off); clen = Tcl_UtfToUniChar (ch, &uni); off += clen; ch += clen; } return tc->str + base; } SCOPE void rde_tc_get (RDE_TC tc, int at, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); off = (long int) ov [at]; if ((at+1) == oc) { end = tc->num; } else { end = (long int) ov [at+1]; } TRACE (("rde_tc_get (RDE_TC %p, @ %d) => %d.[%d ... %d]/%d",tc,at,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } SCOPE void rde_tc_get_s (RDE_TC tc, int at, int last, char** ch, long int* len) { long int oc, off, top, end; void** ov; rde_stack_get (tc->off, &oc, &ov); ASSERT_BOUNDS(at,oc); ASSERT_BOUNDS(last,oc); off = (long int) ov [at]; if ((last+1) == oc) { end = tc->num; } else { end = (long int) ov [last+1]; } TRACE (("rde_tc_get_s (RDE_TC %p, @ %d .. %d) => %d.[%d ... %d]/%d",tc,at,last,end-off,off,end-1,tc->num)); ASSERT_BOUNDS(off,tc->num); ASSERT_BOUNDS(end-1,tc->num); *ch = tc->str + off; *len = end - off; } #line 1 "rde_critcl/param.c" typedef struct RDE_PARAM_ { Tcl_Channel IN; Tcl_Obj* readbuf; char* CC; long int CC_len; RDE_TC TC; long int CL; RDE_STACK LS; ERROR_STATE* ER; RDE_STACK ES; long int ST; Tcl_Obj* SV; Tcl_HashTable NC; RDE_STACK ast ; RDE_STACK mark ; long int numstr; char** string; ClientData clientData; } RDE_PARAM_; typedef int (*UniCharClass) (int); typedef enum test_class_id { tc_alnum, tc_alpha, tc_ascii, tc_control, tc_ddigit, tc_digit, tc_graph, tc_lower, tc_printable, tc_punct, tc_space, tc_upper, tc_wordchar, tc_xdigit } test_class_id; static void ast_node_free (void* n); static void error_state_free (void* es); static void error_set (RDE_PARAM p, long int s); static void nc_clear (RDE_PARAM p); static int UniCharIsAscii (int character); static int UniCharIsHexDigit (int character); static int UniCharIsDecDigit (int character); static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id); static int er_int_compare (const void* a, const void* b); #define SV_INIT(p) \ p->SV = NULL; \ TRACE (("SV_INIT (%p => %p)", (p), (p)->SV)) #define SV_SET(p,newsv) \ if (((p)->SV) != (newsv)) { \ TRACE (("SV_CLEAR/set (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = (newsv); \ TRACE (("SV_SET (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_IncrRefCount ((p)->SV); \ } \ } #define SV_CLEAR(p) \ TRACE (("SV_CLEAR (%p => %p)", (p), (p)->SV)); \ if ((p)->SV) { \ Tcl_DecrRefCount ((p)->SV); \ } \ (p)->SV = NULL #define ER_INIT(p) \ p->ER = NULL; \ TRACE (("ER_INIT (%p => %p)", (p), (p)->ER)) #define ER_CLEAR(p) \ error_state_free ((p)->ER); \ (p)->ER = NULL SCOPE RDE_PARAM rde_param_new (long int nstr, char** strings) { RDE_PARAM p; ENTER ("rde_param_new"); TRACE (("\tINT %d strings @ %p", nstr, strings)); p = ALLOC (RDE_PARAM_); p->numstr = nstr; p->string = strings; p->readbuf = Tcl_NewObj (); Tcl_IncrRefCount (p->readbuf); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_InitHashTable (&p->NC, TCL_ONE_WORD_KEYS); p->IN = NULL; p->CL = -1; p->ST = 0; ER_INIT (p); SV_INIT (p); p->CC = NULL; p->CC_len = 0; p->TC = rde_tc_new (); p->ES = rde_stack_new (error_state_free); p->LS = rde_stack_new (NULL); p->ast = rde_stack_new (ast_node_free); p->mark = rde_stack_new (NULL); RETURN ("%p", p); } SCOPE void rde_param_del (RDE_PARAM p) { ENTER ("rde_param_del"); TRACE (("RDE_PARAM %p",p)); ER_CLEAR (p); TRACE (("\ter_clear")); SV_CLEAR (p); TRACE (("\tsv_clear")); nc_clear (p); TRACE (("\tnc_clear")); Tcl_DeleteHashTable (&p->NC); TRACE (("\tnc hashtable delete")); rde_tc_del (p->TC); TRACE (("\ttc clear")); rde_stack_del (p->ES); TRACE (("\tes clear")); rde_stack_del (p->LS); TRACE (("\tls clear")); rde_stack_del (p->ast); TRACE (("\tast clear")); rde_stack_del (p->mark); TRACE (("\tmark clear")); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); Tcl_DecrRefCount (p->readbuf); ckfree ((char*) p); RETURNVOID; } SCOPE void rde_param_reset (RDE_PARAM p, Tcl_Channel chan) { ENTER ("rde_param_reset"); TRACE (("RDE_PARAM %p",p)); TRACE (("Tcl_Channel %p",chan)); p->IN = chan; p->CL = -1; p->ST = 0; p->CC = NULL; p->CC_len = 0; ER_CLEAR (p); SV_CLEAR (p); nc_clear (p); rde_tc_clear (p->TC); rde_stack_trim (p->ES, 0); rde_stack_trim (p->LS, 0); rde_stack_trim (p->ast, 0); rde_stack_trim (p->mark, 0); TRACE (("\tTcl_Obj* readbuf %p used %d", p->readbuf,p->readbuf->refCount)); RETURNVOID; } SCOPE void rde_param_update_strings (RDE_PARAM p, long int nstr, char** strings) { ENTER ("rde_param_update_strings"); TRACE (("RDE_PARAM %p", p)); TRACE (("INT %d strings", nstr)); p->numstr = nstr; p->string = strings; RETURNVOID; } SCOPE void rde_param_data (RDE_PARAM p, char* buf, long int len) { (void) rde_tc_append (p->TC, buf, len); } SCOPE void rde_param_clientdata (RDE_PARAM p, ClientData clientData) { p->clientData = clientData; } static void nc_clear (RDE_PARAM p) { Tcl_HashSearch hs; Tcl_HashEntry* he; Tcl_HashTable* tablePtr; for(he = Tcl_FirstHashEntry(&p->NC, &hs); he != NULL; he = Tcl_FirstHashEntry(&p->NC, &hs)) { Tcl_HashSearch hsc; Tcl_HashEntry* hec; tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (he); for(hec = Tcl_FirstHashEntry(tablePtr, &hsc); hec != NULL; hec = Tcl_NextHashEntry(&hsc)) { NC_STATE* scs = Tcl_GetHashValue (hec); error_state_free (scs->ER); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } ckfree ((char*) scs); } Tcl_DeleteHashTable (tablePtr); ckfree ((char*) tablePtr); Tcl_DeleteHashEntry (he); } } SCOPE ClientData rde_param_query_clientdata (RDE_PARAM p) { return p->clientData; } SCOPE void rde_param_query_amark (RDE_PARAM p, long int* mc, void*** mv) { rde_stack_get (p->mark, mc, mv); } SCOPE void rde_param_query_ast (RDE_PARAM p, long int* ac, Tcl_Obj*** av) { rde_stack_get (p->ast, ac, (void***) av); } SCOPE const char* rde_param_query_in (RDE_PARAM p) { return p->IN ? Tcl_GetChannelName (p->IN) : ""; } SCOPE const char* rde_param_query_cc (RDE_PARAM p, long int* len) { *len = p->CC_len; return p->CC; } SCOPE int rde_param_query_cl (RDE_PARAM p) { return p->CL; } SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p) { return p->ER; } SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er) { Tcl_Obj* res; if (!er) { res = Tcl_NewStringObj ("", 0); } else { Tcl_Obj* ov [2]; Tcl_Obj** mov; long int mc, i, j; void** mv; int lastid; const char* msg; rde_stack_get (er->msg, &mc, &mv); qsort (mv, mc, sizeof (void*), er_int_compare); mov = NALLOC (mc, Tcl_Obj*); lastid = -1; for (i=0, j=0; i < mc; i++) { ASSERT_BOUNDS (i,mc); if (((long int) mv [i]) == lastid) continue; lastid = (long int) mv [i]; ASSERT_BOUNDS((long int) mv[i],p->numstr); msg = p->string [(long int) mv[i]]; ASSERT_BOUNDS (j,mc); mov [j] = Tcl_NewStringObj (msg, -1); j++; } ov [0] = Tcl_NewIntObj (er->loc); ov [1] = Tcl_NewListObj (j, mov); res = Tcl_NewListObj (2, ov); ckfree ((char*) mov); } return res; } SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev) { rde_stack_get (p->ES, ec, (void***) ev); } SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } SCOPE long int rde_param_query_lstop (RDE_PARAM p) { (long int) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; } SCOPE int rde_param_query_st (RDE_PARAM p) { return p->ST; } SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p) { TRACE (("SV_QUERY %p => (%p)", (p), (p)->SV)); \ return p->SV; } SCOPE long int rde_param_query_tc_size (RDE_PARAM p) { return rde_tc_size (p->TC); } SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len) { rde_tc_get_s (p->TC, at, last, ch, len); } SCOPE const char* rde_param_query_string (RDE_PARAM p, long int id) { TRACE (("rde_param_query_string (RDE_PARAM %p, %d/%d)", p, id, p->numstr)); ASSERT_BOUNDS(id,p->numstr); return p->string [id]; } SCOPE void rde_param_i_ast_pop_discard (RDE_PARAM p) { rde_stack_pop (p->mark, 1); } SCOPE void rde_param_i_ast_pop_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_pop_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_rewind (RDE_PARAM p) { long int trim = (long int) rde_stack_top (p->mark); ENTER ("rde_param_i_ast_rewind"); TRACE (("RDE_PARAM %p",p)); rde_stack_trim (p->ast, trim); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_ast_push (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_ast_value_push (RDE_PARAM p) { ENTER ("rde_param_i_ast_value_push"); TRACE (("RDE_PARAM %p",p)); ASSERT(p->SV,"Unable to push undefined semantic value"); TRACE (("rde_param_i_ast_value_push %p => (%p)", p, p->SV)); TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV->refCount, Tcl_GetString (p->SV))); rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); RETURNVOID; } static void ast_node_free (void* n) { Tcl_DecrRefCount ((Tcl_Obj*) n); } SCOPE void rde_param_i_error_clear (RDE_PARAM p) { ER_CLEAR (p); } SCOPE void rde_param_i_error_nonterminal (RDE_PARAM p, long int s) { return; long int pos; if (!p->ER) return; pos = 1 + (long int) rde_stack_top (p->LS); if (p->ER->loc != pos) return; error_set (p, s); p->ER->loc = pos; } SCOPE void rde_param_i_error_pop_merge (RDE_PARAM p) { ERROR_STATE* top = (ERROR_STATE*) rde_stack_top (p->ES); if (top == p->ER) { rde_stack_pop (p->ES, 1); return; } if (!top) { rde_stack_pop (p->ES, 1); return; } if (!p->ER) { rde_stack_drop (p->ES, 1); p->ER = top; return; } if (top->loc < p->ER->loc) { rde_stack_pop (p->ES, 1); return; } if (top->loc > p->ER->loc) { rde_stack_drop (p->ES, 1); error_state_free (p->ER); p->ER = top; return; } rde_stack_move (p->ER->msg, top->msg); rde_stack_pop (p->ES, 1); } SCOPE void rde_param_i_error_push (RDE_PARAM p) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } static void error_set (RDE_PARAM p, long int s) { error_state_free (p->ER); p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); rde_stack_push (p->ER->msg, (void*) s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; if (!es) return; es->refCount --; if (es->refCount > 0) return; rde_stack_del (es->msg); ckfree ((char*) es); } SCOPE void rde_param_i_loc_pop_discard (RDE_PARAM p) { rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_pop_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_loc_push (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); } SCOPE void rde_param_i_loc_rewind (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); } SCOPE void rde_param_i_input_next (RDE_PARAM p, long int m) { int leni; char* ch; ASSERT_BOUNDS(m,p->numstr); p->CL ++; if (p->CL < rde_tc_size (p->TC)) { rde_tc_get (p->TC, p->CL, &p->CC, &p->CC_len); ASSERT_BOUNDS (p->CC_len-1, TCL_UTF_MAX); p->ST = 1; ER_CLEAR (p); return; } if (!p->IN || Tcl_Eof (p->IN) || (Tcl_ReadChars (p->IN, p->readbuf, 1, 0) <= 0)) { p->ST = 0; error_set (p, m); return; } ch = Tcl_GetStringFromObj (p->readbuf, &leni); ASSERT_BOUNDS (leni, TCL_UTF_MAX); p->CC = rde_tc_append (p->TC, ch, leni); p->CC_len = leni; p->ST = 1; ER_CLEAR (p); } SCOPE void rde_param_i_status_fail (RDE_PARAM p) { p->ST = 0; } SCOPE void rde_param_i_status_ok (RDE_PARAM p) { p->ST = 1; } SCOPE void rde_param_i_status_negate (RDE_PARAM p) { p->ST = !p->ST; } SCOPE int rde_param_i_symbol_restore (RDE_PARAM p, long int s) { NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; error_state_free (p->ER); p->ER = scs->ER; if (p->ER) { p->ER->refCount ++; } TRACE (("SV_RESTORE (%p) '%s'",scs->SV, scs->SV ? Tcl_GetString (scs->SV):"")); SV_SET (p, scs->SV); return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { long int at = (long int) rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "")); scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } Tcl_SetHashValue (hPtr, scs); } else { scs = (NC_STATE*) Tcl_GetHashValue (hPtr); scs->CL = p->CL; scs->ST = p->ST; TRACE (("SV_CACHE/over (%p '%s')", p->SV, p->SV ? Tcl_GetString(p->SV) : "" )); if (scs->SV) { Tcl_DecrRefCount (scs->SV); } scs->SV = p->SV; if (scs->SV) { Tcl_IncrRefCount (scs->SV); } error_state_free (scs->ER); scs->ER = p->ER; if (scs->ER) { scs->ER->refCount ++; } } TRACE (("SV = (%p rc%d '%s')", p->SV, p->SV ? p->SV->refCount : -1, p->SV ? Tcl_GetString (p->SV) : "")); RETURNVOID; } SCOPE void rde_param_i_test_alnum (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlnum, tc_alnum); } SCOPE void rde_param_i_test_alpha (RDE_PARAM p) { test_class (p, Tcl_UniCharIsAlpha, tc_alpha); } SCOPE void rde_param_i_test_ascii (RDE_PARAM p) { test_class (p, UniCharIsAscii, tc_ascii); } SCOPE void rde_param_i_test_control (RDE_PARAM p) { test_class (p, Tcl_UniCharIsControl, tc_control); } SCOPE void rde_param_i_test_char (RDE_PARAM p, const char* c, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = Tcl_UtfNcmp (p->CC, c, 1) == 0; if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_ddigit (RDE_PARAM p) { test_class (p, UniCharIsDecDigit, tc_ddigit); } SCOPE void rde_param_i_test_digit (RDE_PARAM p) { test_class (p, Tcl_UniCharIsDigit, tc_digit); } SCOPE void rde_param_i_test_graph (RDE_PARAM p) { test_class (p, Tcl_UniCharIsGraph, tc_graph); } SCOPE void rde_param_i_test_lower (RDE_PARAM p) { test_class (p, Tcl_UniCharIsLower, tc_lower); } SCOPE void rde_param_i_test_print (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPrint, tc_printable); } SCOPE void rde_param_i_test_punct (RDE_PARAM p) { test_class (p, Tcl_UniCharIsPunct, tc_punct); } SCOPE void rde_param_i_test_range (RDE_PARAM p, const char* s, const char* e, long int msg) { ASSERT_BOUNDS(msg,p->numstr); p->ST = (Tcl_UtfNcmp (s, p->CC, 1) <= 0) && (Tcl_UtfNcmp (p->CC, e, 1) <= 0); if (p->ST) { ER_CLEAR (p); } else { error_set (p, msg); p->CL --; } } SCOPE void rde_param_i_test_space (RDE_PARAM p) { test_class (p, Tcl_UniCharIsSpace, tc_space); } SCOPE void rde_param_i_test_upper (RDE_PARAM p) { test_class (p, Tcl_UniCharIsUpper, tc_upper); } SCOPE void rde_param_i_test_wordchar (RDE_PARAM p) { test_class (p, Tcl_UniCharIsWordChar, tc_wordchar); } SCOPE void rde_param_i_test_xdigit (RDE_PARAM p) { test_class (p, UniCharIsHexDigit, tc_xdigit); } static void test_class (RDE_PARAM p, UniCharClass class, test_class_id id) { Tcl_UniChar ch; Tcl_UtfToUniChar(p->CC, &ch); ASSERT_BOUNDS(id,p->numstr); p->ST = !!class (ch); if (p->ST) { ER_CLEAR (p); } else { error_set (p, id); p->CL --; } } static int UniCharIsAscii (int character) { return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { return (character >= 0) && (character < 0x80) && isxdigit(character); } static int UniCharIsDecDigit (int character) { return (character >= 0) && (character < 0x80) && isdigit(character); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); } SCOPE void rde_param_i_value_leaf (RDE_PARAM p, long int s) { Tcl_Obj* newsv; Tcl_Obj* ov [3]; long int pos = 1 + (long int) rde_stack_top (p->LS); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); newsv = Tcl_NewListObj (3, ov); TRACE (("rde_param_i_value_leaf => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); } SCOPE void rde_param_i_value_reduce (RDE_PARAM p, long int s) { Tcl_Obj* newsv; int oc, i, j; Tcl_Obj** ov; long int ac; Tcl_Obj** av; long int pos = 1 + (long int) rde_stack_top (p->LS); long int mark = (long int) rde_stack_top (p->mark); long int asize = rde_stack_size (p->ast); long int new = asize - mark; ASSERT (new >= 0, "Bad number of elements to reduce"); ov = NALLOC (3+new, Tcl_Obj*); ASSERT_BOUNDS(s,p->numstr); ov [0] = Tcl_NewStringObj (p->string[s], -1); ov [1] = Tcl_NewIntObj (pos); ov [2] = Tcl_NewIntObj (p->CL); rde_stack_get (p->ast, &ac, (void***) &av); for (i = 3, j = mark; j < asize; i++, j++) { ASSERT_BOUNDS (i, 3+new); ASSERT_BOUNDS (j, ac); ov [i] = av [j]; } ASSERT (i == 3+new, "Reduction result incomplete"); newsv = Tcl_NewListObj (3+new, ov); TRACE (("rde_param_i_value_reduce => '%s'",Tcl_GetString (newsv))); SV_SET (p, newsv); ckfree ((char*) ov); } static int er_int_compare (const void* a, const void* b) { const void** ael = (const void**) a; const void** bel = (const void**) b; long int avalue = (long int) *ael; long int bvalue = (long int) *bel; if (avalue < bvalue) { return -1; } if (avalue > bvalue) { return 1; } return 0; } SCOPE int rde_param_i_symbol_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) { if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } return 1; } rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE int rde_param_i_symbol_void_start (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); return 0; } SCOPE int rde_param_i_symbol_void_start_d (RDE_PARAM p, long int s) { if (rde_param_i_symbol_restore (p, s)) return 1; rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); return 0; } SCOPE void rde_param_i_symbol_done_d_reduce (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_reduce (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_d_leaf (RDE_PARAM p, long int s, long int m) { if (p->ST) { rde_param_i_value_leaf (p, s); } else { SV_CLEAR (p); } rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); if (p->ST) { rde_stack_push (p->ast, p->SV); Tcl_IncrRefCount (p->SV); } } SCOPE void rde_param_i_symbol_done_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_symbol_done_d_void (RDE_PARAM p, long int s, long int m) { SV_CLEAR (p); rde_param_i_symbol_save (p, s); rde_param_i_error_nonterminal (p, m); rde_param_i_ast_pop_rewind (p); rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_next_char (RDE_PARAM p, const char* c, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_char (p, c, m); } SCOPE void rde_param_i_next_range (RDE_PARAM p, const char* s, const char* e, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_range (p, s, e, m); } SCOPE void rde_param_i_next_alnum (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alnum (p); } SCOPE void rde_param_i_next_alpha (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_alpha (p); } SCOPE void rde_param_i_next_ascii (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ascii (p); } SCOPE void rde_param_i_next_control (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_control (p); } SCOPE void rde_param_i_next_ddigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_ddigit (p); } SCOPE void rde_param_i_next_digit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_digit (p); } SCOPE void rde_param_i_next_graph (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_graph (p); } SCOPE void rde_param_i_next_lower (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_lower (p); } SCOPE void rde_param_i_next_print (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_print (p); } SCOPE void rde_param_i_next_punct (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_punct (p); } SCOPE void rde_param_i_next_space (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_space (p); } SCOPE void rde_param_i_next_upper (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_upper (p); } SCOPE void rde_param_i_next_wordchar (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_wordchar (p); } SCOPE void rde_param_i_next_xdigit (RDE_PARAM p, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; rde_param_i_test_xdigit (p); } SCOPE void rde_param_i_notahead_start_d (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); } SCOPE void rde_param_i_notahead_exit_d (RDE_PARAM p) { if (p->ST) { rde_param_i_ast_pop_rewind (p); } else { rde_stack_pop (p->mark, 1); } p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_notahead_exit (RDE_PARAM p) { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); p->ST = !p->ST; } SCOPE void rde_param_i_state_push_2 (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } SCOPE void rde_param_i_state_push_void (RDE_PARAM p) { rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_push_value (RDE_PARAM p) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->LS, (void*) p->CL); ER_CLEAR (p); rde_stack_push (p->ES, p->ER); } SCOPE void rde_param_i_state_merge_ok (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); } SCOPE void rde_param_i_state_merge_value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (!p->ST) { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } SCOPE int rde_param_i_kleene_close (RDE_PARAM p) { int stop = !p->ST; rde_param_i_error_pop_merge (p); if (stop) { p->ST = 1; p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_kleene_abort (RDE_PARAM p) { int stop = !p->ST; if (stop) { p->CL = (long int) rde_stack_top (p->LS); } rde_stack_pop (p->LS, 1); return stop; } SCOPE int rde_param_i_seq_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_seq_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } return 0; } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_pop (p->LS, 1); return 1; } } SCOPE int rde_param_i_bra_void2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_void2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->LS, 1); } else { rde_stack_push (p->mark, (void*) rde_stack_size (p->ast)); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2void (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_pop (p->mark, 1); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE int rde_param_i_bra_value2value (RDE_PARAM p) { rde_param_i_error_pop_merge (p); if (p->ST) { rde_stack_pop (p->mark, 1); rde_stack_pop (p->LS, 1); } else { long int trim = (long int) rde_stack_top (p->mark); rde_stack_trim (p->ast, trim); p->CL = (long int) rde_stack_top (p->LS); rde_stack_push (p->ES, p->ER); if (p->ER) { p->ER->refCount ++; } } return p->ST; } SCOPE void rde_param_i_next_str (RDE_PARAM p, const char* str, long int m) { int at = p->CL; while (*str) { rde_param_i_input_next (p, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } rde_param_i_test_char (p, str, m); if (!p->ST) { p->ER->loc = at+1; p->CL = at; return; } str = Tcl_UtfNext (str); } } SCOPE void rde_param_i_next_class (RDE_PARAM p, const char* class, long int m) { rde_param_i_input_next (p, m); if (!p->ST) return; while (*class) { p->ST = Tcl_UtfNcmp (p->CC, class, 1) == 0; if (p->ST) { ER_CLEAR (p); return; } class = Tcl_UtfNext (class); } error_set (p, m); p->CL --; } /* * Declaring the parse functions */ static void ahead_3 (RDE_PARAM p); static void sequence_6 (RDE_PARAM p); static void sym_TEST (RDE_PARAM p); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* p_string [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ static void MAIN (RDE_PARAM p) { sym_TEST (p); return; } /* * value Symbol 'TEST' */ static void sym_TEST (RDE_PARAM p) { /* * x * & * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (p, 16)) return ; sequence_6 (p); rde_param_i_symbol_done_leaf (p, 16, 15); return; } static void sequence_6 (RDE_PARAM p) { /* * x * & * 'a' * (IDENTIFIER) */ rde_param_i_state_push_void (p); ahead_3 (p); if (rde_param_i_seq_void2void(p)) return; /* Undefined symbol 'IDENTIFIER' */; rde_param_i_status_fail (p); rde_param_i_state_merge_void (p); return; } static void ahead_3 (RDE_PARAM p) { /* * & * 'a' */ rde_param_i_loc_push (p); rde_param_i_next_char (p, "a", 14); rde_param_i_loc_pop_rewind (p); return; } /* -*- c -*- */ typedef struct PARSERg { long int counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) { ckfree((char*) cd); } static const char* PARSERnewName (Tcl_Interp* interp) { #define KEY "tcllib/parser/PACKAGE/TEA" Tcl_InterpDeleteProc* proc = PARSERgRelease; PARSERg* parserg; parserg = Tcl_GetAssocData (interp, KEY, &proc); if (parserg == NULL) { parserg = (PARSERg*) ckalloc (sizeof (PARSERg)); parserg->counter = 0; Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; sprintf (parserg->buf, "PARSER%ld", parserg->counter); return parserg->buf; #undef KEY } static void PARSERdeleteCmd (ClientData clientData) { /* * Release the whole PARSER * (Low-level engine only actually). */ rde_param_del ((RDE_PARAM) clientData); } /* * ** *** ***** ******** ************* ** Functions implementing the object methods, and helper. */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp); static int parser_PARSE (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { int mode; Tcl_Channel chan; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "chan"); return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetString (objv[2]), &mode); if (!chan) { return TCL_ERROR; } rde_param_reset (p, chan); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } static int parser_PARSET (RDE_PARAM p, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { char* buf; int len; if (objc != 3) { Tcl_WrongNumArgs (interp, 2, objv, "text"); return TCL_ERROR; } buf = Tcl_GetStringFromObj (objv[2], &len); rde_param_reset (p, NULL); rde_param_data (p, buf, len); MAIN (p) ; /* Entrypoint for the generated code. */ return COMPLETE (p, interp); } /* See also rde_critcl/m.c, param_COMPLETE() */ static int COMPLETE (RDE_PARAM p, Tcl_Interp* interp) { if (rde_param_query_st (p)) { long int ac; Tcl_Obj** av; rde_param_query_ast (p, &ac, &av); if (ac > 1) { Tcl_Obj** lv = NALLOC (3+ac, Tcl_Obj*); memcpy(lv + 3, av, ac * sizeof (Tcl_Obj*)); lv [0] = Tcl_NewObj (); lv [1] = Tcl_NewIntObj (1 + rde_param_query_lstop (p)); lv [2] = Tcl_NewIntObj (rde_param_query_cl (p)); Tcl_SetObjResult (interp, Tcl_NewListObj (3, lv)); ckfree ((char*) lv); } else if (ac == 0) { /* * Match, but no AST. This is possible if the grammar * consists of only the start expression. */ Tcl_SetObjResult (interp, Tcl_NewStringObj ("",-1)); } else { Tcl_SetObjResult (interp, av [0]); } return TCL_OK; } else { Tcl_Obj* xv [1]; const ERROR_STATE* er = rde_param_query_er (p); Tcl_Obj* res = rde_param_query_er_tcl (p, er); /* res = list (location, list(msg)) */ /* Stick the exception type-tag before the existing elements */ xv [0] = Tcl_NewStringObj ("pt::rde",-1); Tcl_ListObjReplace(interp, res, 0, 0, 1, xv); Tcl_SetErrorCode (interp, "PT", "RDE", "SYNTAX", NULL); Tcl_SetObjResult (interp, res); return TCL_ERROR; } } /* * ** *** ***** ******** ************* ** Object command, method dispatch. */ static int parser_objcmd (ClientData cd, Tcl_Interp* interp, int objc, Tcl_Obj* CONST* objv) { RDE_PARAM p = (RDE_PARAM) cd; int m, res; static CONST char* methods [] = { "destroy", "parse", "parset", NULL }; enum methods { M_DESTROY, M_PARSE, M_PARSET }; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } /* Dispatch to methods. They check the #args in * detail before performing the requested * functionality */ switch (m) { case M_DESTROY: if (objc != 2) { Tcl_WrongNumArgs (interp, 2, objv, NULL); return TCL_ERROR; } Tcl_DeleteCommandFromToken(interp, (Tcl_Command) rde_param_query_clientdata (p)); return TCL_OK; case M_PARSE: res = parser_PARSE (p, interp, objc, objv); break; case M_PARSET: res = parser_PARSET (p, interp, objc, objv); break; default: /* Not coming to this place */ ASSERT (0,"Reached unreachable location"); } return res; } /** * ** *** ***** ******** ************* * Class command, i.e. object construction. */ static int ParserClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const*objv) { /* * Syntax: No arguments beyond the name */ RDE_PARAM parser; CONST char* name; Tcl_Obj* fqn; Tcl_CmdInfo ci; Tcl_Command c; #define USAGE "?name?" if ((objc != 2) && (objc != 1)) { Tcl_WrongNumArgs (interp, 1, objv, USAGE); return TCL_ERROR; } if (objc < 2) { name = PARSERnewName (interp); } else { name = Tcl_GetString (objv [1]); } if (!Tcl_StringMatch (name, "::*")) { /* Relative name. Prefix with current namespace */ Tcl_Eval (interp, "namespace current"); fqn = Tcl_GetObjResult (interp); fqn = Tcl_DuplicateObj (fqn); Tcl_IncrRefCount (fqn); if (!Tcl_StringMatch (Tcl_GetString (fqn), "::")) { Tcl_AppendToObj (fqn, "::", -1); } Tcl_AppendToObj (fqn, name, -1); } else { fqn = Tcl_NewStringObj (name, -1); Tcl_IncrRefCount (fqn); } Tcl_ResetResult (interp); if (Tcl_GetCommandInfo (interp, Tcl_GetString (fqn), &ci)) { Tcl_Obj* err; err = Tcl_NewObj (); Tcl_AppendToObj (err, "command \"", -1); Tcl_AppendObjToObj (err, fqn); Tcl_AppendToObj (err, "\" already exists", -1); Tcl_DecrRefCount (fqn); Tcl_SetObjResult (interp, err); return TCL_ERROR; } parser = rde_param_new (sizeof(p_string)/sizeof(char*), (char**) p_string); c = Tcl_CreateObjCommand (interp, Tcl_GetString (fqn), parser_objcmd, (ClientData) parser, PARSERdeleteCmd); rde_param_clientdata (parser, (ClientData) c); Tcl_SetObjResult (interp, fqn); Tcl_DecrRefCount (fqn); return TCL_OK; } int Package_Init(Tcl_Interp* interp) { if (interp == 0) return TCL_ERROR; if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } if (Tcl_CreateObjCommand(interp, "PARSER", ParserClassCmd , NULL, NULL) == NULL) { Tcl_SetResult(interp, "Can't create constructor", NULL); return TCL_ERROR; } Tcl_PkgProvide(interp, "PACKAGE", "0.1"); return TCL_OK; } |
Changes to modules/pt/tests/data/ok/peg_cparam/0_basic_arithmetic.
︙ | ︙ | |||
28 29 30 31 32 33 34 | <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | 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 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [35] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "cl */", /* 27 = */ "n MulOp", /* 28 = */ "MulOp", /* 29 = */ "n Number", /* 30 = */ "Number", /* 31 = */ "n Sign", /* 32 = */ "Sign", /* 33 = */ "n Term", /* 34 = */ "Term" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>sym_Expression (<<state>>); return; } /* * value Symbol 'AddOp' */ <<attributes>> void <<ns>>sym_AddOp (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ if (rde_param_i_symbol_start (<<state>>, 16)) return ; rde_param_i_next_class (<<state>>, "-+", 14); rde_param_i_symbol_done_leaf (<<state>>, 16, 15); return; } /* * value Symbol 'Digit' */ <<attributes>> void <<ns>>sym_Digit (<<STATE>> <<state>>) { <<prelude>> /* * [0123456789] */ if (rde_param_i_symbol_start (<<state>>, 19)) return ; rde_param_i_next_class (<<state>>, "0123456789", 17); rde_param_i_symbol_done_leaf (<<state>>, 19, 18); return; } /* * value Symbol 'Expression' */ |
︙ | ︙ | |||
110 111 112 113 114 115 116 | * (Factor) * * * x * (MulOp) * (Factor) */ | | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (<<state>>, 23)) return ; <<self>> <<ns>>choice_20 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 23, 22); return; } <<attributes>> void <<ns>>choice_20 (<<STATE>> <<state>>) { <<prelude>> /* * / * x |
︙ | ︙ | |||
148 149 150 151 152 153 154 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); | | | | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "(", 20); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Expression (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; rde_param_i_next_char (<<state>>, ")", 21); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>sequence_18 (<<STATE>> <<state>>) { <<prelude>> /* * x |
︙ | ︙ | |||
220 221 222 223 224 225 226 | * (Term) * * * x * (AddOp) * (Term) */ | | | | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (<<state>>, 25)) return ; <<self>> <<ns>>sequence_30 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 25, 24); return; } <<attributes>> void <<ns>>sequence_30 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Term) |
︙ | ︙ | |||
284 285 286 287 288 289 290 | */ <<attributes>> void <<ns>>sym_MulOp (<<STATE>> <<state>>) { <<prelude>> /* * [\u002a\u002f] */ | | | | | | | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | */ <<attributes>> void <<ns>>sym_MulOp (<<STATE>> <<state>>) { <<prelude>> /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (<<state>>, 28)) return ; rde_param_i_next_class (<<state>>, "*/", 26); rde_param_i_symbol_done_leaf (<<state>>, 28, 27); return; } /* * value Symbol 'Number' */ <<attributes>> void <<ns>>sym_Number (<<STATE>> <<state>>) { <<prelude>> /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (<<state>>, 30)) return ; <<self>> <<ns>>sequence_41 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 30, 29); return; } <<attributes>> void <<ns>>sequence_41 (<<STATE>> <<state>>) { <<prelude>> /* * x * ? |
︙ | ︙ | |||
364 365 366 367 368 369 370 | */ <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ | | | | | | | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | */ <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ if (rde_param_i_symbol_start (<<state>>, 32)) return ; rde_param_i_next_class (<<state>>, "-+", 14); rde_param_i_symbol_done_leaf (<<state>>, 32, 31); return; } /* * value Symbol 'Term' */ <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>) { <<prelude>> /* * (Number) */ if (rde_param_i_symbol_start_d (<<state>>, 34)) return ; <<self>> <<ns>>sym_Number (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 34, 33); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/10_notahead.
︙ | ︙ | |||
12 13 14 15 16 17 18 | <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_TEST (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | > > > > > > > > > > > > > > | 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 | <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_TEST (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> |
︙ | ︙ | |||
39 40 41 42 43 44 45 | /* * x * ! * 'a' * (IDENTIFIER) */ | | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | /* * x * ! * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (<<state>>, 16)) return ; <<self>> <<ns>>sequence_6 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 16, 15); return; } <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>) { <<prelude>> /* * x * ! |
︙ | ︙ | |||
69 70 71 72 73 74 75 | <<attributes>> void <<ns>>notahead_3 (<<STATE>> <<state>>) { <<prelude>> /* * ! * 'a' */ rde_param_i_loc_push (<<state>>); | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | <<attributes>> void <<ns>>notahead_3 (<<STATE>> <<state>>) { <<prelude>> /* * ! * 'a' */ rde_param_i_loc_push (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); rde_param_i_notahead_exit (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/11_epsilon.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <<attributes>> void <<ns>>choice_3 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 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 | <<attributes>> void <<ns>>choice_3 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>choice_3 (<<state>>); return; } <<attributes>> void <<ns>>choice_3 (<<STATE>> <<state>>) { <<prelude>> /* * / * 'a' * <epsilon> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); if (rde_param_i_bra_void2void(<<state>>)) return; rde_param_i_status_ok (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/1_functions.
︙ | ︙ | |||
13 14 15 16 17 18 19 | <<attributes>> void <<ns>>sequence_9 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | | | 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 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | <<attributes>> void <<ns>>sequence_9 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [22] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "n Expression", /* 15 = */ "Expression", /* 16 = */ "n Function", /* 17 = */ "Function", /* 18 = */ "str sin(", /* 19 = */ "t )", /* 20 = */ "n Sinus", /* 21 = */ "Sinus" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>sym_Expression (<<state>>); return; } /* * value Symbol 'Expression' */ <<attributes>> void <<ns>>sym_Expression (<<STATE>> <<state>>) { <<prelude>> /* * (Function) */ if (rde_param_i_symbol_start_d (<<state>>, 15)) return ; <<self>> <<ns>>sym_Function (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 15, 14); return; } /* * value Symbol 'Function' */ <<attributes>> void <<ns>>sym_Function (<<STATE>> <<state>>) { <<prelude>> /* * (Sinus) */ if (rde_param_i_symbol_start_d (<<state>>, 17)) return ; <<self>> <<ns>>sym_Sinus (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 17, 16); return; } /* * value Symbol 'Sinus' */ <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>) { <<prelude>> /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (<<state>>, 21)) return ; <<self>> <<ns>>sequence_9 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 21, 20); return; } <<attributes>> void <<ns>>sequence_9 (<<STATE>> <<state>>) { <<prelude>> /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "sin(", 18); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Expression (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; rde_param_i_next_char (<<state>>, ")", 19); rde_param_i_state_merge_value (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/2_fun_arithmetic.
︙ | ︙ | |||
31 32 33 34 35 36 37 | <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > | | | | | | | 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 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 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 | <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [40] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl -+", /* 15 = */ "n AddOp", /* 16 = */ "AddOp", /* 17 = */ "cl 0123456789", /* 18 = */ "n Digit", /* 19 = */ "Digit", /* 20 = */ "t (", /* 21 = */ "t )", /* 22 = */ "n Expression", /* 23 = */ "Expression", /* 24 = */ "n Factor", /* 25 = */ "Factor", /* 26 = */ "n Function", /* 27 = */ "Function", /* 28 = */ "cl */", /* 29 = */ "n MulOp", /* 30 = */ "MulOp", /* 31 = */ "n Number", /* 32 = */ "Number", /* 33 = */ "n Sign", /* 34 = */ "Sign", /* 35 = */ "str sin(", /* 36 = */ "n Sinus", /* 37 = */ "Sinus", /* 38 = */ "n Term", /* 39 = */ "Term" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>sym_Expression (<<state>>); return; } /* * value Symbol 'AddOp' */ <<attributes>> void <<ns>>sym_AddOp (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ if (rde_param_i_symbol_start (<<state>>, 16)) return ; rde_param_i_next_class (<<state>>, "-+", 14); rde_param_i_symbol_done_leaf (<<state>>, 16, 15); return; } /* * value Symbol 'Digit' */ <<attributes>> void <<ns>>sym_Digit (<<STATE>> <<state>>) { <<prelude>> /* * [0123456789] */ if (rde_param_i_symbol_start (<<state>>, 19)) return ; rde_param_i_next_class (<<state>>, "0123456789", 17); rde_param_i_symbol_done_leaf (<<state>>, 19, 18); return; } /* * value Symbol 'Expression' */ |
︙ | ︙ | |||
119 120 121 122 123 124 125 | * (Factor) * * * x * (MulOp) * (Factor) */ | | | | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | * (Factor) * * * x * (MulOp) * (Factor) */ if (rde_param_i_symbol_start_d (<<state>>, 23)) return ; <<self>> <<ns>>choice_21 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 23, 22); return; } <<attributes>> void <<ns>>choice_21 (<<STATE>> <<state>>) { <<prelude>> /* * / * (Function) |
︙ | ︙ | |||
160 161 162 163 164 165 166 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); | | | | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | * x * '\(' * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "(", 20); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Expression (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; rde_param_i_next_char (<<state>>, ")", 21); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>sequence_19 (<<STATE>> <<state>>) { <<prelude>> /* * x |
︙ | ︙ | |||
232 233 234 235 236 237 238 | * (Term) * * * x * (AddOp) * (Term) */ | | | | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | * (Term) * * * x * (AddOp) * (Term) */ if (rde_param_i_symbol_start_d (<<state>>, 25)) return ; <<self>> <<ns>>sequence_31 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 25, 24); return; } <<attributes>> void <<ns>>sequence_31 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Term) |
︙ | ︙ | |||
296 297 298 299 300 301 302 | */ <<attributes>> void <<ns>>sym_Function (<<STATE>> <<state>>) { <<prelude>> /* * (Sinus) */ | | | | | | | | | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | */ <<attributes>> void <<ns>>sym_Function (<<STATE>> <<state>>) { <<prelude>> /* * (Sinus) */ if (rde_param_i_symbol_start_d (<<state>>, 27)) return ; <<self>> <<ns>>sym_Sinus (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 27, 26); return; } /* * value Symbol 'MulOp' */ <<attributes>> void <<ns>>sym_MulOp (<<STATE>> <<state>>) { <<prelude>> /* * [\u002a\u002f] */ if (rde_param_i_symbol_start (<<state>>, 30)) return ; rde_param_i_next_class (<<state>>, "*/", 28); rde_param_i_symbol_done_leaf (<<state>>, 30, 29); return; } /* * value Symbol 'Number' */ <<attributes>> void <<ns>>sym_Number (<<STATE>> <<state>>) { <<prelude>> /* * x * ? * (Sign) * + * (Digit) */ if (rde_param_i_symbol_start_d (<<state>>, 32)) return ; <<self>> <<ns>>sequence_44 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 32, 31); return; } <<attributes>> void <<ns>>sequence_44 (<<STATE>> <<state>>) { <<prelude>> /* * x * ? |
︙ | ︙ | |||
391 392 393 394 395 396 397 | */ <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ | | | | | | | | | | | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | */ <<attributes>> void <<ns>>sym_Sign (<<STATE>> <<state>>) { <<prelude>> /* * [-+] */ if (rde_param_i_symbol_start (<<state>>, 34)) return ; rde_param_i_next_class (<<state>>, "-+", 14); rde_param_i_symbol_done_leaf (<<state>>, 34, 33); return; } /* * value Symbol 'Sinus' */ <<attributes>> void <<ns>>sym_Sinus (<<STATE>> <<state>>) { <<prelude>> /* * x * "sin\(" * (Expression) * '\)' */ if (rde_param_i_symbol_start_d (<<state>>, 37)) return ; <<self>> <<ns>>sequence_52 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 37, 36); return; } <<attributes>> void <<ns>>sequence_52 (<<STATE>> <<state>>) { <<prelude>> /* * x * "sin\(" * (Expression) * '\)' */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "sin(", 35); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Expression (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; rde_param_i_next_char (<<state>>, ")", 21); rde_param_i_state_merge_value (<<state>>); return; } /* * value Symbol 'Term' */ <<attributes>> void <<ns>>sym_Term (<<STATE>> <<state>>) { <<prelude>> /* * (Number) */ if (rde_param_i_symbol_start_d (<<state>>, 39)) return ; <<self>> <<ns>>sym_Number (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 39, 38); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/3_peg_itself.
︙ | ︙ | |||
62 63 64 65 66 67 68 | <<attributes>> void <<ns>>optional_137 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_143 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Definition (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_148 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_DIGIT (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_153 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_DOT (<<STATE>> <<state>>); | < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > | 62 63 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 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | <<attributes>> void <<ns>>optional_137 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_143 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Definition (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_148 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_DIGIT (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_153 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_DOT (<<STATE>> <<state>>); <<attributes>> void <<ns>>notahead_157 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_EOF (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_EOL (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_165 (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_167 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_169 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Expression (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_176 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Final (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_182 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_186 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Grammar (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_191 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_GRAPH (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_197 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Header (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_202 (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_206 (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_208 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_210 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Ident (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_215 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Identifier (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_220 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_IS (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_225 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_LEAF (<<STATE>> <<state>>); <<attributes>> void <<ns>>notahead_230 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_233 (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_235 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_239 (<<STATE>> <<state>>); <<attributes>> void <<ns>>notahead_243 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_246 (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_248 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_252 (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_254 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Literal (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_259 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_LOWER (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_264 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_NOT (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_269 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_OPEN (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_OPENB (<<STATE>> <<state>>); <<attributes>> void <<ns>>notahead_278 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_281 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_PEG (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_286 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_PLUS (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_291 (<<STATE>> <<state>>); <<attributes>> void <<ns>>optional_293 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_296 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Prefix (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_317 (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_322 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Primary (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_327 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_PRINTABLE (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_332 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_PUNCT (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_337 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_QUESTION (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_343 (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_346 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Range (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_351 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_SEMICOLON (<<STATE>> <<state>>); <<attributes>> void <<ns>>poskleene_355 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Sequence (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_360 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_SLASH (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_365 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_SPACE (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_370 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_STAR (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_StartExpr (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_382 (<<STATE>> <<state>>); <<attributes>> void <<ns>>optional_384 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_386 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_Suffix (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_TO (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_393 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_UPPER (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_398 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_VOID (<<STATE>> <<state>>); <<attributes>> void <<ns>>choice_403 (<<STATE>> <<state>>); <<attributes>> void <<ns>>kleene_405 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_WHITESPACE (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_410 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_WORDCHAR (<<STATE>> <<state>>); <<attributes>> void <<ns>>sequence_415 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_XDIGIT (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [178] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str <alnum>", /* 15 = */ "n ALNUM", /* 16 = */ "ALNUM", /* 17 = */ "str <alpha>", /* 18 = */ "n ALPHA", /* 19 = */ "ALPHA", /* 20 = */ "t &", /* 21 = */ "n AND", /* 22 = */ "AND", /* 23 = */ "t '", /* 24 = */ "n APOSTROPH", /* 25 = */ "APOSTROPH", /* 26 = */ "str <ascii>", /* 27 = */ "n ASCII", /* 28 = */ "ASCII", /* 29 = */ "n Attribute", /* 30 = */ "Attribute", /* 31 = */ "n Char", /* 32 = */ "Char", /* 33 = */ "t \\\\", /* 34 = */ ".. 0 2", /* 35 = */ ".. 0 7", /* 36 = */ "n CharOctalFull", /* 37 = */ "CharOctalFull", /* 38 = */ "n CharOctalPart", /* 39 = */ "CharOctalPart", /* 40 = */ "cl nrt'\\\"\\[\\]\\\\", /* 41 = */ "n CharSpecial", /* 42 = */ "CharSpecial", /* 43 = */ "dot", /* 44 = */ "n CharUnescaped", /* 45 = */ "CharUnescaped", /* 46 = */ "str \173\\u\175", /* 47 = */ "n CharUnicode", /* 48 = */ "CharUnicode", /* 49 = */ "n Class", /* 50 = */ "Class", /* 51 = */ "t )", /* 52 = */ "n CLOSE", /* 53 = */ "CLOSE", /* 54 = */ "t \\]", /* 55 = */ "n CLOSEB", /* 56 = */ "CLOSEB", /* 57 = */ "t :", /* 58 = */ "n COLON", /* 59 = */ "COLON", /* 60 = */ "t #", /* 61 = */ "n COMMENT", /* 62 = */ "COMMENT", /* 63 = */ "str <control>", /* 64 = */ "n CONTROL", /* 65 = */ "CONTROL", /* 66 = */ "t \173\"\175", /* 67 = */ "n DAPOSTROPH", /* 68 = */ "DAPOSTROPH", /* 69 = */ "str <ddigit>", /* 70 = */ "n DDIGIT", /* 71 = */ "DDIGIT", /* 72 = */ "n Definition", /* 73 = */ "Definition", /* 74 = */ "str <digit>", /* 75 = */ "n DIGIT", /* 76 = */ "DIGIT", /* 77 = */ "t .", /* 78 = */ "n DOT", /* 79 = */ "DOT", /* 80 = */ "n EOF", /* 81 = */ "EOF", /* 82 = */ "cl \173\n\r\175", /* 83 = */ "n EOL", /* 84 = */ "EOL", /* 85 = */ "n Expression", /* 86 = */ "Expression", /* 87 = */ "str END", /* 88 = */ "n Final", /* 89 = */ "Final", /* 90 = */ "n Grammar", /* 91 = */ "Grammar", /* 92 = */ "str <graph>", /* 93 = */ "n GRAPH", /* 94 = */ "GRAPH", /* 95 = */ "n Header", /* 96 = */ "Header", /* 97 = */ "cl _:", /* 98 = */ "n Ident", /* 99 = */ "Ident", /* 100 = */ "n Identifier", /* 101 = */ "Identifier", /* 102 = */ "str <-", /* 103 = */ "n IS", /* 104 = */ "IS", /* 105 = */ "str leaf", /* 106 = */ "n LEAF", /* 107 = */ "LEAF", /* 108 = */ "n Literal", /* 109 = */ "Literal", /* 110 = */ "str <lower>", /* 111 = */ "n LOWER", /* 112 = */ "LOWER", /* 113 = */ "t !", /* 114 = */ "n NOT", /* 115 = */ "NOT", /* 116 = */ "t (", /* 117 = */ "n OPEN", /* 118 = */ "OPEN", /* 119 = */ "t \173[\175", /* 120 = */ "n OPENB", /* 121 = */ "OPENB", /* 122 = */ "str PEG", /* 123 = */ "n PEG", /* 124 = */ "PEG", /* 125 = */ "t +", /* 126 = */ "n PLUS", /* 127 = */ "PLUS", /* 128 = */ "n Prefix", /* 129 = */ "Prefix", /* 130 = */ "n Primary", /* 131 = */ "Primary", /* 132 = */ "str <print>", /* 133 = */ "n PRINTABLE", /* 134 = */ "PRINTABLE", /* 135 = */ "str <punct>", /* 136 = */ "n PUNCT", /* 137 = */ "PUNCT", /* 138 = */ "t ?", /* 139 = */ "n QUESTION", /* 140 = */ "QUESTION", /* 141 = */ "n Range", /* 142 = */ "Range", /* 143 = */ "t \173;\175", /* 144 = */ "n SEMICOLON", /* 145 = */ "SEMICOLON", /* 146 = */ "n Sequence", /* 147 = */ "Sequence", /* 148 = */ "t /", /* 149 = */ "n SLASH", /* 150 = */ "SLASH", /* 151 = */ "str <space>", /* 152 = */ "n SPACE", /* 153 = */ "SPACE", /* 154 = */ "t *", /* 155 = */ "n STAR", /* 156 = */ "STAR", /* 157 = */ "n StartExpr", /* 158 = */ "StartExpr", /* 159 = */ "n Suffix", /* 160 = */ "Suffix", /* 161 = */ "t -", /* 162 = */ "n TO", /* 163 = */ "TO", /* 164 = */ "str <upper>", /* 165 = */ "n UPPER", /* 166 = */ "UPPER", /* 167 = */ "str void", /* 168 = */ "n VOID", /* 169 = */ "VOID", /* 170 = */ "n WHITESPACE", /* 171 = */ "WHITESPACE", /* 172 = */ "str <wordchar>", /* 173 = */ "n WORDCHAR", /* 174 = */ "WORDCHAR", /* 175 = */ "str <xdigit>", /* 176 = */ "n XDIGIT", /* 177 = */ "XDIGIT" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> |
︙ | ︙ | |||
353 354 355 356 357 358 359 | <<attributes>> void <<ns>>sym_ALNUM (<<STATE>> <<state>>) { <<prelude>> /* * x * "<alnum>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 | <<attributes>> void <<ns>>sym_ALNUM (<<STATE>> <<state>>) { <<prelude>> /* * x * "<alnum>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 16)) return ; <<self>> <<ns>>sequence_4 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 16, 15); return; } <<attributes>> void <<ns>>sequence_4 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<alnum>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<alnum>", 14); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'ALPHA' */ <<attributes>> void <<ns>>sym_ALPHA (<<STATE>> <<state>>) { <<prelude>> /* * x * "<alpha>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 19)) return ; <<self>> <<ns>>sequence_9 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 19, 18); return; } <<attributes>> void <<ns>>sequence_9 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<alpha>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<alpha>", 17); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'AND' */ <<attributes>> void <<ns>>sym_AND (<<STATE>> <<state>>) { <<prelude>> /* * x * '&' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 22)) return ; <<self>> <<ns>>sequence_14 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 22, 21); return; } <<attributes>> void <<ns>>sequence_14 (<<STATE>> <<state>>) { <<prelude>> /* * x * '&' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "&", 20); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'APOSTROPH' */ <<attributes>> void <<ns>>sym_APOSTROPH (<<STATE>> <<state>>) { <<prelude>> /* * ''' */ if (rde_param_i_symbol_void_start (<<state>>, 25)) return ; rde_param_i_next_char (<<state>>, "'", 23); rde_param_i_symbol_done_void (<<state>>, 25, 24); return; } /* * leaf Symbol 'ASCII' */ <<attributes>> void <<ns>>sym_ASCII (<<STATE>> <<state>>) { <<prelude>> /* * x * "<ascii>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 28)) return ; <<self>> <<ns>>sequence_21 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 28, 27); return; } <<attributes>> void <<ns>>sequence_21 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<ascii>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<ascii>", 26); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Attribute' */ <<attributes>> void <<ns>>sym_Attribute (<<STATE>> <<state>>) { <<prelude>> /* * x * / * (VOID) * (LEAF) * (COLON) */ if (rde_param_i_symbol_start_d (<<state>>, 30)) return ; <<self>> <<ns>>sequence_29 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 30, 29); return; } <<attributes>> void <<ns>>sequence_29 (<<STATE>> <<state>>) { <<prelude>> /* * x * / |
︙ | ︙ | |||
550 551 552 553 554 555 556 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ | | | | 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | * (CharSpecial) * (CharOctalFull) * (CharOctalPart) * (CharUnicode) * (CharUnescaped) */ if (rde_param_i_symbol_start_d (<<state>>, 32)) return ; <<self>> <<ns>>choice_37 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 32, 31); return; } <<attributes>> void <<ns>>choice_37 (<<STATE>> <<state>>) { <<prelude>> /* * / * (CharSpecial) |
︙ | ︙ | |||
593 594 595 596 597 598 599 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ | | | | | | | | | | | | | | | | | | | | | 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ if (rde_param_i_symbol_start (<<state>>, 37)) return ; <<self>> <<ns>>sequence_44 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 37, 36); return; } <<attributes>> void <<ns>>sequence_44 (<<STATE>> <<state>>) { <<prelude>> /* * x * '\' * range (0 .. 2) * range (0 .. 7) * range (0 .. 7) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "\\", 33); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_range (<<state>>, "0", "2", 34); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_range (<<state>>, "0", "7", 35); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_range (<<state>>, "0", "7", 35); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'CharOctalPart' */ <<attributes>> void <<ns>>sym_CharOctalPart (<<STATE>> <<state>>) { <<prelude>> /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ if (rde_param_i_symbol_start (<<state>>, 39)) return ; <<self>> <<ns>>sequence_52 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 39, 38); return; } <<attributes>> void <<ns>>sequence_52 (<<STATE>> <<state>>) { <<prelude>> /* * x * '\' * range (0 .. 7) * ? * range (0 .. 7) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "\\", 33); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_range (<<state>>, "0", "7", 35); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>optional_50 (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>optional_50 (<<STATE>> <<state>>) { <<prelude>> /* * ? * range (0 .. 7) */ rde_param_i_state_push_2 (<<state>>); rde_param_i_next_range (<<state>>, "0", "7", 35); rde_param_i_state_merge_ok (<<state>>); return; } /* * leaf Symbol 'CharSpecial' */ <<attributes>> void <<ns>>sym_CharSpecial (<<STATE>> <<state>>) { <<prelude>> /* * x * '\' * [nrt'\"[]\] */ if (rde_param_i_symbol_start (<<state>>, 42)) return ; <<self>> <<ns>>sequence_57 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 42, 41); return; } <<attributes>> void <<ns>>sequence_57 (<<STATE>> <<state>>) { <<prelude>> /* * x * '\' * [nrt'\"[]\] */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "\\", 33); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_class (<<state>>, "nrt'\"[]\\", 40); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'CharUnescaped' */ <<attributes>> void <<ns>>sym_CharUnescaped (<<STATE>> <<state>>) { <<prelude>> /* * x * ! * '\' * <dot> */ if (rde_param_i_symbol_start (<<state>>, 45)) return ; <<self>> <<ns>>sequence_64 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 45, 44); return; } <<attributes>> void <<ns>>sequence_64 (<<STATE>> <<state>>) { <<prelude>> /* * x * ! * '\' * <dot> */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>notahead_61 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_input_next (<<state>>, 43); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>notahead_61 (<<STATE>> <<state>>) { <<prelude>> /* * ! * '\' */ rde_param_i_loc_push (<<state>>); rde_param_i_next_char (<<state>>, "\\", 33); rde_param_i_notahead_exit (<<state>>); return; } /* * leaf Symbol 'CharUnicode' */ |
︙ | ︙ | |||
767 768 769 770 771 772 773 | * ? * x * <xdigit> * ? * <xdigit> */ | | | | | | 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 | * ? * x * <xdigit> * ? * <xdigit> */ if (rde_param_i_symbol_start (<<state>>, 48)) return ; <<self>> <<ns>>sequence_82 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 48, 47); return; } <<attributes>> void <<ns>>sequence_82 (<<STATE>> <<state>>) { <<prelude>> /* * x * "\u" * <xdigit> * ? * x * <xdigit> * ? * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "\\u", 46); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_next_xdigit (<<state>>, 13); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>optional_80 (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>optional_80 (<<STATE>> <<state>>) { <<prelude>> |
︙ | ︙ | |||
828 829 830 831 832 833 834 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (<<state>>); | | | 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_xdigit (<<state>>, 13); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>optional_76 (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>optional_76 (<<STATE>> <<state>>) { <<prelude>> |
︙ | ︙ | |||
859 860 861 862 863 864 865 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (<<state>>); | | | | 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | * x * <xdigit> * ? * <xdigit> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_xdigit (<<state>>, 13); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>optional_72 (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>optional_72 (<<STATE>> <<state>>) { <<prelude>> /* * ? * <xdigit> */ rde_param_i_state_push_2 (<<state>>); rde_param_i_next_xdigit (<<state>>, 13); rde_param_i_state_merge_ok (<<state>>); return; } /* * value Symbol 'Class' */ |
︙ | ︙ | |||
895 896 897 898 899 900 901 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ | | | | 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 | * ! * (CLOSEB) * (Range) * (CLOSEB) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (<<state>>, 50)) return ; <<self>> <<ns>>sequence_96 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 50, 49); return; } <<attributes>> void <<ns>>sequence_96 (<<STATE>> <<state>>) { <<prelude>> /* * x * (OPENB) |
︙ | ︙ | |||
982 983 984 985 986 987 988 | <<attributes>> void <<ns>>sym_CLOSE (<<STATE>> <<state>>) { <<prelude>> /* * x * '\)' * (WHITESPACE) */ | | | | | | | | | | | 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 | <<attributes>> void <<ns>>sym_CLOSE (<<STATE>> <<state>>) { <<prelude>> /* * x * '\)' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 53)) return ; <<self>> <<ns>>sequence_101 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 53, 52); return; } <<attributes>> void <<ns>>sequence_101 (<<STATE>> <<state>>) { <<prelude>> /* * x * '\)' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, ")", 51); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'CLOSEB' */ <<attributes>> void <<ns>>sym_CLOSEB (<<STATE>> <<state>>) { <<prelude>> /* * ']' */ if (rde_param_i_symbol_void_start (<<state>>, 56)) return ; rde_param_i_next_char (<<state>>, "]", 54); rde_param_i_symbol_done_void (<<state>>, 56, 55); return; } /* * void Symbol 'COLON' */ <<attributes>> void <<ns>>sym_COLON (<<STATE>> <<state>>) { <<prelude>> /* * x * ':' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 59)) return ; <<self>> <<ns>>sequence_108 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 59, 58); return; } <<attributes>> void <<ns>>sequence_108 (<<STATE>> <<state>>) { <<prelude>> /* * x * ':' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, ":", 57); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* |
︙ | ︙ | |||
1066 1067 1068 1069 1070 1071 1072 | * x * ! * (EOL) * <dot> * (EOL) */ | | | | | 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | * x * ! * (EOL) * <dot> * (EOL) */ if (rde_param_i_symbol_void_start (<<state>>, 62)) return ; <<self>> <<ns>>sequence_121 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 62, 61); return; } <<attributes>> void <<ns>>sequence_121 (<<STATE>> <<state>>) { <<prelude>> /* * x * '#' * * * x * ! * (EOL) * <dot> * (EOL) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "#", 60); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>kleene_118 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_EOL (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } |
︙ | ︙ | |||
1122 1123 1124 1125 1126 1127 1128 | * (EOL) * <dot> */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>notahead_113 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; | | | 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | * (EOL) * <dot> */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>notahead_113 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; rde_param_i_input_next (<<state>>, 43); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>notahead_113 (<<STATE>> <<state>>) { <<prelude>> /* * ! |
︙ | ︙ | |||
1150 1151 1152 1153 1154 1155 1156 | <<attributes>> void <<ns>>sym_CONTROL (<<STATE>> <<state>>) { <<prelude>> /* * x * "<control>" * (WHITESPACE) */ | | | | | | | | | | | 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 | <<attributes>> void <<ns>>sym_CONTROL (<<STATE>> <<state>>) { <<prelude>> /* * x * "<control>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 65)) return ; <<self>> <<ns>>sequence_126 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 65, 64); return; } <<attributes>> void <<ns>>sequence_126 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<control>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<control>", 63); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'DAPOSTROPH' */ <<attributes>> void <<ns>>sym_DAPOSTROPH (<<STATE>> <<state>>) { <<prelude>> /* * '\"' */ if (rde_param_i_symbol_void_start (<<state>>, 68)) return ; rde_param_i_next_char (<<state>>, "\"", 66); rde_param_i_symbol_done_void (<<state>>, 68, 67); return; } /* * leaf Symbol 'DDIGIT' */ <<attributes>> void <<ns>>sym_DDIGIT (<<STATE>> <<state>>) { <<prelude>> /* * x * "<ddigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 71)) return ; <<self>> <<ns>>sequence_133 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 71, 70); return; } <<attributes>> void <<ns>>sequence_133 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<ddigit>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<ddigit>", 69); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* |
︙ | ︙ | |||
1233 1234 1235 1236 1237 1238 1239 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ | | | | 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 | * (Attribute) * (Identifier) * (IS) * (Expression) * (SEMICOLON) */ if (rde_param_i_symbol_start_d (<<state>>, 73)) return ; <<self>> <<ns>>sequence_143 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 73, 72); return; } <<attributes>> void <<ns>>sequence_143 (<<STATE>> <<state>>) { <<prelude>> /* * x * ? |
︙ | ︙ | |||
1287 1288 1289 1290 1291 1292 1293 | <<attributes>> void <<ns>>sym_DIGIT (<<STATE>> <<state>>) { <<prelude>> /* * x * "<digit>" * (WHITESPACE) */ | | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | | | | | | | | 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 | <<attributes>> void <<ns>>sym_DIGIT (<<STATE>> <<state>>) { <<prelude>> /* * x * "<digit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 76)) return ; <<self>> <<ns>>sequence_148 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 76, 75); return; } <<attributes>> void <<ns>>sequence_148 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<digit>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<digit>", 74); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'DOT' */ <<attributes>> void <<ns>>sym_DOT (<<STATE>> <<state>>) { <<prelude>> /* * x * '.' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 79)) return ; <<self>> <<ns>>sequence_153 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 79, 78); return; } <<attributes>> void <<ns>>sequence_153 (<<STATE>> <<state>>) { <<prelude>> /* * x * '.' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, ".", 77); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'EOF' */ <<attributes>> void <<ns>>sym_EOF (<<STATE>> <<state>>) { <<prelude>> /* * ! * <dot> */ if (rde_param_i_symbol_void_start (<<state>>, 81)) return ; <<self>> <<ns>>notahead_157 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 81, 80); return; } <<attributes>> void <<ns>>notahead_157 (<<STATE>> <<state>>) { <<prelude>> /* * ! * <dot> */ rde_param_i_loc_push (<<state>>); rde_param_i_input_next (<<state>>, 43); rde_param_i_notahead_exit (<<state>>); return; } /* * void Symbol 'EOL' */ <<attributes>> void <<ns>>sym_EOL (<<STATE>> <<state>>) { <<prelude>> /* * [\n\r] */ if (rde_param_i_symbol_void_start (<<state>>, 84)) return ; rde_param_i_next_class (<<state>>, "\n\r", 82); rde_param_i_symbol_done_void (<<state>>, 84, 83); return; } /* * value Symbol 'Expression' */ <<attributes>> void <<ns>>sym_Expression (<<STATE>> <<state>>) { <<prelude>> /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ if (rde_param_i_symbol_start_d (<<state>>, 86)) return ; <<self>> <<ns>>sequence_169 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 86, 85); return; } <<attributes>> void <<ns>>sequence_169 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Sequence) * * * x * (SLASH) * (Sequence) */ rde_param_i_state_push_value (<<state>>); <<self>> <<ns>>sym_Sequence (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>kleene_167 (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>kleene_167 (<<STATE>> <<state>>) { <<prelude>> /* * * * x * (SLASH) * (Sequence) */ while (1) { rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>sequence_165 (<<state>>); if (rde_param_i_kleene_close(<<state>>)) return; } return; } <<attributes>> void <<ns>>sequence_165 (<<STATE>> <<state>>) { <<prelude>> /* * x * (SLASH) * (Sequence) */ rde_param_i_state_push_void (<<state>>); |
︙ | ︙ | |||
1491 1492 1493 1494 1495 1496 1497 | /* * void Symbol 'Final' */ <<attributes>> void <<ns>>sym_Final (<<STATE>> <<state>>) { <<prelude>> /* * x | | > | | | | | > > > | | 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 | /* * void Symbol 'Final' */ <<attributes>> void <<ns>>sym_Final (<<STATE>> <<state>>) { <<prelude>> /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 89)) return ; <<self>> <<ns>>sequence_176 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 89, 88); return; } <<attributes>> void <<ns>>sequence_176 (<<STATE>> <<state>>) { <<prelude>> /* * x * "END" * (WHITESPACE) * (SEMICOLON) * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "END", 87); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_SEMICOLON (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } |
︙ | ︙ | |||
1535 1536 1537 1538 1539 1540 1541 | * (Header) * * * (Definition) * (Final) * (EOF) */ | | | | | | | | 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 | * (Header) * * * (Definition) * (Final) * (EOF) */ if (rde_param_i_symbol_start_d (<<state>>, 91)) return ; <<self>> <<ns>>sequence_186 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 91, 90); return; } <<attributes>> void <<ns>>sequence_186 (<<STATE>> <<state>>) { <<prelude>> /* * x * (WHITESPACE) * (Header) * * * (Definition) * (Final) * (EOF) */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>sym_WHITESPACE (<<state>>); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Header (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>kleene_182 (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_Final (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_EOF (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>kleene_182 (<<STATE>> <<state>>) { <<prelude>> /* * * * (Definition) */ while (1) { rde_param_i_state_push_2 (<<state>>); |
︙ | ︙ | |||
1591 1592 1593 1594 1595 1596 1597 | <<attributes>> void <<ns>>sym_GRAPH (<<STATE>> <<state>>) { <<prelude>> /* * x * "<graph>" * (WHITESPACE) */ | | | | | | | | | | | 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 | <<attributes>> void <<ns>>sym_GRAPH (<<STATE>> <<state>>) { <<prelude>> /* * x * "<graph>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 94)) return ; <<self>> <<ns>>sequence_191 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 94, 93); return; } <<attributes>> void <<ns>>sequence_191 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<graph>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<graph>", 92); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Header' */ <<attributes>> void <<ns>>sym_Header (<<STATE>> <<state>>) { <<prelude>> /* * x * (PEG) * (Identifier) * (StartExpr) */ if (rde_param_i_symbol_start_d (<<state>>, 96)) return ; <<self>> <<ns>>sequence_197 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 96, 95); return; } <<attributes>> void <<ns>>sequence_197 (<<STATE>> <<state>>) { <<prelude>> /* * x * (PEG) * (Identifier) * (StartExpr) */ |
︙ | ︙ | |||
1664 1665 1666 1667 1668 1669 1670 | * <alpha> * * * / * [_:] * <alnum> */ | | | | | | | | | | | | | | | | | | | | 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 | * <alpha> * * * / * [_:] * <alnum> */ if (rde_param_i_symbol_start (<<state>>, 99)) return ; <<self>> <<ns>>sequence_210 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 99, 98); return; } <<attributes>> void <<ns>>sequence_210 (<<STATE>> <<state>>) { <<prelude>> /* * x * / * [_:] * <alpha> * * * / * [_:] * <alnum> */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>choice_202 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>kleene_208 (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>choice_202 (<<STATE>> <<state>>) { <<prelude>> /* * / * [_:] * <alpha> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_class (<<state>>, "_:", 97); if (rde_param_i_bra_void2void(<<state>>)) return; rde_param_i_next_alpha (<<state>>, 1); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>kleene_208 (<<STATE>> <<state>>) { <<prelude>> /* * * * / * [_:] * <alnum> */ while (1) { rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>choice_206 (<<state>>); if (rde_param_i_kleene_close(<<state>>)) return; } return; } <<attributes>> void <<ns>>choice_206 (<<STATE>> <<state>>) { <<prelude>> /* * / * [_:] * <alnum> */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_class (<<state>>, "_:", 97); if (rde_param_i_bra_void2void(<<state>>)) return; rde_param_i_next_alnum (<<state>>, 0); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Identifier' */ <<attributes>> void <<ns>>sym_Identifier (<<STATE>> <<state>>) { <<prelude>> /* * x * (Ident) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (<<state>>, 101)) return ; <<self>> <<ns>>sequence_215 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 101, 100); return; } <<attributes>> void <<ns>>sequence_215 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Ident) * (WHITESPACE) */ rde_param_i_state_push_value (<<state>>); |
︙ | ︙ | |||
1779 1780 1781 1782 1783 1784 1785 | <<attributes>> void <<ns>>sym_IS (<<STATE>> <<state>>) { <<prelude>> /* * x * "<-" * (WHITESPACE) */ | | | | | | | | | | | | 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 | <<attributes>> void <<ns>>sym_IS (<<STATE>> <<state>>) { <<prelude>> /* * x * "<-" * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 104)) return ; <<self>> <<ns>>sequence_220 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 104, 103); return; } <<attributes>> void <<ns>>sequence_220 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<-" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<-", 102); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'LEAF' */ <<attributes>> void <<ns>>sym_LEAF (<<STATE>> <<state>>) { <<prelude>> /* * x * "leaf" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 107)) return ; <<self>> <<ns>>sequence_225 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 107, 106); return; } <<attributes>> void <<ns>>sequence_225 (<<STATE>> <<state>>) { <<prelude>> /* * x * "leaf" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "leaf", 105); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* |
︙ | ︙ | |||
1859 1860 1861 1862 1863 1864 1865 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ | | | | | | 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 | * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ if (rde_param_i_symbol_start_d (<<state>>, 109)) return ; <<self>> <<ns>>choice_254 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 109, 108); return; } <<attributes>> void <<ns>>choice_254 (<<STATE>> <<state>>) { <<prelude>> /* * / * x * (APOSTROPH) * * * x * ! |
︙ | ︙ | |||
1889 1890 1891 1892 1893 1894 1895 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (<<state>>); | | | | | | | | | | | | | | | | | | 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 | * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_value (<<state>>); <<self>> <<ns>>sequence_239 (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sequence_252 (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>sequence_239 (<<STATE>> <<state>>) { <<prelude>> /* * x * (APOSTROPH) * * * x * ! * (APOSTROPH) * (Char) * (APOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>sym_APOSTROPH (<<state>>); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>kleene_235 (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_APOSTROPH (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>kleene_235 (<<STATE>> <<state>>) { <<prelude>> /* * * * x * ! * (APOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>sequence_233 (<<state>>); if (rde_param_i_kleene_close(<<state>>)) return; } return; } <<attributes>> void <<ns>>sequence_233 (<<STATE>> <<state>>) { <<prelude>> /* * x * ! * (APOSTROPH) * (Char) */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>notahead_230 (<<state>>); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Char (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>notahead_230 (<<STATE>> <<state>>) { <<prelude>> /* * ! * (APOSTROPH) */ rde_param_i_loc_push (<<state>>); <<self>> <<ns>>sym_APOSTROPH (<<state>>); rde_param_i_notahead_exit (<<state>>); return; } <<attributes>> void <<ns>>sequence_252 (<<STATE>> <<state>>) { <<prelude>> /* * x * (DAPOSTROPH) * * * x * ! * (DAPOSTROPH) * (Char) * (DAPOSTROPH) * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>sym_DAPOSTROPH (<<state>>); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>kleene_248 (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_DAPOSTROPH (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>kleene_248 (<<STATE>> <<state>>) { <<prelude>> /* * * * x * ! * (DAPOSTROPH) * (Char) */ while (1) { rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>sequence_246 (<<state>>); if (rde_param_i_kleene_close(<<state>>)) return; } return; } <<attributes>> void <<ns>>sequence_246 (<<STATE>> <<state>>) { <<prelude>> /* * x * ! * (DAPOSTROPH) * (Char) */ rde_param_i_state_push_void (<<state>>); <<self>> <<ns>>notahead_243 (<<state>>); if (rde_param_i_seq_void2value(<<state>>)) return; <<self>> <<ns>>sym_Char (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>notahead_243 (<<STATE>> <<state>>) { <<prelude>> /* * ! * (DAPOSTROPH) */ rde_param_i_loc_push (<<state>>); <<self>> <<ns>>sym_DAPOSTROPH (<<state>>); |
︙ | ︙ | |||
2047 2048 2049 2050 2051 2052 2053 | <<attributes>> void <<ns>>sym_LOWER (<<STATE>> <<state>>) { <<prelude>> /* * x * "<lower>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | > > > > | | | | > > > > | > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 | <<attributes>> void <<ns>>sym_LOWER (<<STATE>> <<state>>) { <<prelude>> /* * x * "<lower>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 112)) return ; <<self>> <<ns>>sequence_259 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 112, 111); return; } <<attributes>> void <<ns>>sequence_259 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<lower>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<lower>", 110); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'NOT' */ <<attributes>> void <<ns>>sym_NOT (<<STATE>> <<state>>) { <<prelude>> /* * x * '!' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 115)) return ; <<self>> <<ns>>sequence_264 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 115, 114); return; } <<attributes>> void <<ns>>sequence_264 (<<STATE>> <<state>>) { <<prelude>> /* * x * '!' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "!", 113); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'OPEN' */ <<attributes>> void <<ns>>sym_OPEN (<<STATE>> <<state>>) { <<prelude>> /* * x * '\(' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 118)) return ; <<self>> <<ns>>sequence_269 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 118, 117); return; } <<attributes>> void <<ns>>sequence_269 (<<STATE>> <<state>>) { <<prelude>> /* * x * '\(' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "(", 116); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'OPENB' */ <<attributes>> void <<ns>>sym_OPENB (<<STATE>> <<state>>) { <<prelude>> /* * '[' */ if (rde_param_i_symbol_void_start (<<state>>, 121)) return ; rde_param_i_next_char (<<state>>, "[", 119); rde_param_i_symbol_done_void (<<state>>, 121, 120); return; } /* * void Symbol 'PEG' */ <<attributes>> void <<ns>>sym_PEG (<<STATE>> <<state>>) { <<prelude>> /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 124)) return ; <<self>> <<ns>>sequence_281 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 124, 123); return; } <<attributes>> void <<ns>>sequence_281 (<<STATE>> <<state>>) { <<prelude>> /* * x * "PEG" * ! * / * [_:] * <alnum> * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "PEG", 122); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>notahead_278 (<<state>>); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } <<attributes>> void <<ns>>notahead_278 (<<STATE>> <<state>>) { <<prelude>> /* * ! * / * [_:] * <alnum> */ rde_param_i_loc_push (<<state>>); <<self>> <<ns>>choice_206 (<<state>>); rde_param_i_notahead_exit (<<state>>); return; } /* * leaf Symbol 'PLUS' */ <<attributes>> void <<ns>>sym_PLUS (<<STATE>> <<state>>) { <<prelude>> /* * x * '+' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 127)) return ; <<self>> <<ns>>sequence_286 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 127, 126); return; } <<attributes>> void <<ns>>sequence_286 (<<STATE>> <<state>>) { <<prelude>> /* * x * '+' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "+", 125); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Prefix' */ <<attributes>> void <<ns>>sym_Prefix (<<STATE>> <<state>>) { <<prelude>> /* * x * ? * / * (AND) * (NOT) * (Suffix) */ if (rde_param_i_symbol_start_d (<<state>>, 129)) return ; <<self>> <<ns>>sequence_296 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 129, 128); return; } <<attributes>> void <<ns>>sequence_296 (<<STATE>> <<state>>) { <<prelude>> /* * x * ? * / * (AND) * (NOT) * (Suffix) */ rde_param_i_state_push_value (<<state>>); <<self>> <<ns>>optional_293 (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>sym_Suffix (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>optional_293 (<<STATE>> <<state>>) { <<prelude>> /* * ? * / * (AND) * (NOT) */ rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>choice_291 (<<state>>); rde_param_i_state_merge_ok (<<state>>); return; } <<attributes>> void <<ns>>choice_291 (<<STATE>> <<state>>) { <<prelude>> /* * / * (AND) * (NOT) */ rde_param_i_state_push_value (<<state>>); |
︙ | ︙ | |||
2309 2310 2311 2312 2313 2314 2315 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ | | | | | | 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 | * (Expression) * (CLOSE) * (Literal) * (Class) * (DOT) */ if (rde_param_i_symbol_start_d (<<state>>, 131)) return ; <<self>> <<ns>>choice_322 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 131, 130); return; } <<attributes>> void <<ns>>choice_322 (<<STATE>> <<state>>) { <<prelude>> /* * / * (ALNUM) * (ALPHA) * (ASCII) * (CONTROL) * (DDIGIT) |
︙ | ︙ | |||
2373 2374 2375 2376 2377 2378 2379 | if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_WORDCHAR (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_XDIGIT (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_Identifier (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; | | | | 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 | if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_WORDCHAR (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_XDIGIT (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_Identifier (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sequence_317 (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_Literal (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_Class (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_DOT (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>sequence_317 (<<STATE>> <<state>>) { <<prelude>> /* * x * (OPEN) * (Expression) * (CLOSE) */ |
︙ | ︙ | |||
2413 2414 2415 2416 2417 2418 2419 | <<attributes>> void <<ns>>sym_PRINTABLE (<<STATE>> <<state>>) { <<prelude>> /* * x * "<print>" * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 | <<attributes>> void <<ns>>sym_PRINTABLE (<<STATE>> <<state>>) { <<prelude>> /* * x * "<print>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 134)) return ; <<self>> <<ns>>sequence_327 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 134, 133); return; } <<attributes>> void <<ns>>sequence_327 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<print>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<print>", 132); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'PUNCT' */ <<attributes>> void <<ns>>sym_PUNCT (<<STATE>> <<state>>) { <<prelude>> /* * x * "<punct>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 137)) return ; <<self>> <<ns>>sequence_332 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 137, 136); return; } <<attributes>> void <<ns>>sequence_332 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<punct>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<punct>", 135); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'QUESTION' */ <<attributes>> void <<ns>>sym_QUESTION (<<STATE>> <<state>>) { <<prelude>> /* * x * '?' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 140)) return ; <<self>> <<ns>>sequence_337 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 140, 139); return; } <<attributes>> void <<ns>>sequence_337 (<<STATE>> <<state>>) { <<prelude>> /* * x * '?' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "?", 138); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Range' */ <<attributes>> void <<ns>>sym_Range (<<STATE>> <<state>>) { <<prelude>> /* * / * x * (Char) * (TO) * (Char) * (Char) */ if (rde_param_i_symbol_start_d (<<state>>, 142)) return ; <<self>> <<ns>>choice_346 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 142, 141); return; } <<attributes>> void <<ns>>choice_346 (<<STATE>> <<state>>) { <<prelude>> /* * / * x * (Char) * (TO) * (Char) * (Char) */ rde_param_i_state_push_value (<<state>>); <<self>> <<ns>>sequence_343 (<<state>>); if (rde_param_i_bra_value2value(<<state>>)) return; <<self>> <<ns>>sym_Char (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>sequence_343 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Char) * (TO) * (Char) */ |
︙ | ︙ | |||
2565 2566 2567 2568 2569 2570 2571 | <<attributes>> void <<ns>>sym_SEMICOLON (<<STATE>> <<state>>) { <<prelude>> /* * x * ';' * (WHITESPACE) */ | | | | | | | | | | | 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 | <<attributes>> void <<ns>>sym_SEMICOLON (<<STATE>> <<state>>) { <<prelude>> /* * x * ';' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 145)) return ; <<self>> <<ns>>sequence_351 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 145, 144); return; } <<attributes>> void <<ns>>sequence_351 (<<STATE>> <<state>>) { <<prelude>> /* * x * ';' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, ";", 143); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'Sequence' */ <<attributes>> void <<ns>>sym_Sequence (<<STATE>> <<state>>) { <<prelude>> /* * + * (Prefix) */ if (rde_param_i_symbol_start_d (<<state>>, 147)) return ; <<self>> <<ns>>poskleene_355 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 147, 146); return; } <<attributes>> void <<ns>>poskleene_355 (<<STATE>> <<state>>) { <<prelude>> /* * + * (Prefix) */ rde_param_i_loc_push (<<state>>); <<self>> <<ns>>sym_Prefix (<<state>>); |
︙ | ︙ | |||
2630 2631 2632 2633 2634 2635 2636 | <<attributes>> void <<ns>>sym_SLASH (<<STATE>> <<state>>) { <<prelude>> /* * x * '/' * (WHITESPACE) */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 | <<attributes>> void <<ns>>sym_SLASH (<<STATE>> <<state>>) { <<prelude>> /* * x * '/' * (WHITESPACE) */ if (rde_param_i_symbol_void_start (<<state>>, 150)) return ; <<self>> <<ns>>sequence_360 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 150, 149); return; } <<attributes>> void <<ns>>sequence_360 (<<STATE>> <<state>>) { <<prelude>> /* * x * '/' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "/", 148); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'SPACE' */ <<attributes>> void <<ns>>sym_SPACE (<<STATE>> <<state>>) { <<prelude>> /* * x * "<space>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 153)) return ; <<self>> <<ns>>sequence_365 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 153, 152); return; } <<attributes>> void <<ns>>sequence_365 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<space>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<space>", 151); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'STAR' */ <<attributes>> void <<ns>>sym_STAR (<<STATE>> <<state>>) { <<prelude>> /* * x * '*' * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 156)) return ; <<self>> <<ns>>sequence_370 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 156, 155); return; } <<attributes>> void <<ns>>sequence_370 (<<STATE>> <<state>>) { <<prelude>> /* * x * '*' * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_char (<<state>>, "*", 154); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * value Symbol 'StartExpr' */ <<attributes>> void <<ns>>sym_StartExpr (<<STATE>> <<state>>) { <<prelude>> /* * x * (OPEN) * (Expression) * (CLOSE) */ if (rde_param_i_symbol_start_d (<<state>>, 158)) return ; <<self>> <<ns>>sequence_317 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 158, 157); return; } /* * value Symbol 'Suffix' */ <<attributes>> void <<ns>>sym_Suffix (<<STATE>> <<state>>) { <<prelude>> /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ if (rde_param_i_symbol_start_d (<<state>>, 160)) return ; <<self>> <<ns>>sequence_386 (<<state>>); rde_param_i_symbol_done_d_reduce (<<state>>, 160, 159); return; } <<attributes>> void <<ns>>sequence_386 (<<STATE>> <<state>>) { <<prelude>> /* * x * (Primary) * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_value (<<state>>); <<self>> <<ns>>sym_Primary (<<state>>); if (rde_param_i_seq_value2value(<<state>>)) return; <<self>> <<ns>>optional_384 (<<state>>); rde_param_i_state_merge_value (<<state>>); return; } <<attributes>> void <<ns>>optional_384 (<<STATE>> <<state>>) { <<prelude>> /* * ? * / * (QUESTION) * (STAR) * (PLUS) */ rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>choice_382 (<<state>>); rde_param_i_state_merge_ok (<<state>>); return; } <<attributes>> void <<ns>>choice_382 (<<STATE>> <<state>>) { <<prelude>> /* * / * (QUESTION) * (STAR) * (PLUS) */ |
︙ | ︙ | |||
2815 2816 2817 2818 2819 2820 2821 | */ <<attributes>> void <<ns>>sym_TO (<<STATE>> <<state>>) { <<prelude>> /* * '-' */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 | */ <<attributes>> void <<ns>>sym_TO (<<STATE>> <<state>>) { <<prelude>> /* * '-' */ if (rde_param_i_symbol_void_start (<<state>>, 163)) return ; rde_param_i_next_char (<<state>>, "-", 161); rde_param_i_symbol_done_void (<<state>>, 163, 162); return; } /* * leaf Symbol 'UPPER' */ <<attributes>> void <<ns>>sym_UPPER (<<STATE>> <<state>>) { <<prelude>> /* * x * "<upper>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 166)) return ; <<self>> <<ns>>sequence_393 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 166, 165); return; } <<attributes>> void <<ns>>sequence_393 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<upper>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<upper>", 164); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'VOID' */ <<attributes>> void <<ns>>sym_VOID (<<STATE>> <<state>>) { <<prelude>> /* * x * "void" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 169)) return ; <<self>> <<ns>>sequence_398 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 169, 168); return; } <<attributes>> void <<ns>>sequence_398 (<<STATE>> <<state>>) { <<prelude>> /* * x * "void" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "void", 167); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * void Symbol 'WHITESPACE' */ <<attributes>> void <<ns>>sym_WHITESPACE (<<STATE>> <<state>>) { <<prelude>> /* * * * / * <space> * (COMMENT) */ if (rde_param_i_symbol_void_start (<<state>>, 171)) return ; <<self>> <<ns>>kleene_405 (<<state>>); rde_param_i_symbol_done_void (<<state>>, 171, 170); return; } <<attributes>> void <<ns>>kleene_405 (<<STATE>> <<state>>) { <<prelude>> /* * * * / * <space> * (COMMENT) */ while (1) { rde_param_i_state_push_2 (<<state>>); <<self>> <<ns>>choice_403 (<<state>>); if (rde_param_i_kleene_close(<<state>>)) return; } return; } <<attributes>> void <<ns>>choice_403 (<<STATE>> <<state>>) { <<prelude>> /* * / * <space> * (COMMENT) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_space (<<state>>, 10); if (rde_param_i_bra_void2void(<<state>>)) return; <<self>> <<ns>>sym_COMMENT (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'WORDCHAR' */ <<attributes>> void <<ns>>sym_WORDCHAR (<<STATE>> <<state>>) { <<prelude>> /* * x * "<wordchar>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 174)) return ; <<self>> <<ns>>sequence_410 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 174, 173); return; } <<attributes>> void <<ns>>sequence_410 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<wordchar>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<wordchar>", 172); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* * leaf Symbol 'XDIGIT' */ <<attributes>> void <<ns>>sym_XDIGIT (<<STATE>> <<state>>) { <<prelude>> /* * x * "<xdigit>" * (WHITESPACE) */ if (rde_param_i_symbol_start (<<state>>, 177)) return ; <<self>> <<ns>>sequence_415 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 177, 176); return; } <<attributes>> void <<ns>>sequence_415 (<<STATE>> <<state>>) { <<prelude>> /* * x * "<xdigit>" * (WHITESPACE) */ rde_param_i_state_push_void (<<state>>); rde_param_i_next_str (<<state>>, "<xdigit>", 175); if (rde_param_i_seq_void2void(<<state>>)) return; <<self>> <<ns>>sym_WHITESPACE (<<state>>); rde_param_i_state_merge_void (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/4_choice.
︙ | ︙ | |||
9 10 11 12 13 14 15 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 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 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "cl abc" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> rde_param_i_next_class (<<state>>, "abc", 14); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/5_sequence.
︙ | ︙ | |||
9 10 11 12 13 14 15 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 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 | */ /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "str abc" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> rde_param_i_next_str (<<state>>, "abc", 14); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/6_optional.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <<attributes>> void <<ns>>optional_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 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 | <<attributes>> void <<ns>>optional_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>optional_2 (<<state>>); return; } <<attributes>> void <<ns>>optional_2 (<<STATE>> <<state>>) { <<prelude>> /* * ? * 'a' */ rde_param_i_state_push_2 (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); rde_param_i_state_merge_ok (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/7_kleene.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <<attributes>> void <<ns>>kleene_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | 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 | <<attributes>> void <<ns>>kleene_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>kleene_2 (<<state>>); return; } <<attributes>> void <<ns>>kleene_2 (<<STATE>> <<state>>) { <<prelude>> /* * * * 'a' */ while (1) { rde_param_i_state_push_2 (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); if (rde_param_i_kleene_close(<<state>>)) return; } return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/8_pkleene.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <<attributes>> void <<ns>>poskleene_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | > > > > > > > > > > > > > > | | | 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 | <<attributes>> void <<ns>>poskleene_2 (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [15] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> <<self>> <<ns>>poskleene_2 (<<state>>); return; } <<attributes>> void <<ns>>poskleene_2 (<<STATE>> <<state>>) { <<prelude>> /* * + * 'a' */ rde_param_i_loc_push (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); if (rde_param_i_kleene_abort(<<state>>)) return; while (1) { rde_param_i_state_push_2 (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); if (rde_param_i_kleene_close(<<state>>)) return; } return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_cparam/9_ahead.
︙ | ︙ | |||
12 13 14 15 16 17 18 | <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_TEST (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ | | | | | > > > > > > > > > > > > > > | 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 | <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>); <<attributes>> void <<ns>>sym_TEST (<<STATE>> <<state>>); /* * Precomputed table of strings (symbols, error messages, etc.). */ static char const* <<string-table>> [17] = { /* 0 = */ "alnum", /* 1 = */ "alpha", /* 2 = */ "ascii", /* 3 = */ "control", /* 4 = */ "ddigit", /* 5 = */ "digit", /* 6 = */ "graph", /* 7 = */ "lower", /* 8 = */ "print", /* 9 = */ "punct", /* 10 = */ "space", /* 11 = */ "upper", /* 12 = */ "wordchar", /* 13 = */ "xdigit", /* 14 = */ "t a", /* 15 = */ "n TEST", /* 16 = */ "TEST" }; /* * Grammar Start Expression */ <<attributes>> void <<ns>><<main>> (<<STATE>> <<state>>) { <<prelude>> |
︙ | ︙ | |||
39 40 41 42 43 44 45 | /* * x * & * 'a' * (IDENTIFIER) */ | | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | /* * x * & * 'a' * (IDENTIFIER) */ if (rde_param_i_symbol_start (<<state>>, 16)) return ; <<self>> <<ns>>sequence_6 (<<state>>); rde_param_i_symbol_done_leaf (<<state>>, 16, 15); return; } <<attributes>> void <<ns>>sequence_6 (<<STATE>> <<state>>) { <<prelude>> /* * x * & |
︙ | ︙ | |||
69 70 71 72 73 74 75 | <<attributes>> void <<ns>>ahead_3 (<<STATE>> <<state>>) { <<prelude>> /* * & * 'a' */ rde_param_i_loc_push (<<state>>); | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | <<attributes>> void <<ns>>ahead_3 (<<STATE>> <<state>>) { <<prelude>> /* * & * 'a' */ rde_param_i_loc_push (<<state>>); rde_param_i_next_char (<<state>>, "a", 14); rde_param_i_loc_pop_rewind (<<state>>); return; } /* */ |
Changes to modules/pt/tests/data/ok/peg_json-indalign/3_peg_itself.
︙ | ︙ | |||
89 90 91 92 93 94 95 | "is" : "x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}", "mode" : "leaf" }, "DOT" : { "is" : "x {t .} {n WHITESPACE}", "mode" : "leaf" }, | < < < < | | 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 | "is" : "x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}", "mode" : "leaf" }, "DOT" : { "is" : "x {t .} {n WHITESPACE}", "mode" : "leaf" }, "EOF" : { "is" : "! dot", "mode" : "void" }, "EOL" : { "is" : "/ {t {\n}} {t {\r}}", "mode" : "void" }, "Expression" : { "is" : "x {n Sequence} {* {x {n SLASH} {n Sequence}}}", "mode" : "value" }, "Final" : { "is" : "x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}", "mode" : "void" }, "Grammar" : { "is" : "x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}", "mode" : "value" }, "GRAPH" : { |
︙ | ︙ | |||
158 159 160 161 162 163 164 | "mode" : "void" }, "OPENB" : { "is" : "t {[}", "mode" : "void" }, "PEG" : { | | | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | "mode" : "void" }, "OPENB" : { "is" : "t {[}", "mode" : "void" }, "PEG" : { "is" : "x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}", "mode" : "void" }, "PLUS" : { "is" : "x {t +} {n WHITESPACE}", "mode" : "leaf" }, "Prefix" : { |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_json-indented/3_peg_itself.
︙ | ︙ | |||
89 90 91 92 93 94 95 | "is" : "x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}", "mode" : "leaf" }, "DOT" : { "is" : "x {t .} {n WHITESPACE}", "mode" : "leaf" }, | < < < < | | 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 | "is" : "x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}", "mode" : "leaf" }, "DOT" : { "is" : "x {t .} {n WHITESPACE}", "mode" : "leaf" }, "EOF" : { "is" : "! dot", "mode" : "void" }, "EOL" : { "is" : "/ {t {\n}} {t {\r}}", "mode" : "void" }, "Expression" : { "is" : "x {n Sequence} {* {x {n SLASH} {n Sequence}}}", "mode" : "value" }, "Final" : { "is" : "x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}", "mode" : "void" }, "Grammar" : { "is" : "x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}", "mode" : "value" }, "GRAPH" : { |
︙ | ︙ | |||
158 159 160 161 162 163 164 | "mode" : "void" }, "OPENB" : { "is" : "t {[}", "mode" : "void" }, "PEG" : { | | | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | "mode" : "void" }, "OPENB" : { "is" : "t {[}", "mode" : "void" }, "PEG" : { "is" : "x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}", "mode" : "void" }, "PLUS" : { "is" : "x {t +} {n WHITESPACE}", "mode" : "leaf" }, "Prefix" : { |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_json-ultracompact/3_peg_itself.
|
| | | 1 | {"pt::grammar::peg":{"rules":{"ALNUM":{"is":"x {t <} {t a} {t l} {t n} {t u} {t m} {t >} {n WHITESPACE}","mode":"leaf"},"ALPHA":{"is":"x {t <} {t a} {t l} {t p} {t h} {t a} {t >} {n WHITESPACE}","mode":"leaf"},"AND":{"is":"x {t &} {n WHITESPACE}","mode":"leaf"},"APOSTROPH":{"is":"t '","mode":"void"},"ASCII":{"is":"x {t <} {t a} {t s} {t c} {t i} {t i} {t >} {n WHITESPACE}","mode":"leaf"},"Attribute":{"is":"x {/ {n VOID} {n LEAF}} {n COLON}","mode":"value"},"Char":{"is":"/ {n CharSpecial} {n CharOctalFull} {n CharOctalPart} {n CharUnicode} {n CharUnescaped}","mode":"value"},"CharOctalFull":{"is":"x {t \\\\} {.. 0 2} {.. 0 7} {.. 0 7}","mode":"leaf"},"CharOctalPart":{"is":"x {t \\\\} {.. 0 7} {? {.. 0 7}}","mode":"leaf"},"CharSpecial":{"is":"x {t \\\\} {/ {t n} {t r} {t t} {t '} {t {\"}} {t {[}} {t \\]} {t \\\\}}","mode":"leaf"},"CharUnescaped":{"is":"x {! {t \\\\}} dot","mode":"leaf"},"CharUnicode":{"is":"x {t \\\\} {t u} xdigit {? {x xdigit {? {x xdigit {? xdigit}}}}}","mode":"leaf"},"Class":{"is":"x {n OPENB} {* {x {! {n CLOSEB}} {n Range}}} {n CLOSEB} {n WHITESPACE}","mode":"value"},"CLOSE":{"is":"x {t )} {n WHITESPACE}","mode":"void"},"CLOSEB":{"is":"t \\]","mode":"void"},"COLON":{"is":"x {t :} {n WHITESPACE}","mode":"void"},"COMMENT":{"is":"x {t #} {* {x {! {n EOL}} dot}} {n EOL}","mode":"void"},"CONTROL":{"is":"x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}","mode":"leaf"},"DAPOSTROPH":{"is":"t {\"}","mode":"void"},"DDIGIT":{"is":"x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}","mode":"leaf"},"Definition":{"is":"x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}","mode":"value"},"DIGIT":{"is":"x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}","mode":"leaf"},"DOT":{"is":"x {t .} {n WHITESPACE}","mode":"leaf"},"EOF":{"is":"! dot","mode":"void"},"EOL":{"is":"/ {t {\n}} {t {\r}}","mode":"void"},"Expression":{"is":"x {n Sequence} {* {x {n SLASH} {n Sequence}}}","mode":"value"},"Final":{"is":"x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}","mode":"void"},"Grammar":{"is":"x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}","mode":"value"},"GRAPH":{"is":"x {t <} {t g} {t r} {t a} {t p} {t h} {t >} {n WHITESPACE}","mode":"leaf"},"Header":{"is":"x {n PEG} {n Identifier} {n StartExpr}","mode":"value"},"Ident":{"is":"x {/ {t _} {t :} alpha} {* {/ {t _} {t :} alnum}}","mode":"leaf"},"Identifier":{"is":"x {n Ident} {n WHITESPACE}","mode":"value"},"IS":{"is":"x {t <} {t -} {n WHITESPACE}","mode":"void"},"LEAF":{"is":"x {t l} {t e} {t a} {t f} {n WHITESPACE}","mode":"leaf"},"Literal":{"is":"/ {x {n APOSTROPH} {* {x {! {n APOSTROPH}} {n Char}}} {n APOSTROPH} {n WHITESPACE}} {x {n DAPOSTROPH} {* {x {! {n DAPOSTROPH}} {n Char}}} {n DAPOSTROPH} {n WHITESPACE}}","mode":"value"},"LOWER":{"is":"x {t <} {t l} {t o} {t w} {t e} {t r} {t >} {n WHITESPACE}","mode":"leaf"},"NOT":{"is":"x {t !} {n WHITESPACE}","mode":"leaf"},"OPEN":{"is":"x {t (} {n WHITESPACE}","mode":"void"},"OPENB":{"is":"t {[}","mode":"void"},"PEG":{"is":"x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}","mode":"void"},"PLUS":{"is":"x {t +} {n WHITESPACE}","mode":"leaf"},"Prefix":{"is":"x {? {/ {n AND} {n NOT}}} {n Suffix}","mode":"value"},"Primary":{"is":"/ {n ALNUM} {n ALPHA} {n ASCII} {n CONTROL} {n DDIGIT} {n DIGIT} {n GRAPH} {n LOWER} {n PRINTABLE} {n PUNCT} {n SPACE} {n UPPER} {n WORDCHAR} {n XDIGIT} {n Identifier} {x {n OPEN} {n Expression} {n CLOSE}} {n Literal} {n Class} {n DOT}","mode":"value"},"PRINTABLE":{"is":"x {t <} {t p} {t r} {t i} {t n} {t t} {t >} {n WHITESPACE}","mode":"leaf"},"PUNCT":{"is":"x {t <} {t p} {t u} {t n} {t c} {t t} {t >} {n WHITESPACE}","mode":"leaf"},"QUESTION":{"is":"x {t ?} {n WHITESPACE}","mode":"leaf"},"Range":{"is":"/ {x {n Char} {n TO} {n Char}} {n Char}","mode":"value"},"SEMICOLON":{"is":"x {t {;}} {n WHITESPACE}","mode":"void"},"Sequence":{"is":"+ {n Prefix}","mode":"value"},"SLASH":{"is":"x {t /} {n WHITESPACE}","mode":"void"},"SPACE":{"is":"x {t <} {t s} {t p} {t a} {t c} {t e} {t >} {n WHITESPACE}","mode":"leaf"},"STAR":{"is":"x {t *} {n WHITESPACE}","mode":"leaf"},"StartExpr":{"is":"x {n OPEN} {n Expression} {n CLOSE}","mode":"value"},"Suffix":{"is":"x {n Primary} {? {/ {n QUESTION} {n STAR} {n PLUS}}}","mode":"value"},"TO":{"is":"t -","mode":"void"},"UPPER":{"is":"x {t <} {t u} {t p} {t p} {t e} {t r} {t >} {n WHITESPACE}","mode":"leaf"},"VOID":{"is":"x {t v} {t o} {t i} {t d} {n WHITESPACE}","mode":"leaf"},"WHITESPACE":{"is":"* {/ space {n COMMENT}}","mode":"void"},"WORDCHAR":{"is":"x {t <} {t w} {t o} {t r} {t d} {t c} {t h} {t a} {t r} {t >} {n WHITESPACE}","mode":"leaf"},"XDIGIT":{"is":"x {t <} {t x} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}","mode":"leaf"}},"start":"n Grammar"}} |
Changes to modules/pt/tests/data/ok/peg_param-compact/3_peg_itself.
︙ | ︙ | |||
746 747 748 749 750 751 752 | failed_93: loc_pop_rewind return char_85: # '\' | | | | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 | failed_93: loc_pop_rewind return char_85: # '\' input_next "t \" ok! test_char "\" return range_87: # range (0 .. 2) input_next ".. 0 2" ok! test_range "0" "2" |
︙ | ︙ | |||
1018 1019 1020 1021 1022 1023 1024 | input_next "t t" ok! test_char "t" return char_114: # '\"' | | | | 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | input_next "t t" ok! test_char "t" return char_114: # '\"' input_next "t "" ok! test_char """ return char_116: # '[' input_next "t [" ok! test_char "[" |
︙ | ︙ | |||
2239 2240 2241 2242 2243 2244 2245 | char_274: # '.' input_next "t ." ok! test_char "." return # | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 | char_274: # '.' input_next "t ." ok! test_char "." return # # void Symbol 'EOF' # sym_EOF: # ! # <dot> symbol_restore EOF found! return loc_push call notahead_283 value_clear symbol_save EOF error_nonterminal EOF loc_pop_discard return notahead_283: # ! # <dot> loc_push input_next "dot" |
︙ | ︙ | |||
2367 2368 2369 2370 2371 2372 2373 | # '\n' # '\r' symbol_restore EOL found! return loc_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | | | > > > > > > > > > > > > > > > > > > > > > | | | | | > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 | # '\n' # '\r' symbol_restore EOL found! return loc_push call choice_291 value_clear symbol_save EOL error_nonterminal EOL loc_pop_discard return choice_291: # / # '\n' # '\r' error_clear loc_push error_push call char_286 error_pop_merge ok! jump oknoast_290 loc_pop_rewind loc_push error_push call char_288 error_pop_merge ok! jump oknoast_290 loc_pop_rewind status_fail return oknoast_290: loc_pop_discard return char_286: # '\n' input_next "t <LF>" ok! test_char "<LF>" return char_288: # '\r' input_next "t <CR>" ok! test_char "<CR>" return # # value Symbol 'Expression' # sym_Expression: # x # (Sequence) # * # x # (SLASH) # (Sequence) symbol_restore Expression found! jump found_307 loc_push ast_push call sequence_304 fail! value_clear ok! value_reduce Expression symbol_save Expression error_nonterminal Expression ast_pop_rewind loc_pop_discard found_307: ok! ast_value_push return sequence_304: # x # (Sequence) # * # x # (SLASH) # (Sequence) ast_push loc_push error_clear error_push call sym_Sequence error_pop_merge fail! jump failed_305 error_push call kleene_301 error_pop_merge fail! jump failed_305 ast_pop_discard loc_pop_discard return failed_305: ast_pop_rewind loc_pop_rewind return kleene_301: # * # x # (SLASH) # (Sequence) loc_push error_push call sequence_297 error_pop_merge fail! jump failed_302 loc_pop_discard jump kleene_301 failed_302: loc_pop_rewind status_ok return sequence_297: # x # (SLASH) # (Sequence) loc_push error_clear error_push call sym_SLASH error_pop_merge fail! jump failednoast_299 ast_push error_push call sym_Sequence error_pop_merge fail! jump failed_298 ast_pop_discard loc_pop_discard return failed_298: ast_pop_rewind failednoast_299: loc_pop_rewind return # # void Symbol 'Final' # sym_Final: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) symbol_restore Final found! return loc_push call sequence_318 value_clear symbol_save Final error_nonterminal Final loc_pop_discard return sequence_318: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) loc_push error_clear error_push call char_309 error_pop_merge fail! jump failed_319 error_push call char_311 error_pop_merge fail! jump failed_319 error_push call char_313 error_pop_merge fail! jump failed_319 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_319 error_push call sym_SEMICOLON error_pop_merge fail! jump failed_319 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_319 loc_pop_discard return failed_319: loc_pop_rewind return char_309: # 'E' input_next "t E" ok! test_char "E" return char_311: # 'N' input_next "t N" ok! test_char "N" return char_313: # 'D' input_next "t D" ok! test_char "D" return # # value Symbol 'Grammar' # sym_Grammar: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) symbol_restore Grammar found! jump found_334 loc_push ast_push call sequence_330 fail! value_clear ok! value_reduce Grammar symbol_save Grammar error_nonterminal Grammar ast_pop_rewind loc_pop_discard found_334: ok! ast_value_push return sequence_330: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) loc_push error_clear error_push call sym_WHITESPACE error_pop_merge fail! jump failednoast_332 ast_push error_push call sym_Header error_pop_merge fail! jump failed_331 error_push call kleene_325 error_pop_merge fail! jump failed_331 error_push call sym_Final error_pop_merge fail! jump failed_331 error_push call sym_EOF error_pop_merge fail! jump failed_331 ast_pop_discard loc_pop_discard return failed_331: ast_pop_rewind failednoast_332: loc_pop_rewind return kleene_325: # * # (Definition) loc_push error_push call sym_Definition error_pop_merge fail! jump failed_326 loc_pop_discard jump kleene_325 failed_326: loc_pop_rewind status_ok return # # leaf Symbol 'GRAPH' # sym_GRAPH: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) symbol_restore GRAPH found! jump found_347 loc_push call sequence_344 fail! value_clear ok! value_leaf GRAPH symbol_save GRAPH error_nonterminal GRAPH loc_pop_discard found_347: ok! ast_value_push return sequence_344: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_345 error_push call char_238 error_pop_merge fail! jump failed_345 error_push call char_109 error_pop_merge fail! jump failed_345 error_push call char_4 error_pop_merge fail! jump failed_345 error_push call char_25 error_pop_merge fail! jump failed_345 error_push call char_27 error_pop_merge fail! jump failed_345 error_push call char_14 error_pop_merge fail! jump failed_345 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_345 loc_pop_discard return failed_345: loc_pop_rewind return # # value Symbol 'Header' # sym_Header: # x # (PEG) # (Identifier) # (StartExpr) symbol_restore Header found! jump found_356 loc_push ast_push call sequence_352 fail! value_clear ok! value_reduce Header symbol_save Header error_nonterminal Header ast_pop_rewind loc_pop_discard found_356: ok! ast_value_push return sequence_352: # x # (PEG) # (Identifier) # (StartExpr) loc_push error_clear error_push call sym_PEG error_pop_merge fail! jump failednoast_354 ast_push error_push call sym_Identifier error_pop_merge fail! jump failed_353 error_push call sym_StartExpr error_pop_merge fail! jump failed_353 ast_pop_discard loc_pop_discard return failed_353: ast_pop_rewind failednoast_354: loc_pop_rewind return # # leaf Symbol 'Ident' # sym_Ident: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> symbol_restore Ident found! jump found_379 loc_push call sequence_376 fail! value_clear ok! value_leaf Ident symbol_save Ident error_nonterminal Ident loc_pop_discard found_379: ok! ast_value_push return sequence_376: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> loc_push error_clear error_push call choice_364 error_pop_merge fail! jump failed_377 error_push call kleene_373 error_pop_merge fail! jump failed_377 loc_pop_discard return failed_377: loc_pop_rewind return choice_364: # / # '_' # ':' # <alpha> error_clear loc_push error_push call char_358 error_pop_merge ok! jump oknoast_363 loc_pop_rewind loc_push error_push call char_191 error_pop_merge ok! jump oknoast_363 loc_pop_rewind loc_push error_push call alpha_361 error_pop_merge ok! jump oknoast_363 loc_pop_rewind status_fail return oknoast_363: loc_pop_discard return char_358: # '_' input_next "t _" ok! test_char "_" return alpha_361: # <alpha> input_next "alpha" ok! test_alpha return kleene_373: # * # / # '_' # ':' # <alnum> loc_push error_push call choice_371 error_pop_merge fail! jump failed_374 loc_pop_discard jump kleene_373 failed_374: loc_pop_rewind status_ok return choice_371: # / # '_' # ':' # <alnum> error_clear loc_push error_push call char_358 error_pop_merge ok! jump oknoast_370 loc_pop_rewind loc_push error_push call char_191 error_pop_merge ok! jump oknoast_370 loc_pop_rewind loc_push error_push call alnum_368 error_pop_merge ok! jump oknoast_370 loc_pop_rewind status_fail return oknoast_370: loc_pop_discard return alnum_368: # <alnum> input_next "alnum" ok! test_alnum return # # value Symbol 'Identifier' # sym_Identifier: # x # (Ident) # (WHITESPACE) symbol_restore Identifier found! jump found_386 loc_push ast_push call sequence_383 fail! value_clear ok! value_reduce Identifier symbol_save Identifier error_nonterminal Identifier ast_pop_rewind loc_pop_discard found_386: ok! ast_value_push return sequence_383: # x # (Ident) # (WHITESPACE) ast_push loc_push error_clear error_push call sym_Ident error_pop_merge fail! jump failed_384 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_384 ast_pop_discard loc_pop_discard return failed_384: ast_pop_rewind loc_pop_rewind return # # void Symbol 'IS' # sym_IS: # x # '<' # '-' # (WHITESPACE) symbol_restore IS found! return loc_push call sequence_392 value_clear symbol_save IS error_nonterminal IS loc_pop_discard return sequence_392: # x # '<' # '-' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_393 error_push call char_389 error_pop_merge fail! jump failed_393 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_393 loc_pop_discard return failed_393: loc_pop_rewind return char_389: # '-' input_next "t -" ok! test_char "-" return # # leaf Symbol 'LEAF' # sym_LEAF: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) symbol_restore LEAF found! jump found_406 loc_push call sequence_403 fail! value_clear ok! value_leaf LEAF symbol_save LEAF error_nonterminal LEAF loc_pop_discard found_406: ok! ast_value_push return sequence_403: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) loc_push error_clear error_push call char_6 error_pop_merge fail! jump failed_404 error_push call char_397 error_pop_merge fail! jump failed_404 error_push call char_4 error_pop_merge fail! jump failed_404 error_push call char_400 error_pop_merge fail! jump failed_404 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_404 loc_pop_discard return failed_404: loc_pop_rewind return char_397: # 'e' input_next "t e" ok! test_char "e" return char_400: # 'f' input_next "t f" ok! test_char "f" return # # value Symbol 'Literal' |
︙ | ︙ | |||
3293 3294 3295 3296 3297 3298 3299 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal | | | | | | 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal found! jump found_447 loc_push ast_push call choice_445 fail! value_clear ok! value_reduce Literal symbol_save Literal error_nonterminal Literal ast_pop_rewind loc_pop_discard found_447: ok! ast_value_push return choice_445: # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
3337 3338 3339 3340 3341 3342 3343 | error_clear ast_push loc_push error_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 | error_clear ast_push loc_push error_push call sequence_422 error_pop_merge ok! jump ok_444 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_440 error_pop_merge ok! jump ok_444 ast_pop_rewind loc_pop_rewind status_fail return ok_444: ast_pop_discard loc_pop_discard return sequence_422: # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_APOSTROPH error_pop_merge fail! jump failednoast_424 ast_push error_push call kleene_417 error_pop_merge fail! jump failed_423 error_push call sym_APOSTROPH error_pop_merge fail! jump failed_423 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_423 ast_pop_discard loc_pop_discard return failed_423: ast_pop_rewind failednoast_424: loc_pop_rewind return kleene_417: # * # x # ! # (APOSTROPH) # (Char) loc_push error_push call sequence_413 error_pop_merge fail! jump failed_418 loc_pop_discard jump kleene_417 failed_418: loc_pop_rewind status_ok return sequence_413: # x # ! # (APOSTROPH) # (Char) loc_push error_clear error_push call notahead_410 error_pop_merge fail! jump failednoast_415 ast_push error_push call sym_Char error_pop_merge fail! jump failed_414 ast_pop_discard loc_pop_discard return failed_414: ast_pop_rewind failednoast_415: loc_pop_rewind return notahead_410: # ! # (APOSTROPH) loc_push call sym_APOSTROPH loc_pop_rewind status_negate return sequence_440: # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_DAPOSTROPH error_pop_merge fail! jump failednoast_442 ast_push error_push call kleene_435 error_pop_merge fail! jump failed_441 error_push call sym_DAPOSTROPH error_pop_merge fail! jump failed_441 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_441 ast_pop_discard loc_pop_discard return failed_441: ast_pop_rewind failednoast_442: loc_pop_rewind return kleene_435: # * # x # ! # (DAPOSTROPH) # (Char) loc_push error_push call sequence_431 error_pop_merge fail! jump failed_436 loc_pop_discard jump kleene_435 failed_436: loc_pop_rewind status_ok return sequence_431: # x # ! # (DAPOSTROPH) # (Char) loc_push error_clear error_push call notahead_428 error_pop_merge fail! jump failednoast_433 ast_push error_push call sym_Char error_pop_merge fail! jump failed_432 ast_pop_discard loc_pop_discard return failed_432: ast_pop_rewind failednoast_433: loc_pop_rewind return notahead_428: # ! # (DAPOSTROPH) loc_push call sym_DAPOSTROPH |
︙ | ︙ | |||
3616 3617 3618 3619 3620 3621 3622 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER found! jump found_461 loc_push call sequence_458 fail! value_clear ok! value_leaf LOWER symbol_save LOWER error_nonterminal LOWER loc_pop_discard found_461: ok! ast_value_push return sequence_458: # x # '<' # 'l' # 'o' # 'w' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_459 error_push call char_6 error_pop_merge fail! jump failed_459 error_push call char_217 error_pop_merge fail! jump failed_459 error_push call char_452 error_pop_merge fail! jump failed_459 error_push call char_397 error_pop_merge fail! jump failed_459 error_push call char_109 error_pop_merge fail! jump failed_459 error_push call char_14 error_pop_merge fail! jump failed_459 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_459 loc_pop_discard return failed_459: loc_pop_rewind return char_452: # 'w' input_next "t w" ok! test_char "w" return # # leaf Symbol 'NOT' # sym_NOT: # x # '!' # (WHITESPACE) symbol_restore NOT found! jump found_469 loc_push call sequence_466 fail! value_clear ok! value_leaf NOT symbol_save NOT error_nonterminal NOT loc_pop_discard found_469: ok! ast_value_push return sequence_466: # x # '!' # (WHITESPACE) loc_push error_clear error_push call char_463 error_pop_merge fail! jump failed_467 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_467 loc_pop_discard return failed_467: loc_pop_rewind return char_463: # '!' input_next "t !" ok! test_char "!" return # # void Symbol 'OPEN' # sym_OPEN: # x # '\(' # (WHITESPACE) symbol_restore OPEN found! return loc_push call sequence_474 value_clear symbol_save OPEN error_nonterminal OPEN loc_pop_discard return sequence_474: # x # '\(' # (WHITESPACE) loc_push error_clear error_push call char_471 error_pop_merge fail! jump failed_475 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_475 loc_pop_discard return failed_475: loc_pop_rewind return char_471: # '\(' input_next "t (" ok! test_char "(" return # # void Symbol 'OPENB' |
︙ | ︙ | |||
3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 | # sym_PEG: # x # 'P' # 'E' # 'G' # (WHITESPACE) symbol_restore PEG found! return loc_push | > > > > > | | > > > > > | | | | | | > > > > > > | | | | > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 | # sym_PEG: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) symbol_restore PEG found! return loc_push call sequence_493 value_clear symbol_save PEG error_nonterminal PEG loc_pop_discard return sequence_493: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) loc_push error_clear error_push call char_480 error_pop_merge fail! jump failed_494 error_push call char_309 error_pop_merge fail! jump failed_494 error_push call char_483 error_pop_merge fail! jump failed_494 error_push call notahead_490 error_pop_merge fail! jump failed_494 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_494 loc_pop_discard return failed_494: loc_pop_rewind return char_480: # 'P' input_next "t P" ok! test_char "P" return char_483: # 'G' input_next "t G" ok! test_char "G" return notahead_490: # ! # / # '_' # ':' # <alnum> loc_push call choice_371 loc_pop_rewind status_negate return # # leaf Symbol 'PLUS' # sym_PLUS: # x # '+' # (WHITESPACE) symbol_restore PLUS found! jump found_503 loc_push call sequence_500 fail! value_clear ok! value_leaf PLUS symbol_save PLUS error_nonterminal PLUS loc_pop_discard found_503: ok! ast_value_push return sequence_500: # x # '+' # (WHITESPACE) loc_push error_clear error_push call char_497 error_pop_merge fail! jump failed_501 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_501 loc_pop_discard return failed_501: loc_pop_rewind return char_497: # '+' input_next "t +" ok! test_char "+" return # # value Symbol 'Prefix' # sym_Prefix: # x # ? # / # (AND) # (NOT) # (Suffix) symbol_restore Prefix found! jump found_516 loc_push ast_push call sequence_513 fail! value_clear ok! value_reduce Prefix symbol_save Prefix error_nonterminal Prefix ast_pop_rewind loc_pop_discard found_516: ok! ast_value_push return sequence_513: # x # ? # / # (AND) # (NOT) # (Suffix) ast_push loc_push error_clear error_push call optional_510 error_pop_merge fail! jump failed_514 error_push call sym_Suffix error_pop_merge fail! jump failed_514 ast_pop_discard loc_pop_discard return failed_514: ast_pop_rewind loc_pop_rewind return optional_510: # ? # / # (AND) # (NOT) loc_push error_push call choice_508 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_508: # / # (AND) # (NOT) error_clear ast_push loc_push error_push call sym_AND error_pop_merge ok! jump ok_507 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_NOT error_pop_merge ok! jump ok_507 ast_pop_rewind loc_pop_rewind status_fail return ok_507: ast_pop_discard loc_pop_discard return # # value Symbol 'Primary' # |
︙ | ︙ | |||
4123 4124 4125 4126 4127 4128 4129 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary | | | | | | 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary found! jump found_546 loc_push ast_push call choice_544 fail! value_clear ok! value_reduce Primary symbol_save Primary error_nonterminal Primary ast_pop_rewind loc_pop_discard found_546: ok! ast_value_push return choice_544: # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
4174 4175 4176 4177 4178 4179 4180 | ast_push loc_push error_push call sym_ALNUM error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 | ast_push loc_push error_push call sym_ALNUM error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ALPHA error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ASCII error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_CONTROL error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DDIGIT error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DIGIT error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_GRAPH error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_LOWER error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PRINTABLE error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PUNCT error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_SPACE error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_UPPER error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_WORDCHAR error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_XDIGIT error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Identifier error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_536 error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Literal error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Class error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DOT error_pop_merge ok! jump ok_543 ast_pop_rewind loc_pop_rewind status_fail return ok_543: ast_pop_discard loc_pop_discard return sequence_536: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_538 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_537 error_push call sym_CLOSE error_pop_merge fail! jump failed_537 ast_pop_discard loc_pop_discard return failed_537: ast_pop_rewind failednoast_538: loc_pop_rewind return # # leaf Symbol 'PRINTABLE' # sym_PRINTABLE: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) symbol_restore PRINTABLE found! jump found_559 loc_push call sequence_556 fail! value_clear ok! value_leaf PRINTABLE symbol_save PRINTABLE error_nonterminal PRINTABLE loc_pop_discard found_559: ok! ast_value_push return sequence_556: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_557 error_push call char_25 error_pop_merge fail! jump failed_557 error_push call char_109 error_pop_merge fail! jump failed_557 error_push call char_54 error_pop_merge fail! jump failed_557 error_push call char_8 error_pop_merge fail! jump failed_557 error_push call char_111 error_pop_merge fail! jump failed_557 error_push call char_14 error_pop_merge fail! jump failed_557 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_557 loc_pop_discard return failed_557: loc_pop_rewind return # # leaf Symbol 'PUNCT' # sym_PUNCT: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) symbol_restore PUNCT found! jump found_572 loc_push call sequence_569 fail! value_clear ok! value_leaf PUNCT symbol_save PUNCT error_nonterminal PUNCT loc_pop_discard found_572: ok! ast_value_push return sequence_569: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_570 error_push call char_25 error_pop_merge fail! jump failed_570 error_push call char_10 error_pop_merge fail! jump failed_570 error_push call char_8 error_pop_merge fail! jump failed_570 error_push call char_52 error_pop_merge fail! jump failed_570 error_push call char_111 error_pop_merge fail! jump failed_570 error_push call char_14 error_pop_merge fail! jump failed_570 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_570 loc_pop_discard return failed_570: loc_pop_rewind return # # leaf Symbol 'QUESTION' # sym_QUESTION: # x # '?' # (WHITESPACE) symbol_restore QUESTION found! jump found_580 loc_push call sequence_577 fail! value_clear ok! value_leaf QUESTION symbol_save QUESTION error_nonterminal QUESTION loc_pop_discard found_580: ok! ast_value_push return sequence_577: # x # '?' # (WHITESPACE) loc_push error_clear error_push call char_574 error_pop_merge fail! jump failed_578 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_578 loc_pop_discard return failed_578: loc_pop_rewind return char_574: # '?' input_next "t ?" ok! test_char "?" return # # value Symbol 'Range' # sym_Range: # / # x # (Char) # (TO) # (Char) # (Char) symbol_restore Range found! jump found_592 loc_push ast_push call choice_590 fail! value_clear ok! value_reduce Range symbol_save Range error_nonterminal Range ast_pop_rewind loc_pop_discard found_592: ok! ast_value_push return choice_590: # / # x # (Char) # (TO) # (Char) # (Char) error_clear ast_push loc_push error_push call sequence_585 error_pop_merge ok! jump ok_589 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Char error_pop_merge ok! jump ok_589 ast_pop_rewind loc_pop_rewind status_fail return ok_589: ast_pop_discard loc_pop_discard return sequence_585: # x # (Char) # (TO) # (Char) ast_push loc_push error_clear error_push call sym_Char error_pop_merge fail! jump failed_586 error_push call sym_TO error_pop_merge fail! jump failed_586 error_push call sym_Char error_pop_merge fail! jump failed_586 ast_pop_discard loc_pop_discard return failed_586: ast_pop_rewind loc_pop_rewind return # # void Symbol 'SEMICOLON' # sym_SEMICOLON: # x # ';' # (WHITESPACE) symbol_restore SEMICOLON found! return loc_push call sequence_597 value_clear symbol_save SEMICOLON error_nonterminal SEMICOLON loc_pop_discard return sequence_597: # x # ';' # (WHITESPACE) loc_push error_clear error_push call char_594 error_pop_merge fail! jump failed_598 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_598 loc_pop_discard return failed_598: loc_pop_rewind return char_594: # ';' input_next "t ;" ok! test_char ";" return # # value Symbol 'Sequence' # sym_Sequence: # + # (Prefix) symbol_restore Sequence found! jump found_606 loc_push ast_push call poskleene_602 fail! value_clear ok! value_reduce Sequence symbol_save Sequence error_nonterminal Sequence ast_pop_rewind loc_pop_discard found_606: ok! ast_value_push return poskleene_602: # + # (Prefix) loc_push call sym_Prefix fail! jump failed_603 loop_604: loc_pop_discard loc_push error_push call sym_Prefix error_pop_merge ok! jump loop_604 status_ok failed_603: loc_pop_rewind return # # void Symbol 'SLASH' # sym_SLASH: # x # '/' # (WHITESPACE) symbol_restore SLASH found! return loc_push call sequence_611 value_clear symbol_save SLASH error_nonterminal SLASH loc_pop_discard return sequence_611: # x # '/' # (WHITESPACE) loc_push error_clear error_push call char_608 error_pop_merge fail! jump failed_612 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_612 loc_pop_discard return failed_612: loc_pop_rewind return char_608: # '/' input_next "t /" ok! test_char "/" return # # leaf Symbol 'SPACE' |
︙ | ︙ | |||
4965 4966 4967 4968 4969 4970 4971 | # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 | # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE found! jump found_626 loc_push call sequence_623 fail! value_clear ok! value_leaf SPACE symbol_save SPACE error_nonterminal SPACE loc_pop_discard found_626: ok! ast_value_push return sequence_623: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_624 error_push call char_50 error_pop_merge fail! jump failed_624 error_push call char_25 error_pop_merge fail! jump failed_624 error_push call char_4 error_pop_merge fail! jump failed_624 error_push call char_52 error_pop_merge fail! jump failed_624 error_push call char_397 error_pop_merge fail! jump failed_624 error_push call char_14 error_pop_merge fail! jump failed_624 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_624 loc_pop_discard return failed_624: loc_pop_rewind return # # leaf Symbol 'STAR' # sym_STAR: # x # '*' # (WHITESPACE) symbol_restore STAR found! jump found_634 loc_push call sequence_631 fail! value_clear ok! value_leaf STAR symbol_save STAR error_nonterminal STAR loc_pop_discard found_634: ok! ast_value_push return sequence_631: # x # '*' # (WHITESPACE) loc_push error_clear error_push call char_628 error_pop_merge fail! jump failed_632 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_632 loc_pop_discard return failed_632: loc_pop_rewind return char_628: # '*' input_next "t *" ok! test_char "*" return # # value Symbol 'StartExpr' # sym_StartExpr: # x # (OPEN) # (Expression) # (CLOSE) symbol_restore StartExpr found! jump found_640 loc_push ast_push call sequence_536 fail! value_clear ok! value_reduce StartExpr symbol_save StartExpr error_nonterminal StartExpr ast_pop_rewind loc_pop_discard found_640: ok! ast_value_push return # # value Symbol 'Suffix' # sym_Suffix: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) symbol_restore Suffix found! jump found_654 loc_push ast_push call sequence_651 fail! value_clear ok! value_reduce Suffix symbol_save Suffix error_nonterminal Suffix ast_pop_rewind loc_pop_discard found_654: ok! ast_value_push return sequence_651: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) ast_push loc_push error_clear error_push call sym_Primary error_pop_merge fail! jump failed_652 error_push call optional_649 error_pop_merge fail! jump failed_652 ast_pop_discard loc_pop_discard return failed_652: ast_pop_rewind loc_pop_rewind return optional_649: # ? # / # (QUESTION) # (STAR) # (PLUS) loc_push error_push call choice_647 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_647: # / # (QUESTION) # (STAR) # (PLUS) error_clear ast_push loc_push error_push call sym_QUESTION error_pop_merge ok! jump ok_646 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_STAR error_pop_merge ok! jump ok_646 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PLUS error_pop_merge ok! jump ok_646 ast_pop_rewind loc_pop_rewind status_fail return ok_646: ast_pop_discard loc_pop_discard return # # void Symbol 'TO' # sym_TO: # '-' symbol_restore TO found! return loc_push call char_389 value_clear symbol_save TO error_nonterminal TO loc_pop_discard return # |
︙ | ︙ | |||
5301 5302 5303 5304 5305 5306 5307 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER found! jump found_669 loc_push call sequence_666 fail! value_clear ok! value_leaf UPPER symbol_save UPPER error_nonterminal UPPER loc_pop_discard found_669: ok! ast_value_push return sequence_666: # x # '<' # 'u' # 'p' # 'p' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_667 error_push call char_10 error_pop_merge fail! jump failed_667 error_push call char_25 error_pop_merge fail! jump failed_667 error_push call char_25 error_pop_merge fail! jump failed_667 error_push call char_397 error_pop_merge fail! jump failed_667 error_push call char_109 error_pop_merge fail! jump failed_667 error_push call char_14 error_pop_merge fail! jump failed_667 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_667 loc_pop_discard return failed_667: loc_pop_rewind return # # leaf Symbol 'VOID' # sym_VOID: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) symbol_restore VOID found! jump found_680 loc_push call sequence_677 fail! value_clear ok! value_leaf VOID symbol_save VOID error_nonterminal VOID loc_pop_discard found_680: ok! ast_value_push return sequence_677: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) loc_push error_clear error_push call char_671 error_pop_merge fail! jump failed_678 error_push call char_217 error_pop_merge fail! jump failed_678 error_push call char_54 error_pop_merge fail! jump failed_678 error_push call char_234 error_pop_merge fail! jump failed_678 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_678 loc_pop_discard return failed_678: loc_pop_rewind return char_671: # 'v' input_next "t v" ok! test_char "v" return # # void Symbol 'WHITESPACE' # sym_WHITESPACE: # * # / # <space> # (COMMENT) symbol_restore WHITESPACE found! return loc_push call kleene_688 value_clear symbol_save WHITESPACE error_nonterminal WHITESPACE loc_pop_discard return kleene_688: # * # / # <space> # (COMMENT) loc_push error_push call choice_686 error_pop_merge fail! jump failed_689 loc_pop_discard jump kleene_688 failed_689: loc_pop_rewind status_ok return choice_686: # / # <space> # (COMMENT) error_clear loc_push error_push call space_682 error_pop_merge ok! jump oknoast_685 loc_pop_rewind loc_push error_push call sym_COMMENT error_pop_merge ok! jump oknoast_685 loc_pop_rewind status_fail return oknoast_685: loc_pop_discard return space_682: # <space> input_next "space" ok! test_space return # # leaf Symbol 'WORDCHAR' |
︙ | ︙ | |||
5568 5569 5570 5571 5572 5573 5574 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR | | | | | | 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR found! jump found_706 loc_push call sequence_703 fail! value_clear ok! value_leaf WORDCHAR symbol_save WORDCHAR error_nonterminal WORDCHAR loc_pop_discard found_706: ok! ast_value_push return sequence_703: # x # '<' # 'w' # 'o' # 'r' # 'd' # 'c' |
︙ | ︙ | |||
5605 5606 5607 5608 5609 5610 5611 | error_clear error_push call char_2 error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 | error_clear error_push call char_2 error_pop_merge fail! jump failed_704 error_push call char_452 error_pop_merge fail! jump failed_704 error_push call char_217 error_pop_merge fail! jump failed_704 error_push call char_109 error_pop_merge fail! jump failed_704 error_push call char_234 error_pop_merge fail! jump failed_704 error_push call char_52 error_pop_merge fail! jump failed_704 error_push call char_27 error_pop_merge fail! jump failed_704 error_push call char_4 error_pop_merge fail! jump failed_704 error_push call char_109 error_pop_merge fail! jump failed_704 error_push call char_14 error_pop_merge fail! jump failed_704 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_704 loc_pop_discard return failed_704: loc_pop_rewind return # # leaf Symbol 'XDIGIT' # sym_XDIGIT: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) symbol_restore XDIGIT found! jump found_721 loc_push call sequence_718 fail! value_clear ok! value_leaf XDIGIT symbol_save XDIGIT error_nonterminal XDIGIT loc_pop_discard found_721: ok! ast_value_push return sequence_718: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_2 error_pop_merge fail! jump failed_719 error_push call char_709 error_pop_merge fail! jump failed_719 error_push call char_234 error_pop_merge fail! jump failed_719 error_push call char_54 error_pop_merge fail! jump failed_719 error_push call char_238 error_pop_merge fail! jump failed_719 error_push call char_54 error_pop_merge fail! jump failed_719 error_push call char_111 error_pop_merge fail! jump failed_719 error_push call char_14 error_pop_merge fail! jump failed_719 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_719 loc_pop_discard return failed_719: loc_pop_rewind return char_709: # 'x' input_next "t x" ok! test_char "x" return # # |
Changes to modules/pt/tests/data/ok/peg_param-inlined/3_peg_itself.
︙ | ︙ | |||
638 639 640 641 642 643 644 | # range (0 .. 7) loc_push error_clear error_push | | | | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | # range (0 .. 7) loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_76 error_push input_next ".. 0 2" ok! test_range "0" "2" |
︙ | ︙ | |||
710 711 712 713 714 715 716 | # range (0 .. 7) loc_push error_clear error_push | | | | 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | # range (0 .. 7) loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_86 error_push input_next ".. 0 7" ok! test_range "0" "7" |
︙ | ︙ | |||
802 803 804 805 806 807 808 | # '\' loc_push error_clear error_push | | | | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | # '\' loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_103 error_push call choice_100 |
︙ | ︙ | |||
877 878 879 880 881 882 883 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push | | | | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push input_next "t "" ok! test_char """ error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push |
︙ | ︙ | |||
907 908 909 910 911 912 913 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push | | | | 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push input_next "t \" ok! test_char "\" error_pop_merge ok! jump oknoast_99 loc_pop_rewind status_fail return |
︙ | ︙ | |||
981 982 983 984 985 986 987 | notahead_108: # ! # '\' loc_push | | | | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 | notahead_108: # ! # '\' loc_push input_next "t \" ok! test_char "\" loc_pop_rewind status_negate return # # leaf Symbol 'CharUnicode' # |
︙ | ︙ | |||
1040 1041 1042 1043 1044 1045 1046 | # <xdigit> loc_push error_clear error_push | | | | 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 | # <xdigit> loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_135 error_push input_next "t u" ok! test_char "u" |
︙ | ︙ | |||
1722 1723 1724 1725 1726 1727 1728 | sym_DAPOSTROPH: # '\"' symbol_restore DAPOSTROPH found! return loc_push | | | | 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | sym_DAPOSTROPH: # '\"' symbol_restore DAPOSTROPH found! return loc_push input_next "t "" ok! test_char """ value_clear symbol_save DAPOSTROPH error_nonterminal DAPOSTROPH loc_pop_discard return # |
︙ | ︙ | |||
2105 2106 2107 2108 2109 2110 2111 | loc_pop_discard return failed_248: loc_pop_rewind return # | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 | loc_pop_discard return failed_248: loc_pop_rewind return # # void Symbol 'EOF' # sym_EOF: # ! # <dot> symbol_restore EOF found! return loc_push call notahead_253 value_clear symbol_save EOF error_nonterminal EOF loc_pop_discard return notahead_253: # ! # <dot> loc_push input_next "dot" |
︙ | ︙ | |||
2215 2216 2217 2218 2219 2220 2221 | # '\n' # '\r' symbol_restore EOL found! return loc_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | | | > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 | # '\n' # '\r' symbol_restore EOL found! return loc_push call choice_259 value_clear symbol_save EOL error_nonterminal EOL loc_pop_discard return choice_259: # / # '\n' # '\r' error_clear loc_push error_push input_next "t <LF>" ok! test_char "<LF>" error_pop_merge ok! jump oknoast_258 loc_pop_rewind loc_push error_push input_next "t <CR>" ok! test_char "<CR>" error_pop_merge ok! jump oknoast_258 loc_pop_rewind status_fail return oknoast_258: loc_pop_discard return # # value Symbol 'Expression' # sym_Expression: # x # (Sequence) # * # x # (SLASH) # (Sequence) symbol_restore Expression found! jump found_275 loc_push ast_push call sequence_272 fail! value_clear ok! value_reduce Expression symbol_save Expression error_nonterminal Expression ast_pop_rewind loc_pop_discard found_275: ok! ast_value_push return sequence_272: # x # (Sequence) # * # x # (SLASH) # (Sequence) ast_push loc_push error_clear error_push call sym_Sequence error_pop_merge fail! jump failed_273 error_push call kleene_269 error_pop_merge fail! jump failed_273 ast_pop_discard loc_pop_discard return failed_273: ast_pop_rewind loc_pop_rewind return kleene_269: # * # x # (SLASH) # (Sequence) loc_push error_push call sequence_265 error_pop_merge fail! jump failed_270 loc_pop_discard jump kleene_269 failed_270: loc_pop_rewind status_ok return sequence_265: # x # (SLASH) # (Sequence) loc_push error_clear error_push call sym_SLASH error_pop_merge fail! jump failednoast_267 ast_push error_push call sym_Sequence error_pop_merge fail! jump failed_266 ast_pop_discard loc_pop_discard return failed_266: ast_pop_rewind failednoast_267: loc_pop_rewind return # # void Symbol 'Final' # sym_Final: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) symbol_restore Final found! return loc_push call sequence_283 value_clear symbol_save Final error_nonterminal Final loc_pop_discard return sequence_283: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) loc_push error_clear error_push input_next "t E" ok! test_char "E" error_pop_merge fail! jump failed_284 error_push input_next "t N" ok! test_char "N" error_pop_merge fail! jump failed_284 error_push input_next "t D" ok! test_char "D" error_pop_merge fail! jump failed_284 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_284 error_push call sym_SEMICOLON error_pop_merge fail! jump failed_284 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_284 loc_pop_discard return failed_284: loc_pop_rewind return # # value Symbol 'Grammar' # sym_Grammar: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) symbol_restore Grammar found! jump found_299 loc_push ast_push call sequence_295 fail! value_clear ok! value_reduce Grammar symbol_save Grammar error_nonterminal Grammar ast_pop_rewind loc_pop_discard found_299: ok! ast_value_push return sequence_295: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) loc_push error_clear error_push call sym_WHITESPACE error_pop_merge fail! jump failednoast_297 ast_push error_push call sym_Header error_pop_merge fail! jump failed_296 error_push call kleene_290 error_pop_merge fail! jump failed_296 error_push call sym_Final error_pop_merge fail! jump failed_296 error_push call sym_EOF error_pop_merge fail! jump failed_296 ast_pop_discard loc_pop_discard return failed_296: ast_pop_rewind failednoast_297: loc_pop_rewind return kleene_290: # * # (Definition) loc_push error_push call sym_Definition error_pop_merge fail! jump failed_291 loc_pop_discard jump kleene_290 failed_291: loc_pop_rewind status_ok return # # leaf Symbol 'GRAPH' # sym_GRAPH: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) symbol_restore GRAPH found! jump found_312 loc_push call sequence_309 fail! value_clear ok! value_leaf GRAPH symbol_save GRAPH error_nonterminal GRAPH loc_pop_discard found_312: ok! ast_value_push return sequence_309: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_310 error_push input_next "t g" ok! test_char "g" error_pop_merge fail! jump failed_310 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_310 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_310 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_310 error_push input_next "t h" ok! test_char "h" error_pop_merge fail! jump failed_310 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_310 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_310 loc_pop_discard return failed_310: loc_pop_rewind return # # value Symbol 'Header' # sym_Header: # x # (PEG) # (Identifier) # (StartExpr) symbol_restore Header found! jump found_321 loc_push ast_push call sequence_317 fail! value_clear ok! value_reduce Header symbol_save Header error_nonterminal Header ast_pop_rewind loc_pop_discard found_321: ok! ast_value_push return sequence_317: # x # (PEG) # (Identifier) # (StartExpr) loc_push error_clear error_push call sym_PEG error_pop_merge fail! jump failednoast_319 ast_push error_push call sym_Identifier error_pop_merge fail! jump failed_318 error_push call sym_StartExpr error_pop_merge fail! jump failed_318 ast_pop_discard loc_pop_discard return failed_318: ast_pop_rewind failednoast_319: loc_pop_rewind return # # leaf Symbol 'Ident' # sym_Ident: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> symbol_restore Ident found! jump found_341 loc_push call sequence_338 fail! value_clear ok! value_leaf Ident symbol_save Ident error_nonterminal Ident loc_pop_discard found_341: ok! ast_value_push return sequence_338: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> loc_push error_clear error_push call choice_327 error_pop_merge fail! jump failed_339 error_push call kleene_335 error_pop_merge fail! jump failed_339 loc_pop_discard return failed_339: loc_pop_rewind return choice_327: # / # '_' # ':' # <alpha> error_clear loc_push error_push input_next "t _" ok! test_char "_" error_pop_merge ok! jump oknoast_326 loc_pop_rewind loc_push error_push input_next "t :" ok! test_char ":" error_pop_merge ok! jump oknoast_326 loc_pop_rewind loc_push error_push input_next "alpha" ok! test_alpha error_pop_merge ok! jump oknoast_326 loc_pop_rewind status_fail return oknoast_326: loc_pop_discard return kleene_335: # * # / # '_' # ':' # <alnum> loc_push error_push call choice_333 error_pop_merge fail! jump failed_336 loc_pop_discard jump kleene_335 failed_336: loc_pop_rewind status_ok return choice_333: # / # '_' # ':' # <alnum> error_clear loc_push error_push input_next "t _" ok! test_char "_" error_pop_merge ok! jump oknoast_332 loc_pop_rewind loc_push error_push input_next "t :" ok! test_char ":" error_pop_merge ok! jump oknoast_332 loc_pop_rewind loc_push error_push input_next "alnum" ok! test_alnum error_pop_merge ok! jump oknoast_332 loc_pop_rewind status_fail return oknoast_332: loc_pop_discard return # # value Symbol 'Identifier' # sym_Identifier: # x # (Ident) # (WHITESPACE) symbol_restore Identifier found! jump found_348 loc_push ast_push call sequence_345 fail! value_clear ok! value_reduce Identifier symbol_save Identifier error_nonterminal Identifier ast_pop_rewind loc_pop_discard found_348: ok! ast_value_push return sequence_345: # x # (Ident) # (WHITESPACE) ast_push loc_push error_clear error_push call sym_Ident error_pop_merge fail! jump failed_346 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_346 ast_pop_discard loc_pop_discard return failed_346: ast_pop_rewind loc_pop_rewind return # # void Symbol 'IS' # sym_IS: # x # '<' # '-' # (WHITESPACE) symbol_restore IS found! return loc_push call sequence_353 value_clear symbol_save IS error_nonterminal IS loc_pop_discard return sequence_353: # x # '<' # '-' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_354 error_push input_next "t -" ok! test_char "-" error_pop_merge fail! jump failed_354 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_354 loc_pop_discard return failed_354: loc_pop_rewind return # # leaf Symbol 'LEAF' # sym_LEAF: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) symbol_restore LEAF found! jump found_365 loc_push call sequence_362 fail! value_clear ok! value_leaf LEAF symbol_save LEAF error_nonterminal LEAF loc_pop_discard found_365: ok! ast_value_push return sequence_362: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) loc_push error_clear error_push input_next "t l" ok! test_char "l" error_pop_merge fail! jump failed_363 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_363 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_363 error_push input_next "t f" ok! test_char "f" error_pop_merge fail! jump failed_363 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_363 loc_pop_discard return failed_363: loc_pop_rewind return # # value Symbol 'Literal' # sym_Literal: |
︙ | ︙ | |||
3106 3107 3108 3109 3110 3111 3112 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal | | | | | | 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal found! jump found_406 loc_push ast_push call choice_404 fail! value_clear ok! value_reduce Literal symbol_save Literal error_nonterminal Literal ast_pop_rewind loc_pop_discard found_406: ok! ast_value_push return choice_404: # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
3150 3151 3152 3153 3154 3155 3156 | error_clear ast_push loc_push error_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 | error_clear ast_push loc_push error_push call sequence_381 error_pop_merge ok! jump ok_403 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_399 error_pop_merge ok! jump ok_403 ast_pop_rewind loc_pop_rewind status_fail return ok_403: ast_pop_discard loc_pop_discard return sequence_381: # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_APOSTROPH error_pop_merge fail! jump failednoast_383 ast_push error_push call kleene_376 error_pop_merge fail! jump failed_382 error_push call sym_APOSTROPH error_pop_merge fail! jump failed_382 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_382 ast_pop_discard loc_pop_discard return failed_382: ast_pop_rewind failednoast_383: loc_pop_rewind return kleene_376: # * # x # ! # (APOSTROPH) # (Char) loc_push error_push call sequence_372 error_pop_merge fail! jump failed_377 loc_pop_discard jump kleene_376 failed_377: loc_pop_rewind status_ok return sequence_372: # x # ! # (APOSTROPH) # (Char) loc_push error_clear error_push call notahead_369 error_pop_merge fail! jump failednoast_374 ast_push error_push call sym_Char error_pop_merge fail! jump failed_373 ast_pop_discard loc_pop_discard return failed_373: ast_pop_rewind failednoast_374: loc_pop_rewind return notahead_369: # ! # (APOSTROPH) loc_push call sym_APOSTROPH loc_pop_rewind status_negate return sequence_399: # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_DAPOSTROPH error_pop_merge fail! jump failednoast_401 ast_push error_push call kleene_394 error_pop_merge fail! jump failed_400 error_push call sym_DAPOSTROPH error_pop_merge fail! jump failed_400 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_400 ast_pop_discard loc_pop_discard return failed_400: ast_pop_rewind failednoast_401: loc_pop_rewind return kleene_394: # * # x # ! # (DAPOSTROPH) # (Char) loc_push error_push call sequence_390 error_pop_merge fail! jump failed_395 loc_pop_discard jump kleene_394 failed_395: loc_pop_rewind status_ok return sequence_390: # x # ! # (DAPOSTROPH) # (Char) loc_push error_clear error_push call notahead_387 error_pop_merge fail! jump failednoast_392 ast_push error_push call sym_Char error_pop_merge fail! jump failed_391 ast_pop_discard loc_pop_discard return failed_391: ast_pop_rewind failednoast_392: loc_pop_rewind return notahead_387: # ! # (DAPOSTROPH) loc_push call sym_DAPOSTROPH |
︙ | ︙ | |||
3429 3430 3431 3432 3433 3434 3435 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER | | | | | | | | | | | | | | | | | | | | | | | | | | | 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER found! jump found_419 loc_push call sequence_416 fail! value_clear ok! value_leaf LOWER symbol_save LOWER error_nonterminal LOWER loc_pop_discard found_419: ok! ast_value_push return sequence_416: # x # '<' # 'l' # 'o' # 'w' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_417 error_push input_next "t l" ok! test_char "l" error_pop_merge fail! jump failed_417 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_417 error_push input_next "t w" ok! test_char "w" error_pop_merge fail! jump failed_417 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_417 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_417 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_417 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_417 loc_pop_discard return failed_417: loc_pop_rewind return # # leaf Symbol 'NOT' # sym_NOT: # x # '!' # (WHITESPACE) symbol_restore NOT found! jump found_426 loc_push call sequence_423 fail! value_clear ok! value_leaf NOT symbol_save NOT error_nonterminal NOT loc_pop_discard found_426: ok! ast_value_push return sequence_423: # x # '!' # (WHITESPACE) loc_push error_clear error_push input_next "t !" ok! test_char "!" error_pop_merge fail! jump failed_424 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_424 loc_pop_discard return failed_424: loc_pop_rewind return # # void Symbol 'OPEN' # sym_OPEN: # x # '\(' # (WHITESPACE) symbol_restore OPEN found! return loc_push call sequence_430 value_clear symbol_save OPEN error_nonterminal OPEN loc_pop_discard return sequence_430: # x # '\(' # (WHITESPACE) loc_push error_clear error_push input_next "t (" ok! test_char "(" error_pop_merge fail! jump failed_431 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_431 loc_pop_discard return failed_431: loc_pop_rewind return # # void Symbol 'OPENB' # sym_OPENB: |
︙ | ︙ | |||
3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 | # sym_PEG: # x # 'P' # 'E' # 'G' # (WHITESPACE) symbol_restore PEG found! return loc_push | > > > > > | | > > > > > | | | > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 | # sym_PEG: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) symbol_restore PEG found! return loc_push call sequence_448 value_clear symbol_save PEG error_nonterminal PEG loc_pop_discard return sequence_448: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) loc_push error_clear error_push input_next "t P" ok! test_char "P" error_pop_merge fail! jump failed_449 error_push input_next "t E" ok! test_char "E" error_pop_merge fail! jump failed_449 error_push input_next "t G" ok! test_char "G" error_pop_merge fail! jump failed_449 error_push call notahead_445 error_pop_merge fail! jump failed_449 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_449 loc_pop_discard return failed_449: loc_pop_rewind return notahead_445: # ! # / # '_' # ':' # <alnum> loc_push call choice_443 loc_pop_rewind status_negate return choice_443: # / # '_' # ':' # <alnum> error_clear loc_push error_push input_next "t _" ok! test_char "_" error_pop_merge ok! jump oknoast_442 loc_pop_rewind loc_push error_push input_next "t :" ok! test_char ":" error_pop_merge ok! jump oknoast_442 loc_pop_rewind loc_push error_push input_next "alnum" ok! test_alnum error_pop_merge ok! jump oknoast_442 loc_pop_rewind status_fail return oknoast_442: loc_pop_discard return # # leaf Symbol 'PLUS' # sym_PLUS: # x # '+' # (WHITESPACE) symbol_restore PLUS found! jump found_457 loc_push call sequence_454 fail! value_clear ok! value_leaf PLUS symbol_save PLUS error_nonterminal PLUS loc_pop_discard found_457: ok! ast_value_push return sequence_454: # x # '+' # (WHITESPACE) loc_push error_clear error_push input_next "t +" ok! test_char "+" error_pop_merge fail! jump failed_455 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_455 loc_pop_discard return failed_455: loc_pop_rewind return # # value Symbol 'Prefix' # sym_Prefix: # x # ? # / # (AND) # (NOT) # (Suffix) symbol_restore Prefix found! jump found_470 loc_push ast_push call sequence_467 fail! value_clear ok! value_reduce Prefix symbol_save Prefix error_nonterminal Prefix ast_pop_rewind loc_pop_discard found_470: ok! ast_value_push return sequence_467: # x # ? # / # (AND) # (NOT) # (Suffix) ast_push loc_push error_clear error_push call optional_464 error_pop_merge fail! jump failed_468 error_push call sym_Suffix error_pop_merge fail! jump failed_468 ast_pop_discard loc_pop_discard return failed_468: ast_pop_rewind loc_pop_rewind return optional_464: # ? # / # (AND) # (NOT) loc_push error_push call choice_462 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_462: # / # (AND) # (NOT) error_clear ast_push loc_push error_push call sym_AND error_pop_merge ok! jump ok_461 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_NOT error_pop_merge ok! jump ok_461 ast_pop_rewind loc_pop_rewind status_fail return ok_461: ast_pop_discard loc_pop_discard return # # value Symbol 'Primary' # |
︙ | ︙ | |||
3908 3909 3910 3911 3912 3913 3914 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary | | | | | | 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary found! jump found_500 loc_push ast_push call choice_498 fail! value_clear ok! value_reduce Primary symbol_save Primary error_nonterminal Primary ast_pop_rewind loc_pop_discard found_500: ok! ast_value_push return choice_498: # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
3959 3960 3961 3962 3963 3964 3965 | ast_push loc_push error_push call sym_ALNUM error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 | ast_push loc_push error_push call sym_ALNUM error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ALPHA error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ASCII error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_CONTROL error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DDIGIT error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DIGIT error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_GRAPH error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_LOWER error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PRINTABLE error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PUNCT error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_SPACE error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_UPPER error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_WORDCHAR error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_XDIGIT error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Identifier error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_490 error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Literal error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Class error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DOT error_pop_merge ok! jump ok_497 ast_pop_rewind loc_pop_rewind status_fail return ok_497: ast_pop_discard loc_pop_discard return sequence_490: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_492 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_491 error_push call sym_CLOSE error_pop_merge fail! jump failed_491 ast_pop_discard loc_pop_discard return failed_491: ast_pop_rewind failednoast_492: loc_pop_rewind return # # leaf Symbol 'PRINTABLE' # sym_PRINTABLE: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) symbol_restore PRINTABLE found! jump found_513 loc_push call sequence_510 fail! value_clear ok! value_leaf PRINTABLE symbol_save PRINTABLE error_nonterminal PRINTABLE loc_pop_discard found_513: ok! ast_value_push return sequence_510: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_511 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_511 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_511 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_511 error_push input_next "t n" ok! test_char "n" error_pop_merge fail! jump failed_511 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_511 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_511 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_511 loc_pop_discard return failed_511: loc_pop_rewind return # # leaf Symbol 'PUNCT' # sym_PUNCT: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) symbol_restore PUNCT found! jump found_526 loc_push call sequence_523 fail! value_clear ok! value_leaf PUNCT symbol_save PUNCT error_nonterminal PUNCT loc_pop_discard found_526: ok! ast_value_push return sequence_523: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_524 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_524 error_push input_next "t u" ok! test_char "u" error_pop_merge fail! jump failed_524 error_push input_next "t n" ok! test_char "n" error_pop_merge fail! jump failed_524 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_524 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_524 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_524 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_524 loc_pop_discard return failed_524: loc_pop_rewind return # # leaf Symbol 'QUESTION' # sym_QUESTION: # x # '?' # (WHITESPACE) symbol_restore QUESTION found! jump found_533 loc_push call sequence_530 fail! value_clear ok! value_leaf QUESTION symbol_save QUESTION error_nonterminal QUESTION loc_pop_discard found_533: ok! ast_value_push return sequence_530: # x # '?' # (WHITESPACE) loc_push error_clear error_push input_next "t ?" ok! test_char "?" error_pop_merge fail! jump failed_531 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_531 loc_pop_discard return failed_531: loc_pop_rewind return # # value Symbol 'Range' # sym_Range: # / # x # (Char) # (TO) # (Char) # (Char) symbol_restore Range found! jump found_545 loc_push ast_push call choice_543 fail! value_clear ok! value_reduce Range symbol_save Range error_nonterminal Range ast_pop_rewind loc_pop_discard found_545: ok! ast_value_push return choice_543: # / # x # (Char) # (TO) # (Char) # (Char) error_clear ast_push loc_push error_push call sequence_538 error_pop_merge ok! jump ok_542 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Char error_pop_merge ok! jump ok_542 ast_pop_rewind loc_pop_rewind status_fail return ok_542: ast_pop_discard loc_pop_discard return sequence_538: # x # (Char) # (TO) # (Char) ast_push loc_push error_clear error_push call sym_Char error_pop_merge fail! jump failed_539 error_push call sym_TO error_pop_merge fail! jump failed_539 error_push call sym_Char error_pop_merge fail! jump failed_539 ast_pop_discard loc_pop_discard return failed_539: ast_pop_rewind loc_pop_rewind return # # void Symbol 'SEMICOLON' # sym_SEMICOLON: # x # ';' # (WHITESPACE) symbol_restore SEMICOLON found! return loc_push call sequence_549 value_clear symbol_save SEMICOLON error_nonterminal SEMICOLON loc_pop_discard return sequence_549: # x # ';' # (WHITESPACE) loc_push error_clear error_push input_next "t ;" ok! test_char ";" error_pop_merge fail! jump failed_550 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_550 loc_pop_discard return failed_550: loc_pop_rewind return # # value Symbol 'Sequence' # sym_Sequence: # + # (Prefix) symbol_restore Sequence found! jump found_558 loc_push ast_push call poskleene_554 fail! value_clear ok! value_reduce Sequence symbol_save Sequence error_nonterminal Sequence ast_pop_rewind loc_pop_discard found_558: ok! ast_value_push return poskleene_554: # + # (Prefix) loc_push call sym_Prefix fail! jump failed_555 loop_556: loc_pop_discard loc_push error_push call sym_Prefix error_pop_merge ok! jump loop_556 status_ok failed_555: loc_pop_rewind return # # void Symbol 'SLASH' # sym_SLASH: # x # '/' # (WHITESPACE) symbol_restore SLASH found! return loc_push call sequence_562 value_clear symbol_save SLASH error_nonterminal SLASH loc_pop_discard return sequence_562: # x # '/' # (WHITESPACE) loc_push error_clear error_push input_next "t /" ok! test_char "/" error_pop_merge fail! jump failed_563 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_563 loc_pop_discard return failed_563: loc_pop_rewind return # # leaf Symbol 'SPACE' # sym_SPACE: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE found! jump found_577 loc_push call sequence_574 fail! value_clear ok! value_leaf SPACE symbol_save SPACE error_nonterminal SPACE loc_pop_discard found_577: ok! ast_value_push return sequence_574: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_575 error_push input_next "t s" ok! test_char "s" error_pop_merge fail! jump failed_575 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_575 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_575 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_575 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_575 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_575 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_575 loc_pop_discard return failed_575: loc_pop_rewind return # # leaf Symbol 'STAR' # sym_STAR: # x # '*' # (WHITESPACE) symbol_restore STAR found! jump found_584 loc_push call sequence_581 fail! value_clear ok! value_leaf STAR symbol_save STAR error_nonterminal STAR loc_pop_discard found_584: ok! ast_value_push return sequence_581: # x # '*' # (WHITESPACE) loc_push error_clear error_push input_next "t *" ok! test_char "*" error_pop_merge fail! jump failed_582 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_582 loc_pop_discard return failed_582: loc_pop_rewind return # # value Symbol 'StartExpr' # sym_StartExpr: # x # (OPEN) # (Expression) # (CLOSE) symbol_restore StartExpr found! jump found_593 loc_push ast_push call sequence_589 fail! value_clear ok! value_reduce StartExpr symbol_save StartExpr error_nonterminal StartExpr ast_pop_rewind loc_pop_discard found_593: ok! ast_value_push return sequence_589: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_591 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_590 error_push call sym_CLOSE error_pop_merge fail! jump failed_590 ast_pop_discard loc_pop_discard return failed_590: ast_pop_rewind failednoast_591: loc_pop_rewind return # # value Symbol 'Suffix' # sym_Suffix: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) symbol_restore Suffix found! jump found_607 loc_push ast_push call sequence_604 fail! value_clear ok! value_reduce Suffix symbol_save Suffix error_nonterminal Suffix ast_pop_rewind loc_pop_discard found_607: ok! ast_value_push return sequence_604: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) ast_push loc_push error_clear error_push call sym_Primary error_pop_merge fail! jump failed_605 error_push call optional_602 error_pop_merge fail! jump failed_605 ast_pop_discard loc_pop_discard return failed_605: ast_pop_rewind loc_pop_rewind return optional_602: # ? # / # (QUESTION) # (STAR) # (PLUS) loc_push error_push call choice_600 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_600: # / # (QUESTION) # (STAR) # (PLUS) error_clear ast_push loc_push error_push call sym_QUESTION error_pop_merge ok! jump ok_599 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_STAR error_pop_merge ok! jump ok_599 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PLUS error_pop_merge ok! jump ok_599 ast_pop_rewind loc_pop_rewind status_fail return ok_599: ast_pop_discard loc_pop_discard return # # void Symbol 'TO' # |
︙ | ︙ | |||
5124 5125 5126 5127 5128 5129 5130 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER found! jump found_622 loc_push call sequence_619 fail! value_clear ok! value_leaf UPPER symbol_save UPPER error_nonterminal UPPER loc_pop_discard found_622: ok! ast_value_push return sequence_619: # x # '<' # 'u' # 'p' # 'p' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_620 error_push input_next "t u" ok! test_char "u" error_pop_merge fail! jump failed_620 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_620 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_620 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_620 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_620 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_620 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_620 loc_pop_discard return failed_620: loc_pop_rewind return # # leaf Symbol 'VOID' # sym_VOID: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) symbol_restore VOID found! jump found_632 loc_push call sequence_629 fail! value_clear ok! value_leaf VOID symbol_save VOID error_nonterminal VOID loc_pop_discard found_632: ok! ast_value_push return sequence_629: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) loc_push error_clear error_push input_next "t v" ok! test_char "v" error_pop_merge fail! jump failed_630 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_630 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_630 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_630 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_630 loc_pop_discard return failed_630: loc_pop_rewind return # # void Symbol 'WHITESPACE' # sym_WHITESPACE: # * # / # <space> # (COMMENT) symbol_restore WHITESPACE found! return loc_push call kleene_639 value_clear symbol_save WHITESPACE error_nonterminal WHITESPACE loc_pop_discard return kleene_639: # * # / # <space> # (COMMENT) loc_push error_push call choice_637 error_pop_merge fail! jump failed_640 loc_pop_discard jump kleene_639 failed_640: loc_pop_rewind status_ok return choice_637: # / # <space> # (COMMENT) error_clear loc_push error_push input_next "space" ok! test_space error_pop_merge ok! jump oknoast_636 loc_pop_rewind loc_push error_push call sym_COMMENT error_pop_merge ok! jump oknoast_636 loc_pop_rewind status_fail return oknoast_636: loc_pop_discard return # # leaf Symbol 'WORDCHAR' # sym_WORDCHAR: |
︙ | ︙ | |||
5389 5390 5391 5392 5393 5394 5395 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR | | | | | | 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR found! jump found_657 loc_push call sequence_654 fail! value_clear ok! value_leaf WORDCHAR symbol_save WORDCHAR error_nonterminal WORDCHAR loc_pop_discard found_657: ok! ast_value_push return sequence_654: # x # '<' # 'w' # 'o' # 'r' # 'd' # 'c' |
︙ | ︙ | |||
5427 5428 5429 5430 5431 5432 5433 | error_push input_next "t <" ok! test_char "<" error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 | error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_655 error_push input_next "t w" ok! test_char "w" error_pop_merge fail! jump failed_655 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_655 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_655 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_655 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_655 error_push input_next "t h" ok! test_char "h" error_pop_merge fail! jump failed_655 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_655 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_655 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_655 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_655 loc_pop_discard return failed_655: loc_pop_rewind return # # leaf Symbol 'XDIGIT' # sym_XDIGIT: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) symbol_restore XDIGIT found! jump found_671 loc_push call sequence_668 fail! value_clear ok! value_leaf XDIGIT symbol_save XDIGIT error_nonterminal XDIGIT loc_pop_discard found_671: ok! ast_value_push return sequence_668: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_669 error_push input_next "t x" ok! test_char "x" error_pop_merge fail! jump failed_669 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_669 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_669 error_push input_next "t g" ok! test_char "g" error_pop_merge fail! jump failed_669 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_669 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_669 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_669 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_669 loc_pop_discard return failed_669: loc_pop_rewind return # # |
Changes to modules/pt/tests/data/ok/peg_param-unopt/3_peg_itself.
︙ | ︙ | |||
809 810 811 812 813 814 815 | failed_103: loc_pop_rewind return char_94: # '\' | | | | 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | failed_103: loc_pop_rewind return char_94: # '\' input_next "t \" ok! test_char "\" return range_96: # range (0 .. 2) input_next ".. 0 2" ok! test_range "0" "2" |
︙ | ︙ | |||
899 900 901 902 903 904 905 | failed_116: loc_pop_rewind return char_107: # '\' | | | | 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | failed_116: loc_pop_rewind return char_107: # '\' input_next "t \" ok! test_char "\" return range_109: # range (0 .. 7) input_next ".. 0 7" ok! test_range "0" "7" |
︙ | ︙ | |||
1003 1004 1005 1006 1007 1008 1009 | failed_142: loc_pop_rewind return char_120: # '\' | | | | 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 | failed_142: loc_pop_rewind return char_120: # '\' input_next "t \" ok! test_char "\" return choice_139: # / # 'n' # 'r' # 't' |
︙ | ︙ | |||
1130 1131 1132 1133 1134 1135 1136 | input_next "t '" ok! test_char "'" return char_130: # '\"' | | | | | | 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | input_next "t '" ok! test_char "'" return char_130: # '\"' input_next "t "" ok! test_char """ return char_132: # '[' input_next "t [" ok! test_char "[" return char_134: # ']' input_next "t ]" ok! test_char "]" return char_136: # '\' input_next "t \" ok! test_char "\" return # # leaf Symbol 'CharUnescaped' # sym_CharUnescaped: # x |
︙ | ︙ | |||
1224 1225 1226 1227 1228 1229 1230 | loc_pop_rewind status_negate return char_146: # '\' | | | | 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 | loc_pop_rewind status_negate return char_146: # '\' input_next "t \" ok! test_char "\" return # # leaf Symbol 'CharUnicode' # sym_CharUnicode: # x |
︙ | ︙ | |||
1313 1314 1315 1316 1317 1318 1319 | failed_181: loc_pop_rewind return char_156: # '\' | | | | 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 | failed_181: loc_pop_rewind return char_156: # '\' input_next "t \" ok! test_char "\" return char_158: # 'u' input_next "t u" ok! test_char "u" |
︙ | ︙ | |||
2087 2088 2089 2090 2091 2092 2093 | error_nonterminal DAPOSTROPH loc_pop_discard return char_263: # '\"' | | | | 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 | error_nonterminal DAPOSTROPH loc_pop_discard return char_263: # '\"' input_next "t "" ok! test_char """ return # # leaf Symbol 'DDIGIT' # sym_DDIGIT: # x |
︙ | ︙ | |||
2561 2562 2563 2564 2565 2566 2567 | char_320: # '.' input_next "t ." ok! test_char "." return # | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 | char_320: # '.' input_next "t ." ok! test_char "." return # # void Symbol 'EOF' # sym_EOF: # ! # <dot> symbol_restore EOF found! return loc_push call notahead_329 value_clear symbol_save EOF error_nonterminal EOF loc_pop_discard return notahead_329: # ! # <dot> loc_push input_next "dot" |
︙ | ︙ | |||
2689 2690 2691 2692 2693 2694 2695 | # '\n' # '\r' symbol_restore EOL found! return loc_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | | | > > > > > > > > > > > > > > > > > > > > > | | | | | > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 | # '\n' # '\r' symbol_restore EOL found! return loc_push call choice_337 value_clear symbol_save EOL error_nonterminal EOL loc_pop_discard return choice_337: # / # '\n' # '\r' error_clear loc_push error_push call char_332 error_pop_merge ok! jump oknoast_336 loc_pop_rewind loc_push error_push call char_334 error_pop_merge ok! jump oknoast_336 loc_pop_rewind status_fail return oknoast_336: loc_pop_discard return char_332: # '\n' input_next "t <LF>" ok! test_char "<LF>" return char_334: # '\r' input_next "t <CR>" ok! test_char "<CR>" return # # value Symbol 'Expression' # sym_Expression: # x # (Sequence) # * # x # (SLASH) # (Sequence) symbol_restore Expression found! jump found_353 loc_push ast_push call sequence_350 fail! value_clear ok! value_reduce Expression symbol_save Expression error_nonterminal Expression ast_pop_rewind loc_pop_discard found_353: ok! ast_value_push return sequence_350: # x # (Sequence) # * # x # (SLASH) # (Sequence) ast_push loc_push error_clear error_push call sym_Sequence error_pop_merge fail! jump failed_351 error_push call kleene_347 error_pop_merge fail! jump failed_351 ast_pop_discard loc_pop_discard return failed_351: ast_pop_rewind loc_pop_rewind return kleene_347: # * # x # (SLASH) # (Sequence) loc_push error_push call sequence_343 error_pop_merge fail! jump failed_348 loc_pop_discard jump kleene_347 failed_348: loc_pop_rewind status_ok return sequence_343: # x # (SLASH) # (Sequence) loc_push error_clear error_push call sym_SLASH error_pop_merge fail! jump failednoast_345 ast_push error_push call sym_Sequence error_pop_merge fail! jump failed_344 ast_pop_discard loc_pop_discard return failed_344: ast_pop_rewind failednoast_345: loc_pop_rewind return # # void Symbol 'Final' # sym_Final: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) symbol_restore Final found! return loc_push call sequence_364 value_clear symbol_save Final error_nonterminal Final loc_pop_discard return sequence_364: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) loc_push error_clear error_push call char_355 error_pop_merge fail! jump failed_365 error_push call char_357 error_pop_merge fail! jump failed_365 error_push call char_359 error_pop_merge fail! jump failed_365 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_365 error_push call sym_SEMICOLON error_pop_merge fail! jump failed_365 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_365 loc_pop_discard return failed_365: loc_pop_rewind return char_355: # 'E' input_next "t E" ok! test_char "E" return char_357: # 'N' input_next "t N" ok! test_char "N" return char_359: # 'D' input_next "t D" ok! test_char "D" return # # value Symbol 'Grammar' # sym_Grammar: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) symbol_restore Grammar found! jump found_380 loc_push ast_push call sequence_376 fail! value_clear ok! value_reduce Grammar symbol_save Grammar error_nonterminal Grammar ast_pop_rewind loc_pop_discard found_380: ok! ast_value_push return sequence_376: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) loc_push error_clear error_push call sym_WHITESPACE error_pop_merge fail! jump failednoast_378 ast_push error_push call sym_Header error_pop_merge fail! jump failed_377 error_push call kleene_371 error_pop_merge fail! jump failed_377 error_push call sym_Final error_pop_merge fail! jump failed_377 error_push call sym_EOF error_pop_merge fail! jump failed_377 ast_pop_discard loc_pop_discard return failed_377: ast_pop_rewind failednoast_378: loc_pop_rewind return kleene_371: # * # (Definition) loc_push error_push call sym_Definition error_pop_merge fail! jump failed_372 loc_pop_discard jump kleene_371 failed_372: loc_pop_rewind status_ok return # # leaf Symbol 'GRAPH' # sym_GRAPH: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) symbol_restore GRAPH found! jump found_400 loc_push call sequence_397 fail! value_clear ok! value_leaf GRAPH symbol_save GRAPH error_nonterminal GRAPH loc_pop_discard found_400: ok! ast_value_push return sequence_397: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) loc_push error_clear error_push call char_382 error_pop_merge fail! jump failed_398 error_push call char_384 error_pop_merge fail! jump failed_398 error_push call char_386 error_pop_merge fail! jump failed_398 error_push call char_388 error_pop_merge fail! jump failed_398 error_push call char_390 error_pop_merge fail! jump failed_398 error_push call char_392 error_pop_merge fail! jump failed_398 error_push call char_394 error_pop_merge fail! jump failed_398 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_398 loc_pop_discard return failed_398: loc_pop_rewind return char_382: # '<' input_next "t <" ok! test_char "<" return char_384: # 'g' input_next "t g" ok! test_char "g" return char_386: # 'r' input_next "t r" ok! test_char "r" return char_388: # 'a' input_next "t a" ok! test_char "a" return char_390: # 'p' input_next "t p" ok! test_char "p" return char_392: # 'h' input_next "t h" ok! test_char "h" return char_394: # '>' input_next "t >" ok! test_char ">" return # # value Symbol 'Header' # sym_Header: # x # (PEG) # (Identifier) # (StartExpr) symbol_restore Header found! jump found_409 loc_push ast_push call sequence_405 fail! value_clear ok! value_reduce Header symbol_save Header error_nonterminal Header ast_pop_rewind loc_pop_discard found_409: ok! ast_value_push return sequence_405: # x # (PEG) # (Identifier) # (StartExpr) loc_push error_clear error_push call sym_PEG error_pop_merge fail! jump failednoast_407 ast_push error_push call sym_Identifier error_pop_merge fail! jump failed_406 error_push call sym_StartExpr error_pop_merge fail! jump failed_406 ast_pop_discard loc_pop_discard return failed_406: ast_pop_rewind failednoast_407: loc_pop_rewind return # # leaf Symbol 'Ident' # sym_Ident: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> symbol_restore Ident found! jump found_435 loc_push call sequence_432 fail! value_clear ok! value_leaf Ident symbol_save Ident error_nonterminal Ident loc_pop_discard found_435: ok! ast_value_push return sequence_432: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> loc_push error_clear error_push call choice_418 error_pop_merge fail! jump failed_433 error_push call kleene_429 error_pop_merge fail! jump failed_433 loc_pop_discard return failed_433: loc_pop_rewind return choice_418: # / # '_' # ':' # <alpha> error_clear loc_push error_push call char_411 error_pop_merge ok! jump oknoast_417 loc_pop_rewind loc_push error_push call char_413 error_pop_merge ok! jump oknoast_417 loc_pop_rewind loc_push error_push call alpha_415 error_pop_merge ok! jump oknoast_417 loc_pop_rewind status_fail return oknoast_417: loc_pop_discard return char_411: # '_' input_next "t _" ok! test_char "_" return char_413: # ':' input_next "t :" ok! test_char ":" return alpha_415: # <alpha> input_next "alpha" ok! test_alpha return kleene_429: # * # / # '_' # ':' # <alnum> loc_push error_push call choice_427 error_pop_merge fail! jump failed_430 loc_pop_discard jump kleene_429 failed_430: loc_pop_rewind status_ok return choice_427: # / # '_' # ':' # <alnum> error_clear loc_push error_push call char_420 error_pop_merge ok! jump oknoast_426 loc_pop_rewind loc_push error_push call char_422 error_pop_merge ok! jump oknoast_426 loc_pop_rewind loc_push error_push call alnum_424 error_pop_merge ok! jump oknoast_426 loc_pop_rewind status_fail return oknoast_426: loc_pop_discard return char_420: # '_' input_next "t _" ok! test_char "_" return char_422: # ':' input_next "t :" ok! test_char ":" return alnum_424: # <alnum> input_next "alnum" ok! test_alnum return # # value Symbol 'Identifier' # sym_Identifier: # x # (Ident) # (WHITESPACE) symbol_restore Identifier found! jump found_442 loc_push ast_push call sequence_439 fail! value_clear ok! value_reduce Identifier symbol_save Identifier error_nonterminal Identifier ast_pop_rewind loc_pop_discard found_442: ok! ast_value_push return sequence_439: # x # (Ident) # (WHITESPACE) ast_push loc_push error_clear error_push call sym_Ident error_pop_merge fail! jump failed_440 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_440 ast_pop_discard loc_pop_discard return failed_440: ast_pop_rewind loc_pop_rewind return # # void Symbol 'IS' # sym_IS: # x # '<' # '-' # (WHITESPACE) symbol_restore IS found! return loc_push call sequence_449 value_clear symbol_save IS error_nonterminal IS loc_pop_discard return sequence_449: # x # '<' # '-' # (WHITESPACE) loc_push error_clear error_push call char_444 error_pop_merge fail! jump failed_450 error_push call char_446 error_pop_merge fail! jump failed_450 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_450 loc_pop_discard return failed_450: loc_pop_rewind return char_444: # '<' input_next "t <" ok! test_char "<" return char_446: # '-' input_next "t -" ok! test_char "-" return # # leaf Symbol 'LEAF' # sym_LEAF: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) symbol_restore LEAF found! jump found_465 loc_push call sequence_462 fail! value_clear ok! value_leaf LEAF symbol_save LEAF error_nonterminal LEAF loc_pop_discard found_465: ok! ast_value_push return sequence_462: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) loc_push error_clear error_push call char_453 error_pop_merge fail! jump failed_463 error_push call char_455 error_pop_merge fail! jump failed_463 error_push call char_457 error_pop_merge fail! jump failed_463 error_push call char_459 error_pop_merge fail! jump failed_463 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_463 loc_pop_discard return failed_463: loc_pop_rewind return char_453: # 'l' input_next "t l" ok! test_char "l" return char_455: # 'e' input_next "t e" ok! test_char "e" return char_457: # 'a' input_next "t a" ok! test_char "a" return char_459: # 'f' input_next "t f" ok! test_char "f" return # # value Symbol 'Literal' |
︙ | ︙ | |||
3706 3707 3708 3709 3710 3711 3712 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal | | | | | | 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal found! jump found_506 loc_push ast_push call choice_504 fail! value_clear ok! value_reduce Literal symbol_save Literal error_nonterminal Literal ast_pop_rewind loc_pop_discard found_506: ok! ast_value_push return choice_504: # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
3750 3751 3752 3753 3754 3755 3756 | error_clear ast_push loc_push error_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 | error_clear ast_push loc_push error_push call sequence_481 error_pop_merge ok! jump ok_503 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_499 error_pop_merge ok! jump ok_503 ast_pop_rewind loc_pop_rewind status_fail return ok_503: ast_pop_discard loc_pop_discard return sequence_481: # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_APOSTROPH error_pop_merge fail! jump failednoast_483 ast_push error_push call kleene_476 error_pop_merge fail! jump failed_482 error_push call sym_APOSTROPH error_pop_merge fail! jump failed_482 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_482 ast_pop_discard loc_pop_discard return failed_482: ast_pop_rewind failednoast_483: loc_pop_rewind return kleene_476: # * # x # ! # (APOSTROPH) # (Char) loc_push error_push call sequence_472 error_pop_merge fail! jump failed_477 loc_pop_discard jump kleene_476 failed_477: loc_pop_rewind status_ok return sequence_472: # x # ! # (APOSTROPH) # (Char) loc_push error_clear error_push call notahead_469 error_pop_merge fail! jump failednoast_474 ast_push error_push call sym_Char error_pop_merge fail! jump failed_473 ast_pop_discard loc_pop_discard return failed_473: ast_pop_rewind failednoast_474: loc_pop_rewind return notahead_469: # ! # (APOSTROPH) loc_push call sym_APOSTROPH loc_pop_rewind status_negate return sequence_499: # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_DAPOSTROPH error_pop_merge fail! jump failednoast_501 ast_push error_push call kleene_494 error_pop_merge fail! jump failed_500 error_push call sym_DAPOSTROPH error_pop_merge fail! jump failed_500 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_500 ast_pop_discard loc_pop_discard return failed_500: ast_pop_rewind failednoast_501: loc_pop_rewind return kleene_494: # * # x # ! # (DAPOSTROPH) # (Char) loc_push error_push call sequence_490 error_pop_merge fail! jump failed_495 loc_pop_discard jump kleene_494 failed_495: loc_pop_rewind status_ok return sequence_490: # x # ! # (DAPOSTROPH) # (Char) loc_push error_clear error_push call notahead_487 error_pop_merge fail! jump failednoast_492 ast_push error_push call sym_Char error_pop_merge fail! jump failed_491 ast_pop_discard loc_pop_discard return failed_491: ast_pop_rewind failednoast_492: loc_pop_rewind return notahead_487: # ! # (DAPOSTROPH) loc_push call sym_DAPOSTROPH |
︙ | ︙ | |||
4029 4030 4031 4032 4033 4034 4035 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > | | > > > > > | | > > > > > > | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER found! jump found_526 loc_push call sequence_523 fail! value_clear ok! value_leaf LOWER symbol_save LOWER error_nonterminal LOWER loc_pop_discard found_526: ok! ast_value_push return sequence_523: # x # '<' # 'l' # 'o' # 'w' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push call char_508 error_pop_merge fail! jump failed_524 error_push call char_510 error_pop_merge fail! jump failed_524 error_push call char_512 error_pop_merge fail! jump failed_524 error_push call char_514 error_pop_merge fail! jump failed_524 error_push call char_516 error_pop_merge fail! jump failed_524 error_push call char_518 error_pop_merge fail! jump failed_524 error_push call char_520 error_pop_merge fail! jump failed_524 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_524 loc_pop_discard return failed_524: loc_pop_rewind return char_508: # '<' input_next "t <" ok! test_char "<" return char_510: # 'l' input_next "t l" ok! test_char "l" return char_512: # 'o' input_next "t o" ok! test_char "o" return char_514: # 'w' input_next "t w" ok! test_char "w" return char_516: # 'e' input_next "t e" ok! test_char "e" return char_518: # 'r' input_next "t r" ok! test_char "r" return char_520: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'NOT' # sym_NOT: # x # '!' # (WHITESPACE) symbol_restore NOT found! jump found_534 loc_push call sequence_531 fail! value_clear ok! value_leaf NOT symbol_save NOT error_nonterminal NOT loc_pop_discard found_534: ok! ast_value_push return sequence_531: # x # '!' # (WHITESPACE) loc_push error_clear error_push call char_528 error_pop_merge fail! jump failed_532 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_532 loc_pop_discard return failed_532: loc_pop_rewind return char_528: # '!' input_next "t !" ok! test_char "!" return # # void Symbol 'OPEN' # sym_OPEN: # x # '\(' # (WHITESPACE) symbol_restore OPEN found! return loc_push call sequence_539 value_clear symbol_save OPEN error_nonterminal OPEN loc_pop_discard return sequence_539: # x # '\(' # (WHITESPACE) loc_push error_clear error_push call char_536 error_pop_merge fail! jump failed_540 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_540 loc_pop_discard return failed_540: loc_pop_rewind return char_536: # '\(' input_next "t (" ok! test_char "(" return # # void Symbol 'OPENB' # sym_OPENB: # '[' symbol_restore OPENB found! return loc_push call char_543 value_clear symbol_save OPENB error_nonterminal OPENB loc_pop_discard return char_543: # '[' input_next "t [" ok! test_char "[" return # # void Symbol 'PEG' # sym_PEG: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) symbol_restore PEG found! return loc_push call sequence_564 value_clear symbol_save PEG error_nonterminal PEG loc_pop_discard return sequence_564: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) loc_push error_clear error_push call char_546 error_pop_merge fail! jump failed_565 error_push call char_548 error_pop_merge fail! jump failed_565 error_push call char_550 error_pop_merge fail! jump failed_565 error_push call notahead_561 error_pop_merge fail! jump failed_565 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_565 loc_pop_discard return failed_565: loc_pop_rewind return char_546: # 'P' input_next "t P" ok! test_char "P" return char_548: # 'E' input_next "t E" ok! test_char "E" return char_550: # 'G' input_next "t G" ok! test_char "G" return notahead_561: # ! # / # '_' # ':' # <alnum> loc_push call choice_559 loc_pop_rewind status_negate return choice_559: # / # '_' # ':' # <alnum> error_clear loc_push error_push call char_552 error_pop_merge ok! jump oknoast_558 loc_pop_rewind loc_push error_push call char_554 error_pop_merge ok! jump oknoast_558 loc_pop_rewind loc_push error_push call alnum_556 error_pop_merge ok! jump oknoast_558 loc_pop_rewind status_fail return oknoast_558: loc_pop_discard return char_552: # '_' input_next "t _" ok! test_char "_" return char_554: # ':' input_next "t :" ok! test_char ":" return alnum_556: # <alnum> input_next "alnum" ok! test_alnum return # # leaf Symbol 'PLUS' # sym_PLUS: # x # '+' # (WHITESPACE) symbol_restore PLUS found! jump found_574 loc_push call sequence_571 fail! value_clear ok! value_leaf PLUS symbol_save PLUS error_nonterminal PLUS loc_pop_discard found_574: ok! ast_value_push return sequence_571: # x # '+' # (WHITESPACE) loc_push error_clear error_push call char_568 error_pop_merge fail! jump failed_572 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_572 loc_pop_discard return failed_572: loc_pop_rewind return char_568: # '+' input_next "t +" ok! test_char "+" return # # value Symbol 'Prefix' # sym_Prefix: # x # ? # / # (AND) # (NOT) # (Suffix) symbol_restore Prefix found! jump found_587 loc_push ast_push call sequence_584 fail! value_clear ok! value_reduce Prefix symbol_save Prefix error_nonterminal Prefix ast_pop_rewind loc_pop_discard found_587: ok! ast_value_push return sequence_584: # x # ? # / # (AND) # (NOT) # (Suffix) ast_push loc_push error_clear error_push call optional_581 error_pop_merge fail! jump failed_585 error_push call sym_Suffix error_pop_merge fail! jump failed_585 ast_pop_discard loc_pop_discard return failed_585: ast_pop_rewind loc_pop_rewind return optional_581: # ? # / # (AND) # (NOT) loc_push error_push call choice_579 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_579: # / # (AND) # (NOT) error_clear ast_push loc_push error_push call sym_AND error_pop_merge ok! jump ok_578 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_NOT error_pop_merge ok! jump ok_578 ast_pop_rewind loc_pop_rewind status_fail return ok_578: ast_pop_discard loc_pop_discard return # # value Symbol 'Primary' # |
︙ | ︙ | |||
4592 4593 4594 4595 4596 4597 4598 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary | | | | | | 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary found! jump found_617 loc_push ast_push call choice_615 fail! value_clear ok! value_reduce Primary symbol_save Primary error_nonterminal Primary ast_pop_rewind loc_pop_discard found_617: ok! ast_value_push return choice_615: # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
4643 4644 4645 4646 4647 4648 4649 | ast_push loc_push error_push call sym_ALNUM error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < < < < < < < | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 | ast_push loc_push error_push call sym_ALNUM error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ALPHA error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ASCII error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_CONTROL error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DDIGIT error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DIGIT error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_GRAPH error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_LOWER error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PRINTABLE error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PUNCT error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_SPACE error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_UPPER error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_WORDCHAR error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_XDIGIT error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Identifier error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_607 error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Literal error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Class error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DOT error_pop_merge ok! jump ok_614 ast_pop_rewind loc_pop_rewind status_fail return ok_614: ast_pop_discard loc_pop_discard return sequence_607: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_609 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_608 error_push call sym_CLOSE error_pop_merge fail! jump failed_608 ast_pop_discard loc_pop_discard return failed_608: ast_pop_rewind failednoast_609: loc_pop_rewind return # # leaf Symbol 'PRINTABLE' # sym_PRINTABLE: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) symbol_restore PRINTABLE found! jump found_637 loc_push call sequence_634 fail! value_clear ok! value_leaf PRINTABLE symbol_save PRINTABLE error_nonterminal PRINTABLE loc_pop_discard found_637: ok! ast_value_push return sequence_634: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_619 error_pop_merge fail! jump failed_635 error_push call char_621 error_pop_merge fail! jump failed_635 error_push call char_623 error_pop_merge fail! jump failed_635 error_push call char_625 error_pop_merge fail! jump failed_635 error_push call char_627 error_pop_merge fail! jump failed_635 error_push call char_629 error_pop_merge fail! jump failed_635 error_push call char_631 error_pop_merge fail! jump failed_635 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_635 loc_pop_discard return failed_635: loc_pop_rewind return char_619: # '<' input_next "t <" ok! test_char "<" return char_621: # 'p' input_next "t p" ok! test_char "p" return char_623: # 'r' input_next "t r" ok! test_char "r" return char_625: # 'i' input_next "t i" ok! test_char "i" return char_627: # 'n' input_next "t n" ok! test_char "n" return char_629: # 't' input_next "t t" ok! test_char "t" return char_631: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'PUNCT' |
︙ | ︙ | |||
5057 5058 5059 5060 5061 5062 5063 | # 'n' # 'c' # 't' # '>' # (WHITESPACE) symbol_restore PUNCT | | | | | < < < < < < < < < < < < < < < < < < | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 | # 'n' # 'c' # 't' # '>' # (WHITESPACE) symbol_restore PUNCT found! jump found_657 loc_push call sequence_654 fail! value_clear ok! value_leaf PUNCT symbol_save PUNCT error_nonterminal PUNCT loc_pop_discard found_657: ok! ast_value_push return sequence_654: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_639 error_pop_merge fail! jump failed_655 error_push call char_641 error_pop_merge fail! jump failed_655 error_push call char_643 error_pop_merge fail! jump failed_655 error_push call char_645 error_pop_merge fail! jump failed_655 error_push call char_647 error_pop_merge fail! jump failed_655 error_push call char_649 error_pop_merge fail! jump failed_655 error_push call char_651 error_pop_merge fail! jump failed_655 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_655 loc_pop_discard return failed_655: loc_pop_rewind return char_639: # '<' input_next "t <" ok! test_char "<" return char_641: # 'p' input_next "t p" ok! test_char "p" return char_643: # 'u' input_next "t u" ok! test_char "u" return char_645: # 'n' input_next "t n" ok! test_char "n" return char_647: # 'c' input_next "t c" ok! test_char "c" return char_649: # 't' input_next "t t" ok! test_char "t" return char_651: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'QUESTION' # sym_QUESTION: # x # '?' # (WHITESPACE) symbol_restore QUESTION found! jump found_665 loc_push call sequence_662 fail! value_clear ok! value_leaf QUESTION symbol_save QUESTION error_nonterminal QUESTION loc_pop_discard found_665: ok! ast_value_push return sequence_662: # x # '?' # (WHITESPACE) loc_push error_clear error_push call char_659 error_pop_merge fail! jump failed_663 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_663 loc_pop_discard return failed_663: loc_pop_rewind return char_659: # '?' input_next "t ?" ok! test_char "?" return # # value Symbol 'Range' # sym_Range: # / # x # (Char) # (TO) # (Char) # (Char) symbol_restore Range found! jump found_677 loc_push ast_push call choice_675 fail! value_clear ok! value_reduce Range symbol_save Range error_nonterminal Range ast_pop_rewind loc_pop_discard found_677: ok! ast_value_push return choice_675: # / # x # (Char) # (TO) # (Char) # (Char) error_clear ast_push loc_push error_push call sequence_670 error_pop_merge ok! jump ok_674 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Char error_pop_merge ok! jump ok_674 ast_pop_rewind loc_pop_rewind status_fail return ok_674: ast_pop_discard loc_pop_discard return sequence_670: # x # (Char) # (TO) # (Char) ast_push loc_push error_clear error_push call sym_Char error_pop_merge fail! jump failed_671 error_push call sym_TO error_pop_merge fail! jump failed_671 error_push call sym_Char error_pop_merge fail! jump failed_671 ast_pop_discard loc_pop_discard return failed_671: ast_pop_rewind loc_pop_rewind return # # void Symbol 'SEMICOLON' # sym_SEMICOLON: # x # ';' # (WHITESPACE) symbol_restore SEMICOLON found! return loc_push call sequence_682 value_clear symbol_save SEMICOLON error_nonterminal SEMICOLON loc_pop_discard return sequence_682: # x # ';' # (WHITESPACE) loc_push error_clear error_push call char_679 error_pop_merge fail! jump failed_683 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_683 loc_pop_discard return failed_683: loc_pop_rewind return char_679: # ';' input_next "t ;" ok! test_char ";" return # # value Symbol 'Sequence' # sym_Sequence: # + # (Prefix) symbol_restore Sequence found! jump found_691 loc_push ast_push call poskleene_687 fail! value_clear ok! value_reduce Sequence symbol_save Sequence error_nonterminal Sequence ast_pop_rewind loc_pop_discard found_691: ok! ast_value_push return poskleene_687: # + # (Prefix) loc_push call sym_Prefix fail! jump failed_688 loop_689: loc_pop_discard loc_push error_push call sym_Prefix error_pop_merge ok! jump loop_689 status_ok failed_688: loc_pop_rewind return # # void Symbol 'SLASH' # sym_SLASH: # x # '/' # (WHITESPACE) symbol_restore SLASH found! return loc_push call sequence_696 value_clear symbol_save SLASH error_nonterminal SLASH loc_pop_discard return sequence_696: # x # '/' # (WHITESPACE) loc_push error_clear error_push call char_693 error_pop_merge fail! jump failed_697 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_697 loc_pop_discard return failed_697: loc_pop_rewind return char_693: # '/' input_next "t /" ok! test_char "/" return # # leaf Symbol 'SPACE' |
︙ | ︙ | |||
5532 5533 5534 5535 5536 5537 5538 | # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE | | | | | < < < < < < < < < < < < < < < < < < | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 | # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE found! jump found_718 loc_push call sequence_715 fail! value_clear ok! value_leaf SPACE symbol_save SPACE error_nonterminal SPACE loc_pop_discard found_718: ok! ast_value_push return sequence_715: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) loc_push error_clear error_push call char_700 error_pop_merge fail! jump failed_716 error_push call char_702 error_pop_merge fail! jump failed_716 error_push call char_704 error_pop_merge fail! jump failed_716 error_push call char_706 error_pop_merge fail! jump failed_716 error_push call char_708 error_pop_merge fail! jump failed_716 error_push call char_710 error_pop_merge fail! jump failed_716 error_push call char_712 error_pop_merge fail! jump failed_716 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_716 loc_pop_discard return failed_716: loc_pop_rewind return char_700: # '<' input_next "t <" ok! test_char "<" return char_702: # 's' input_next "t s" ok! test_char "s" return char_704: # 'p' input_next "t p" ok! test_char "p" return char_706: # 'a' input_next "t a" ok! test_char "a" return char_708: # 'c' input_next "t c" ok! test_char "c" return char_710: # 'e' input_next "t e" ok! test_char "e" return char_712: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'STAR' # sym_STAR: # x # '*' # (WHITESPACE) symbol_restore STAR found! jump found_726 loc_push call sequence_723 fail! value_clear ok! value_leaf STAR symbol_save STAR error_nonterminal STAR loc_pop_discard found_726: ok! ast_value_push return sequence_723: # x # '*' # (WHITESPACE) loc_push error_clear error_push call char_720 error_pop_merge fail! jump failed_724 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_724 loc_pop_discard return failed_724: loc_pop_rewind return char_720: # '*' input_next "t *" ok! test_char "*" return # # value Symbol 'StartExpr' # sym_StartExpr: # x # (OPEN) # (Expression) # (CLOSE) symbol_restore StartExpr found! jump found_735 loc_push ast_push call sequence_731 fail! value_clear ok! value_reduce StartExpr symbol_save StartExpr error_nonterminal StartExpr ast_pop_rewind loc_pop_discard found_735: ok! ast_value_push return sequence_731: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_733 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_732 error_push call sym_CLOSE error_pop_merge fail! jump failed_732 ast_pop_discard loc_pop_discard return failed_732: ast_pop_rewind failednoast_733: loc_pop_rewind return # # value Symbol 'Suffix' # sym_Suffix: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) symbol_restore Suffix found! jump found_749 loc_push ast_push call sequence_746 fail! value_clear ok! value_reduce Suffix symbol_save Suffix error_nonterminal Suffix ast_pop_rewind loc_pop_discard found_749: ok! ast_value_push return sequence_746: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) ast_push loc_push error_clear error_push call sym_Primary error_pop_merge fail! jump failed_747 error_push call optional_744 error_pop_merge fail! jump failed_747 ast_pop_discard loc_pop_discard return failed_747: ast_pop_rewind loc_pop_rewind return optional_744: # ? # / # (QUESTION) # (STAR) # (PLUS) loc_push error_push call choice_742 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_742: # / # (QUESTION) # (STAR) # (PLUS) error_clear ast_push loc_push error_push call sym_QUESTION error_pop_merge ok! jump ok_741 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_STAR error_pop_merge ok! jump ok_741 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PLUS error_pop_merge ok! jump ok_741 ast_pop_rewind loc_pop_rewind status_fail return ok_741: ast_pop_discard loc_pop_discard return # # void Symbol 'TO' # sym_TO: # '-' symbol_restore TO found! return loc_push call char_751 value_clear symbol_save TO error_nonterminal TO loc_pop_discard return char_751: # '-' input_next "t -" ok! test_char "-" return # # leaf Symbol 'UPPER' |
︙ | ︙ | |||
5964 5965 5966 5967 5968 5969 5970 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER | | | | | < < < < < < < < < < < < < < < < < < | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER found! jump found_772 loc_push call sequence_769 fail! value_clear ok! value_leaf UPPER symbol_save UPPER error_nonterminal UPPER loc_pop_discard found_772: ok! ast_value_push return sequence_769: # x # '<' # 'u' # 'p' # 'p' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push call char_754 error_pop_merge fail! jump failed_770 error_push call char_756 error_pop_merge fail! jump failed_770 error_push call char_758 error_pop_merge fail! jump failed_770 error_push call char_760 error_pop_merge fail! jump failed_770 error_push call char_762 error_pop_merge fail! jump failed_770 error_push call char_764 error_pop_merge fail! jump failed_770 error_push call char_766 error_pop_merge fail! jump failed_770 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_770 loc_pop_discard return failed_770: loc_pop_rewind return char_754: # '<' input_next "t <" ok! test_char "<" return char_756: # 'u' input_next "t u" ok! test_char "u" return char_758: # 'p' input_next "t p" ok! test_char "p" return char_760: # 'p' input_next "t p" ok! test_char "p" return char_762: # 'e' input_next "t e" ok! test_char "e" return char_764: # 'r' input_next "t r" ok! test_char "r" return char_766: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'VOID' # sym_VOID: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) symbol_restore VOID found! jump found_786 loc_push call sequence_783 fail! value_clear ok! value_leaf VOID symbol_save VOID error_nonterminal VOID loc_pop_discard found_786: ok! ast_value_push return sequence_783: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) loc_push error_clear error_push call char_774 error_pop_merge fail! jump failed_784 error_push call char_776 error_pop_merge fail! jump failed_784 error_push call char_778 error_pop_merge fail! jump failed_784 error_push call char_780 error_pop_merge fail! jump failed_784 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_784 loc_pop_discard return failed_784: loc_pop_rewind return char_774: # 'v' input_next "t v" ok! test_char "v" return char_776: # 'o' input_next "t o" ok! test_char "o" return char_778: # 'i' input_next "t i" ok! test_char "i" return char_780: # 'd' input_next "t d" ok! test_char "d" return # # void Symbol 'WHITESPACE' # sym_WHITESPACE: # * # / # <space> # (COMMENT) symbol_restore WHITESPACE found! return loc_push call kleene_794 value_clear symbol_save WHITESPACE error_nonterminal WHITESPACE loc_pop_discard return kleene_794: # * # / # <space> # (COMMENT) loc_push error_push call choice_792 error_pop_merge fail! jump failed_795 loc_pop_discard jump kleene_794 failed_795: loc_pop_rewind status_ok return choice_792: # / # <space> # (COMMENT) error_clear loc_push error_push call space_788 error_pop_merge ok! jump oknoast_791 loc_pop_rewind loc_push error_push call sym_COMMENT error_pop_merge ok! jump oknoast_791 loc_pop_rewind status_fail return oknoast_791: loc_pop_discard return space_788: # <space> input_next "space" ok! test_space return # # leaf Symbol 'WORDCHAR' |
︙ | ︙ | |||
6301 6302 6303 6304 6305 6306 6307 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR | | | | | < < < < < < < < < < < < < < < < < < | | | | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR found! jump found_822 loc_push call sequence_819 fail! value_clear ok! value_leaf WORDCHAR symbol_save WORDCHAR error_nonterminal WORDCHAR loc_pop_discard found_822: ok! ast_value_push return sequence_819: # x # '<' # 'w' # 'o' # 'r' # 'd' # 'c' # 'h' # 'a' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push call char_798 error_pop_merge fail! jump failed_820 error_push call char_800 error_pop_merge fail! jump failed_820 error_push call char_802 error_pop_merge fail! jump failed_820 error_push call char_804 error_pop_merge fail! jump failed_820 error_push call char_806 error_pop_merge fail! jump failed_820 error_push call char_808 error_pop_merge fail! jump failed_820 error_push call char_810 error_pop_merge fail! jump failed_820 error_push call char_812 error_pop_merge fail! jump failed_820 error_push call char_814 error_pop_merge fail! jump failed_820 error_push call char_816 error_pop_merge fail! jump failed_820 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_820 loc_pop_discard return failed_820: loc_pop_rewind return char_798: # '<' input_next "t <" ok! test_char "<" return char_800: # 'w' input_next "t w" ok! test_char "w" return char_802: # 'o' input_next "t o" ok! test_char "o" return char_804: # 'r' input_next "t r" ok! test_char "r" return char_806: # 'd' input_next "t d" ok! test_char "d" return char_808: # 'c' input_next "t c" ok! test_char "c" return char_810: # 'h' input_next "t h" ok! test_char "h" return char_812: # 'a' input_next "t a" ok! test_char "a" return char_814: # 'r' input_next "t r" ok! test_char "r" return char_816: # '>' input_next "t >" ok! test_char ">" return # # leaf Symbol 'XDIGIT' |
︙ | ︙ | |||
6493 6494 6495 6496 6497 6498 6499 | # 'g' # 'i' # 't' # '>' # (WHITESPACE) symbol_restore XDIGIT | | | | | < < < < < < < < < < < < < < < < < < | | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 | # 'g' # 'i' # 't' # '>' # (WHITESPACE) symbol_restore XDIGIT found! jump found_844 loc_push call sequence_841 fail! value_clear ok! value_leaf XDIGIT symbol_save XDIGIT error_nonterminal XDIGIT loc_pop_discard found_844: ok! ast_value_push return sequence_841: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push call char_824 error_pop_merge fail! jump failed_842 error_push call char_826 error_pop_merge fail! jump failed_842 error_push call char_828 error_pop_merge fail! jump failed_842 error_push call char_830 error_pop_merge fail! jump failed_842 error_push call char_832 error_pop_merge fail! jump failed_842 error_push call char_834 error_pop_merge fail! jump failed_842 error_push call char_836 error_pop_merge fail! jump failed_842 error_push call char_838 error_pop_merge fail! jump failed_842 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_842 loc_pop_discard return failed_842: loc_pop_rewind return char_824: # '<' input_next "t <" ok! test_char "<" return char_826: # 'x' input_next "t x" ok! test_char "x" return char_828: # 'd' input_next "t d" ok! test_char "d" return char_830: # 'i' input_next "t i" ok! test_char "i" return char_832: # 'g' input_next "t g" ok! test_char "g" return char_834: # 'i' input_next "t i" ok! test_char "i" return char_836: # 't' input_next "t t" ok! test_char "t" return char_838: # '>' input_next "t >" ok! test_char ">" return # # |
Changes to modules/pt/tests/data/ok/peg_param/3_peg_itself.
︙ | ︙ | |||
638 639 640 641 642 643 644 | # range (0 .. 7) loc_push error_clear error_push | | | | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | # range (0 .. 7) loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_76 error_push input_next ".. 0 2" ok! test_range "0" "2" |
︙ | ︙ | |||
710 711 712 713 714 715 716 | # range (0 .. 7) loc_push error_clear error_push | | | | 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | # range (0 .. 7) loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_86 error_push input_next ".. 0 7" ok! test_range "0" "7" |
︙ | ︙ | |||
802 803 804 805 806 807 808 | # '\' loc_push error_clear error_push | | | | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | # '\' loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_103 error_push call choice_100 |
︙ | ︙ | |||
877 878 879 880 881 882 883 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push | | | | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push input_next "t "" ok! test_char """ error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push |
︙ | ︙ | |||
907 908 909 910 911 912 913 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push | | | | 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | error_pop_merge ok! jump oknoast_99 loc_pop_rewind loc_push error_push input_next "t \" ok! test_char "\" error_pop_merge ok! jump oknoast_99 loc_pop_rewind status_fail return |
︙ | ︙ | |||
981 982 983 984 985 986 987 | notahead_108: # ! # '\' loc_push | | | | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 | notahead_108: # ! # '\' loc_push input_next "t \" ok! test_char "\" loc_pop_rewind status_negate return # # leaf Symbol 'CharUnicode' # |
︙ | ︙ | |||
1040 1041 1042 1043 1044 1045 1046 | # <xdigit> loc_push error_clear error_push | | | | 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 | # <xdigit> loc_push error_clear error_push input_next "t \" ok! test_char "\" error_pop_merge fail! jump failed_135 error_push input_next "t u" ok! test_char "u" |
︙ | ︙ | |||
1722 1723 1724 1725 1726 1727 1728 | sym_DAPOSTROPH: # '\"' symbol_restore DAPOSTROPH found! return loc_push | | | | 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | sym_DAPOSTROPH: # '\"' symbol_restore DAPOSTROPH found! return loc_push input_next "t "" ok! test_char """ value_clear symbol_save DAPOSTROPH error_nonterminal DAPOSTROPH loc_pop_discard return # |
︙ | ︙ | |||
2105 2106 2107 2108 2109 2110 2111 | loc_pop_discard return failed_248: loc_pop_rewind return # | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 | loc_pop_discard return failed_248: loc_pop_rewind return # # void Symbol 'EOF' # sym_EOF: # ! # <dot> symbol_restore EOF found! return loc_push call notahead_253 value_clear symbol_save EOF error_nonterminal EOF loc_pop_discard return notahead_253: # ! # <dot> loc_push input_next "dot" |
︙ | ︙ | |||
2215 2216 2217 2218 2219 2220 2221 | # '\n' # '\r' symbol_restore EOL found! return loc_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | | | > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 | # '\n' # '\r' symbol_restore EOL found! return loc_push call choice_259 value_clear symbol_save EOL error_nonterminal EOL loc_pop_discard return choice_259: # / # '\n' # '\r' error_clear loc_push error_push input_next "t <LF>" ok! test_char "<LF>" error_pop_merge ok! jump oknoast_258 loc_pop_rewind loc_push error_push input_next "t <CR>" ok! test_char "<CR>" error_pop_merge ok! jump oknoast_258 loc_pop_rewind status_fail return oknoast_258: loc_pop_discard return # # value Symbol 'Expression' # sym_Expression: # x # (Sequence) # * # x # (SLASH) # (Sequence) symbol_restore Expression found! jump found_275 loc_push ast_push call sequence_272 fail! value_clear ok! value_reduce Expression symbol_save Expression error_nonterminal Expression ast_pop_rewind loc_pop_discard found_275: ok! ast_value_push return sequence_272: # x # (Sequence) # * # x # (SLASH) # (Sequence) ast_push loc_push error_clear error_push call sym_Sequence error_pop_merge fail! jump failed_273 error_push call kleene_269 error_pop_merge fail! jump failed_273 ast_pop_discard loc_pop_discard return failed_273: ast_pop_rewind loc_pop_rewind return kleene_269: # * # x # (SLASH) # (Sequence) loc_push error_push call sequence_265 error_pop_merge fail! jump failed_270 loc_pop_discard jump kleene_269 failed_270: loc_pop_rewind status_ok return sequence_265: # x # (SLASH) # (Sequence) loc_push error_clear error_push call sym_SLASH error_pop_merge fail! jump failednoast_267 ast_push error_push call sym_Sequence error_pop_merge fail! jump failed_266 ast_pop_discard loc_pop_discard return failed_266: ast_pop_rewind failednoast_267: loc_pop_rewind return # # void Symbol 'Final' # sym_Final: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) symbol_restore Final found! return loc_push call sequence_283 value_clear symbol_save Final error_nonterminal Final loc_pop_discard return sequence_283: # x # 'E' # 'N' # 'D' # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) loc_push error_clear error_push input_next "t E" ok! test_char "E" error_pop_merge fail! jump failed_284 error_push input_next "t N" ok! test_char "N" error_pop_merge fail! jump failed_284 error_push input_next "t D" ok! test_char "D" error_pop_merge fail! jump failed_284 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_284 error_push call sym_SEMICOLON error_pop_merge fail! jump failed_284 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_284 loc_pop_discard return failed_284: loc_pop_rewind return # # value Symbol 'Grammar' # sym_Grammar: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) symbol_restore Grammar found! jump found_299 loc_push ast_push call sequence_295 fail! value_clear ok! value_reduce Grammar symbol_save Grammar error_nonterminal Grammar ast_pop_rewind loc_pop_discard found_299: ok! ast_value_push return sequence_295: # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) loc_push error_clear error_push call sym_WHITESPACE error_pop_merge fail! jump failednoast_297 ast_push error_push call sym_Header error_pop_merge fail! jump failed_296 error_push call kleene_290 error_pop_merge fail! jump failed_296 error_push call sym_Final error_pop_merge fail! jump failed_296 error_push call sym_EOF error_pop_merge fail! jump failed_296 ast_pop_discard loc_pop_discard return failed_296: ast_pop_rewind failednoast_297: loc_pop_rewind return kleene_290: # * # (Definition) loc_push error_push call sym_Definition error_pop_merge fail! jump failed_291 loc_pop_discard jump kleene_290 failed_291: loc_pop_rewind status_ok return # # leaf Symbol 'GRAPH' # sym_GRAPH: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) symbol_restore GRAPH found! jump found_312 loc_push call sequence_309 fail! value_clear ok! value_leaf GRAPH symbol_save GRAPH error_nonterminal GRAPH loc_pop_discard found_312: ok! ast_value_push return sequence_309: # x # '<' # 'g' # 'r' # 'a' # 'p' # 'h' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_310 error_push input_next "t g" ok! test_char "g" error_pop_merge fail! jump failed_310 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_310 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_310 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_310 error_push input_next "t h" ok! test_char "h" error_pop_merge fail! jump failed_310 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_310 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_310 loc_pop_discard return failed_310: loc_pop_rewind return # # value Symbol 'Header' # sym_Header: # x # (PEG) # (Identifier) # (StartExpr) symbol_restore Header found! jump found_321 loc_push ast_push call sequence_317 fail! value_clear ok! value_reduce Header symbol_save Header error_nonterminal Header ast_pop_rewind loc_pop_discard found_321: ok! ast_value_push return sequence_317: # x # (PEG) # (Identifier) # (StartExpr) loc_push error_clear error_push call sym_PEG error_pop_merge fail! jump failednoast_319 ast_push error_push call sym_Identifier error_pop_merge fail! jump failed_318 error_push call sym_StartExpr error_pop_merge fail! jump failed_318 ast_pop_discard loc_pop_discard return failed_318: ast_pop_rewind failednoast_319: loc_pop_rewind return # # leaf Symbol 'Ident' # sym_Ident: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> symbol_restore Ident found! jump found_341 loc_push call sequence_338 fail! value_clear ok! value_leaf Ident symbol_save Ident error_nonterminal Ident loc_pop_discard found_341: ok! ast_value_push return sequence_338: # x # / # '_' # ':' # <alpha> # * # / # '_' # ':' # <alnum> loc_push error_clear error_push call choice_327 error_pop_merge fail! jump failed_339 error_push call kleene_335 error_pop_merge fail! jump failed_339 loc_pop_discard return failed_339: loc_pop_rewind return choice_327: # / # '_' # ':' # <alpha> error_clear loc_push error_push input_next "t _" ok! test_char "_" error_pop_merge ok! jump oknoast_326 loc_pop_rewind loc_push error_push input_next "t :" ok! test_char ":" error_pop_merge ok! jump oknoast_326 loc_pop_rewind loc_push error_push input_next "alpha" ok! test_alpha error_pop_merge ok! jump oknoast_326 loc_pop_rewind status_fail return oknoast_326: loc_pop_discard return kleene_335: # * # / # '_' # ':' # <alnum> loc_push error_push call choice_333 error_pop_merge fail! jump failed_336 loc_pop_discard jump kleene_335 failed_336: loc_pop_rewind status_ok return choice_333: # / # '_' # ':' # <alnum> error_clear loc_push error_push input_next "t _" ok! test_char "_" error_pop_merge ok! jump oknoast_332 loc_pop_rewind loc_push error_push input_next "t :" ok! test_char ":" error_pop_merge ok! jump oknoast_332 loc_pop_rewind loc_push error_push input_next "alnum" ok! test_alnum error_pop_merge ok! jump oknoast_332 loc_pop_rewind status_fail return oknoast_332: loc_pop_discard return # # value Symbol 'Identifier' # sym_Identifier: # x # (Ident) # (WHITESPACE) symbol_restore Identifier found! jump found_348 loc_push ast_push call sequence_345 fail! value_clear ok! value_reduce Identifier symbol_save Identifier error_nonterminal Identifier ast_pop_rewind loc_pop_discard found_348: ok! ast_value_push return sequence_345: # x # (Ident) # (WHITESPACE) ast_push loc_push error_clear error_push call sym_Ident error_pop_merge fail! jump failed_346 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_346 ast_pop_discard loc_pop_discard return failed_346: ast_pop_rewind loc_pop_rewind return # # void Symbol 'IS' # sym_IS: # x # '<' # '-' # (WHITESPACE) symbol_restore IS found! return loc_push call sequence_353 value_clear symbol_save IS error_nonterminal IS loc_pop_discard return sequence_353: # x # '<' # '-' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_354 error_push input_next "t -" ok! test_char "-" error_pop_merge fail! jump failed_354 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_354 loc_pop_discard return failed_354: loc_pop_rewind return # # leaf Symbol 'LEAF' # sym_LEAF: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) symbol_restore LEAF found! jump found_365 loc_push call sequence_362 fail! value_clear ok! value_leaf LEAF symbol_save LEAF error_nonterminal LEAF loc_pop_discard found_365: ok! ast_value_push return sequence_362: # x # 'l' # 'e' # 'a' # 'f' # (WHITESPACE) loc_push error_clear error_push input_next "t l" ok! test_char "l" error_pop_merge fail! jump failed_363 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_363 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_363 error_push input_next "t f" ok! test_char "f" error_pop_merge fail! jump failed_363 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_363 loc_pop_discard return failed_363: loc_pop_rewind return # # value Symbol 'Literal' # sym_Literal: |
︙ | ︙ | |||
3106 3107 3108 3109 3110 3111 3112 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal | | | | | | 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) symbol_restore Literal found! jump found_406 loc_push ast_push call choice_404 fail! value_clear ok! value_reduce Literal symbol_save Literal error_nonterminal Literal ast_pop_rewind loc_pop_discard found_406: ok! ast_value_push return choice_404: # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
3150 3151 3152 3153 3154 3155 3156 | error_clear ast_push loc_push error_push | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 | error_clear ast_push loc_push error_push call sequence_381 error_pop_merge ok! jump ok_403 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_399 error_pop_merge ok! jump ok_403 ast_pop_rewind loc_pop_rewind status_fail return ok_403: ast_pop_discard loc_pop_discard return sequence_381: # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_APOSTROPH error_pop_merge fail! jump failednoast_383 ast_push error_push call kleene_376 error_pop_merge fail! jump failed_382 error_push call sym_APOSTROPH error_pop_merge fail! jump failed_382 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_382 ast_pop_discard loc_pop_discard return failed_382: ast_pop_rewind failednoast_383: loc_pop_rewind return kleene_376: # * # x # ! # (APOSTROPH) # (Char) loc_push error_push call sequence_372 error_pop_merge fail! jump failed_377 loc_pop_discard jump kleene_376 failed_377: loc_pop_rewind status_ok return sequence_372: # x # ! # (APOSTROPH) # (Char) loc_push error_clear error_push call notahead_369 error_pop_merge fail! jump failednoast_374 ast_push error_push call sym_Char error_pop_merge fail! jump failed_373 ast_pop_discard loc_pop_discard return failed_373: ast_pop_rewind failednoast_374: loc_pop_rewind return notahead_369: # ! # (APOSTROPH) loc_push call sym_APOSTROPH loc_pop_rewind status_negate return sequence_399: # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) loc_push error_clear error_push call sym_DAPOSTROPH error_pop_merge fail! jump failednoast_401 ast_push error_push call kleene_394 error_pop_merge fail! jump failed_400 error_push call sym_DAPOSTROPH error_pop_merge fail! jump failed_400 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_400 ast_pop_discard loc_pop_discard return failed_400: ast_pop_rewind failednoast_401: loc_pop_rewind return kleene_394: # * # x # ! # (DAPOSTROPH) # (Char) loc_push error_push call sequence_390 error_pop_merge fail! jump failed_395 loc_pop_discard jump kleene_394 failed_395: loc_pop_rewind status_ok return sequence_390: # x # ! # (DAPOSTROPH) # (Char) loc_push error_clear error_push call notahead_387 error_pop_merge fail! jump failednoast_392 ast_push error_push call sym_Char error_pop_merge fail! jump failed_391 ast_pop_discard loc_pop_discard return failed_391: ast_pop_rewind failednoast_392: loc_pop_rewind return notahead_387: # ! # (DAPOSTROPH) loc_push call sym_DAPOSTROPH |
︙ | ︙ | |||
3429 3430 3431 3432 3433 3434 3435 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER | | | | | | | | | | | | | | | | | | | | | | | | | | | 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 | # 'w' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore LOWER found! jump found_419 loc_push call sequence_416 fail! value_clear ok! value_leaf LOWER symbol_save LOWER error_nonterminal LOWER loc_pop_discard found_419: ok! ast_value_push return sequence_416: # x # '<' # 'l' # 'o' # 'w' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_417 error_push input_next "t l" ok! test_char "l" error_pop_merge fail! jump failed_417 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_417 error_push input_next "t w" ok! test_char "w" error_pop_merge fail! jump failed_417 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_417 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_417 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_417 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_417 loc_pop_discard return failed_417: loc_pop_rewind return # # leaf Symbol 'NOT' # sym_NOT: # x # '!' # (WHITESPACE) symbol_restore NOT found! jump found_426 loc_push call sequence_423 fail! value_clear ok! value_leaf NOT symbol_save NOT error_nonterminal NOT loc_pop_discard found_426: ok! ast_value_push return sequence_423: # x # '!' # (WHITESPACE) loc_push error_clear error_push input_next "t !" ok! test_char "!" error_pop_merge fail! jump failed_424 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_424 loc_pop_discard return failed_424: loc_pop_rewind return # # void Symbol 'OPEN' # sym_OPEN: # x # '\(' # (WHITESPACE) symbol_restore OPEN found! return loc_push call sequence_430 value_clear symbol_save OPEN error_nonterminal OPEN loc_pop_discard return sequence_430: # x # '\(' # (WHITESPACE) loc_push error_clear error_push input_next "t (" ok! test_char "(" error_pop_merge fail! jump failed_431 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_431 loc_pop_discard return failed_431: loc_pop_rewind return # # void Symbol 'OPENB' # sym_OPENB: |
︙ | ︙ | |||
3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 | # sym_PEG: # x # 'P' # 'E' # 'G' # (WHITESPACE) symbol_restore PEG found! return loc_push | > > > > > | | > > > > > | | | > > > > > > | | > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 | # sym_PEG: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) symbol_restore PEG found! return loc_push call sequence_447 value_clear symbol_save PEG error_nonterminal PEG loc_pop_discard return sequence_447: # x # 'P' # 'E' # 'G' # ! # / # '_' # ':' # <alnum> # (WHITESPACE) loc_push error_clear error_push input_next "t P" ok! test_char "P" error_pop_merge fail! jump failed_448 error_push input_next "t E" ok! test_char "E" error_pop_merge fail! jump failed_448 error_push input_next "t G" ok! test_char "G" error_pop_merge fail! jump failed_448 error_push call notahead_444 error_pop_merge fail! jump failed_448 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_448 loc_pop_discard return failed_448: loc_pop_rewind return notahead_444: # ! # / # '_' # ':' # <alnum> loc_push call choice_333 loc_pop_rewind status_negate return # # leaf Symbol 'PLUS' # sym_PLUS: # x # '+' # (WHITESPACE) symbol_restore PLUS found! jump found_456 loc_push call sequence_453 fail! value_clear ok! value_leaf PLUS symbol_save PLUS error_nonterminal PLUS loc_pop_discard found_456: ok! ast_value_push return sequence_453: # x # '+' # (WHITESPACE) loc_push error_clear error_push input_next "t +" ok! test_char "+" error_pop_merge fail! jump failed_454 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_454 loc_pop_discard return failed_454: loc_pop_rewind return # # value Symbol 'Prefix' # sym_Prefix: # x # ? # / # (AND) # (NOT) # (Suffix) symbol_restore Prefix found! jump found_469 loc_push ast_push call sequence_466 fail! value_clear ok! value_reduce Prefix symbol_save Prefix error_nonterminal Prefix ast_pop_rewind loc_pop_discard found_469: ok! ast_value_push return sequence_466: # x # ? # / # (AND) # (NOT) # (Suffix) ast_push loc_push error_clear error_push call optional_463 error_pop_merge fail! jump failed_467 error_push call sym_Suffix error_pop_merge fail! jump failed_467 ast_pop_discard loc_pop_discard return failed_467: ast_pop_rewind loc_pop_rewind return optional_463: # ? # / # (AND) # (NOT) loc_push error_push call choice_461 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_461: # / # (AND) # (NOT) error_clear ast_push loc_push error_push call sym_AND error_pop_merge ok! jump ok_460 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_NOT error_pop_merge ok! jump ok_460 ast_pop_rewind loc_pop_rewind status_fail return ok_460: ast_pop_discard loc_pop_discard return # # value Symbol 'Primary' # |
︙ | ︙ | |||
3908 3909 3910 3911 3912 3913 3914 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary | | | | | | 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) symbol_restore Primary found! jump found_499 loc_push ast_push call choice_497 fail! value_clear ok! value_reduce Primary symbol_save Primary error_nonterminal Primary ast_pop_rewind loc_pop_discard found_499: ok! ast_value_push return choice_497: # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
3959 3960 3961 3962 3963 3964 3965 | ast_push loc_push error_push call sym_ALNUM error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 | ast_push loc_push error_push call sym_ALNUM error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ALPHA error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_ASCII error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_CONTROL error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DDIGIT error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DIGIT error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_GRAPH error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_LOWER error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PRINTABLE error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PUNCT error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_SPACE error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_UPPER error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_WORDCHAR error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_XDIGIT error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Identifier error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sequence_489 error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Literal error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Class error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_DOT error_pop_merge ok! jump ok_496 ast_pop_rewind loc_pop_rewind status_fail return ok_496: ast_pop_discard loc_pop_discard return sequence_489: # x # (OPEN) # (Expression) # (CLOSE) loc_push error_clear error_push call sym_OPEN error_pop_merge fail! jump failednoast_491 ast_push error_push call sym_Expression error_pop_merge fail! jump failed_490 error_push call sym_CLOSE error_pop_merge fail! jump failed_490 ast_pop_discard loc_pop_discard return failed_490: ast_pop_rewind failednoast_491: loc_pop_rewind return # # leaf Symbol 'PRINTABLE' # sym_PRINTABLE: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) symbol_restore PRINTABLE found! jump found_512 loc_push call sequence_509 fail! value_clear ok! value_leaf PRINTABLE symbol_save PRINTABLE error_nonterminal PRINTABLE loc_pop_discard found_512: ok! ast_value_push return sequence_509: # x # '<' # 'p' # 'r' # 'i' # 'n' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_510 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_510 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_510 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_510 error_push input_next "t n" ok! test_char "n" error_pop_merge fail! jump failed_510 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_510 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_510 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_510 loc_pop_discard return failed_510: loc_pop_rewind return # # leaf Symbol 'PUNCT' # sym_PUNCT: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) symbol_restore PUNCT found! jump found_525 loc_push call sequence_522 fail! value_clear ok! value_leaf PUNCT symbol_save PUNCT error_nonterminal PUNCT loc_pop_discard found_525: ok! ast_value_push return sequence_522: # x # '<' # 'p' # 'u' # 'n' # 'c' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_523 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_523 error_push input_next "t u" ok! test_char "u" error_pop_merge fail! jump failed_523 error_push input_next "t n" ok! test_char "n" error_pop_merge fail! jump failed_523 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_523 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_523 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_523 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_523 loc_pop_discard return failed_523: loc_pop_rewind return # # leaf Symbol 'QUESTION' # sym_QUESTION: # x # '?' # (WHITESPACE) symbol_restore QUESTION found! jump found_532 loc_push call sequence_529 fail! value_clear ok! value_leaf QUESTION symbol_save QUESTION error_nonterminal QUESTION loc_pop_discard found_532: ok! ast_value_push return sequence_529: # x # '?' # (WHITESPACE) loc_push error_clear error_push input_next "t ?" ok! test_char "?" error_pop_merge fail! jump failed_530 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_530 loc_pop_discard return failed_530: loc_pop_rewind return # # value Symbol 'Range' # sym_Range: # / # x # (Char) # (TO) # (Char) # (Char) symbol_restore Range found! jump found_544 loc_push ast_push call choice_542 fail! value_clear ok! value_reduce Range symbol_save Range error_nonterminal Range ast_pop_rewind loc_pop_discard found_544: ok! ast_value_push return choice_542: # / # x # (Char) # (TO) # (Char) # (Char) error_clear ast_push loc_push error_push call sequence_537 error_pop_merge ok! jump ok_541 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_Char error_pop_merge ok! jump ok_541 ast_pop_rewind loc_pop_rewind status_fail return ok_541: ast_pop_discard loc_pop_discard return sequence_537: # x # (Char) # (TO) # (Char) ast_push loc_push error_clear error_push call sym_Char error_pop_merge fail! jump failed_538 error_push call sym_TO error_pop_merge fail! jump failed_538 error_push call sym_Char error_pop_merge fail! jump failed_538 ast_pop_discard loc_pop_discard return failed_538: ast_pop_rewind loc_pop_rewind return # # void Symbol 'SEMICOLON' # sym_SEMICOLON: # x # ';' # (WHITESPACE) symbol_restore SEMICOLON found! return loc_push call sequence_548 value_clear symbol_save SEMICOLON error_nonterminal SEMICOLON loc_pop_discard return sequence_548: # x # ';' # (WHITESPACE) loc_push error_clear error_push input_next "t ;" ok! test_char ";" error_pop_merge fail! jump failed_549 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_549 loc_pop_discard return failed_549: loc_pop_rewind return # # value Symbol 'Sequence' # sym_Sequence: # + # (Prefix) symbol_restore Sequence found! jump found_557 loc_push ast_push call poskleene_553 fail! value_clear ok! value_reduce Sequence symbol_save Sequence error_nonterminal Sequence ast_pop_rewind loc_pop_discard found_557: ok! ast_value_push return poskleene_553: # + # (Prefix) loc_push call sym_Prefix fail! jump failed_554 loop_555: loc_pop_discard loc_push error_push call sym_Prefix error_pop_merge ok! jump loop_555 status_ok failed_554: loc_pop_rewind return # # void Symbol 'SLASH' # sym_SLASH: # x # '/' # (WHITESPACE) symbol_restore SLASH found! return loc_push call sequence_561 value_clear symbol_save SLASH error_nonterminal SLASH loc_pop_discard return sequence_561: # x # '/' # (WHITESPACE) loc_push error_clear error_push input_next "t /" ok! test_char "/" error_pop_merge fail! jump failed_562 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_562 loc_pop_discard return failed_562: loc_pop_rewind return # # leaf Symbol 'SPACE' # sym_SPACE: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) symbol_restore SPACE found! jump found_576 loc_push call sequence_573 fail! value_clear ok! value_leaf SPACE symbol_save SPACE error_nonterminal SPACE loc_pop_discard found_576: ok! ast_value_push return sequence_573: # x # '<' # 's' # 'p' # 'a' # 'c' # 'e' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_574 error_push input_next "t s" ok! test_char "s" error_pop_merge fail! jump failed_574 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_574 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_574 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_574 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_574 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_574 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_574 loc_pop_discard return failed_574: loc_pop_rewind return # # leaf Symbol 'STAR' # sym_STAR: # x # '*' # (WHITESPACE) symbol_restore STAR found! jump found_583 loc_push call sequence_580 fail! value_clear ok! value_leaf STAR symbol_save STAR error_nonterminal STAR loc_pop_discard found_583: ok! ast_value_push return sequence_580: # x # '*' # (WHITESPACE) loc_push error_clear error_push input_next "t *" ok! test_char "*" error_pop_merge fail! jump failed_581 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_581 loc_pop_discard return failed_581: loc_pop_rewind return # # value Symbol 'StartExpr' # sym_StartExpr: # x # (OPEN) # (Expression) # (CLOSE) symbol_restore StartExpr found! jump found_589 loc_push ast_push call sequence_489 fail! value_clear ok! value_reduce StartExpr symbol_save StartExpr error_nonterminal StartExpr ast_pop_rewind loc_pop_discard found_589: ok! ast_value_push return # # value Symbol 'Suffix' # sym_Suffix: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) symbol_restore Suffix found! jump found_603 loc_push ast_push call sequence_600 fail! value_clear ok! value_reduce Suffix symbol_save Suffix error_nonterminal Suffix ast_pop_rewind loc_pop_discard found_603: ok! ast_value_push return sequence_600: # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) ast_push loc_push error_clear error_push call sym_Primary error_pop_merge fail! jump failed_601 error_push call optional_598 error_pop_merge fail! jump failed_601 ast_pop_discard loc_pop_discard return failed_601: ast_pop_rewind loc_pop_rewind return optional_598: # ? # / # (QUESTION) # (STAR) # (PLUS) loc_push error_push call choice_596 error_pop_merge fail! loc_pop_rewind ok! loc_pop_discard status_ok return choice_596: # / # (QUESTION) # (STAR) # (PLUS) error_clear ast_push loc_push error_push call sym_QUESTION error_pop_merge ok! jump ok_595 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_STAR error_pop_merge ok! jump ok_595 ast_pop_rewind loc_pop_rewind ast_push loc_push error_push call sym_PLUS error_pop_merge ok! jump ok_595 ast_pop_rewind loc_pop_rewind status_fail return ok_595: ast_pop_discard loc_pop_discard return # # void Symbol 'TO' # |
︙ | ︙ | |||
5084 5085 5086 5087 5088 5089 5090 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 | # 'p' # 'e' # 'r' # '>' # (WHITESPACE) symbol_restore UPPER found! jump found_618 loc_push call sequence_615 fail! value_clear ok! value_leaf UPPER symbol_save UPPER error_nonterminal UPPER loc_pop_discard found_618: ok! ast_value_push return sequence_615: # x # '<' # 'u' # 'p' # 'p' # 'e' # 'r' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_616 error_push input_next "t u" ok! test_char "u" error_pop_merge fail! jump failed_616 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_616 error_push input_next "t p" ok! test_char "p" error_pop_merge fail! jump failed_616 error_push input_next "t e" ok! test_char "e" error_pop_merge fail! jump failed_616 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_616 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_616 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_616 loc_pop_discard return failed_616: loc_pop_rewind return # # leaf Symbol 'VOID' # sym_VOID: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) symbol_restore VOID found! jump found_628 loc_push call sequence_625 fail! value_clear ok! value_leaf VOID symbol_save VOID error_nonterminal VOID loc_pop_discard found_628: ok! ast_value_push return sequence_625: # x # 'v' # 'o' # 'i' # 'd' # (WHITESPACE) loc_push error_clear error_push input_next "t v" ok! test_char "v" error_pop_merge fail! jump failed_626 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_626 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_626 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_626 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_626 loc_pop_discard return failed_626: loc_pop_rewind return # # void Symbol 'WHITESPACE' # sym_WHITESPACE: # * # / # <space> # (COMMENT) symbol_restore WHITESPACE found! return loc_push call kleene_635 value_clear symbol_save WHITESPACE error_nonterminal WHITESPACE loc_pop_discard return kleene_635: # * # / # <space> # (COMMENT) loc_push error_push call choice_633 error_pop_merge fail! jump failed_636 loc_pop_discard jump kleene_635 failed_636: loc_pop_rewind status_ok return choice_633: # / # <space> # (COMMENT) error_clear loc_push error_push input_next "space" ok! test_space error_pop_merge ok! jump oknoast_632 loc_pop_rewind loc_push error_push call sym_COMMENT error_pop_merge ok! jump oknoast_632 loc_pop_rewind status_fail return oknoast_632: loc_pop_discard return # # leaf Symbol 'WORDCHAR' # sym_WORDCHAR: |
︙ | ︙ | |||
5349 5350 5351 5352 5353 5354 5355 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR | | | | | | 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 | # 'h' # 'a' # 'r' # '>' # (WHITESPACE) symbol_restore WORDCHAR found! jump found_653 loc_push call sequence_650 fail! value_clear ok! value_leaf WORDCHAR symbol_save WORDCHAR error_nonterminal WORDCHAR loc_pop_discard found_653: ok! ast_value_push return sequence_650: # x # '<' # 'w' # 'o' # 'r' # 'd' # 'c' |
︙ | ︙ | |||
5387 5388 5389 5390 5391 5392 5393 | error_push input_next "t <" ok! test_char "<" error_pop_merge | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 | error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_651 error_push input_next "t w" ok! test_char "w" error_pop_merge fail! jump failed_651 error_push input_next "t o" ok! test_char "o" error_pop_merge fail! jump failed_651 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_651 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_651 error_push input_next "t c" ok! test_char "c" error_pop_merge fail! jump failed_651 error_push input_next "t h" ok! test_char "h" error_pop_merge fail! jump failed_651 error_push input_next "t a" ok! test_char "a" error_pop_merge fail! jump failed_651 error_push input_next "t r" ok! test_char "r" error_pop_merge fail! jump failed_651 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_651 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_651 loc_pop_discard return failed_651: loc_pop_rewind return # # leaf Symbol 'XDIGIT' # sym_XDIGIT: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) symbol_restore XDIGIT found! jump found_667 loc_push call sequence_664 fail! value_clear ok! value_leaf XDIGIT symbol_save XDIGIT error_nonterminal XDIGIT loc_pop_discard found_667: ok! ast_value_push return sequence_664: # x # '<' # 'x' # 'd' # 'i' # 'g' # 'i' # 't' # '>' # (WHITESPACE) loc_push error_clear error_push input_next "t <" ok! test_char "<" error_pop_merge fail! jump failed_665 error_push input_next "t x" ok! test_char "x" error_pop_merge fail! jump failed_665 error_push input_next "t d" ok! test_char "d" error_pop_merge fail! jump failed_665 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_665 error_push input_next "t g" ok! test_char "g" error_pop_merge fail! jump failed_665 error_push input_next "t i" ok! test_char "i" error_pop_merge fail! jump failed_665 error_push input_next "t t" ok! test_char "t" error_pop_merge fail! jump failed_665 error_push input_next "t >" ok! test_char ">" error_pop_merge fail! jump failed_665 error_push call sym_WHITESPACE error_pop_merge fail! jump failed_665 loc_pop_discard return failed_665: loc_pop_rewind return # # |
Changes to modules/pt/tests/data/ok/peg_peg-ast-fused/3_peg_itself.
|
| | | 1 2 3 4 5 6 7 8 | <Grammar> :: 0 3032 <Header> :: 0 27 <Identifier> :: 4 16 <Ident> :: 4 15 <StartExpr> :: 17 27 <Expression> :: 18 24 <Sequence> :: 18 24 <Prefix> :: 18 24 |
︙ | ︙ | |||
640 641 642 643 644 645 646 | <Char> :: 1109 1109 <CharUnescaped> :: 1109 1109 <Prefix> :: 1112 1122 <Suffix> :: 1112 1122 <Primary> :: 1112 1122 <Identifier> :: 1112 1122 <Ident> :: 1112 1121 | | | | | > | | < | | | | | | > > | | | < | < | | > > > > > | | | | | < | | < < < < | | > > > | | | | | | | | < | | < < | | < | | | | | | < < < | | | | | | | > > > > > | | | | | | < | | | | < < | | | | | | < < | | > > | | | | | | > > | | < < | | | | | > | | | | | | | | | | < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > | | | | | | > > | | < < | | | | | | | | | | > > | | | < < < < < < < | | | | | | > > > > > > | | | | > > > > > > > > > | | | | | | | | | | | | | | > | | | | | | < < | < < | < < | | | | | | > > | | | | | | | > | > | > | | | | | | | | | | | | | | | | | | | | > > > > | | | | | | > > > | | > > | | < < | | | < | < | < < < < < | > | | | | | > > | | < | | | | < < < < < < | | > | | | | | < | | | | | | > | | | | < | | | | | | < < < < | < | | | | | | | | | < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > | | > | > | > | | | | | | | | | | > | | > | | > | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | | | | | | | | > > | | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > | | > > | | | | | | | | | | | | | | | > | | | > | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | < < | < | < < | | < < | | | | | | | | < < < < < < | | | | | | | | | | | | | | | | > > > > > > | | < < < < < < | | | | | | | | | | | | | | | | > > > > > | | | | < < < < < | | | | | | | | | | | | | | | > > > > | | | | | | | | | | | | | | | < < < < | | | > > > > > | | | | > > > > | > | > | > > > > > > > | > | > < < < < < < < < < < < < < < < < < < < < | | | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 | <Char> :: 1109 1109 <CharUnescaped> :: 1109 1109 <Prefix> :: 1112 1122 <Suffix> :: 1112 1122 <Primary> :: 1112 1122 <Identifier> :: 1112 1122 <Ident> :: 1112 1121 <Definition> :: 1125 1152 <Attribute> :: 1125 1130 <VOID> :: 1125 1128 <Identifier> :: 1131 1144 <Ident> :: 1131 1133 <Expression> :: 1148 1150 <Sequence> :: 1148 1150 <Prefix> :: 1148 1150 <NOT> :: 1148 1148 <Suffix> :: 1149 1150 <Primary> :: 1149 1150 <DOT> :: 1149 1150 <Definition> :: 1153 1190 <Attribute> :: 1153 1158 <VOID> :: 1153 1156 <Identifier> :: 1159 1172 <Ident> :: 1159 1161 <Expression> :: 1176 1182 <Sequence> :: 1176 1182 <Prefix> :: 1176 1182 <Suffix> :: 1176 1182 <Primary> :: 1176 1182 <Class> :: 1176 1182 <Range> :: 1177 1178 <Char> :: 1177 1178 <CharSpecial> :: 1177 1178 <Range> :: 1179 1180 <Char> :: 1179 1180 <CharSpecial> :: 1179 1180 <Definition> :: 1191 1236 <Identifier> :: 1191 1204 <Ident> :: 1191 1200 <Expression> :: 1208 1234 <Sequence> :: 1208 1234 <Prefix> :: 1208 1216 <Suffix> :: 1208 1216 <Primary> :: 1208 1216 <Identifier> :: 1208 1216 <Ident> :: 1208 1215 <Prefix> :: 1217 1234 <Suffix> :: 1217 1234 <Primary> :: 1217 1232 <Expression> :: 1218 1231 <Sequence> :: 1218 1231 <Prefix> :: 1218 1223 <Suffix> :: 1218 1223 <Primary> :: 1218 1223 <Identifier> :: 1218 1223 <Ident> :: 1218 1222 <Prefix> :: 1224 1231 <Suffix> :: 1224 1231 <Primary> :: 1224 1231 <Identifier> :: 1224 1231 <Ident> :: 1224 1231 <STAR> :: 1233 1234 <Definition> :: 1237 1305 <Attribute> :: 1237 1242 <VOID> :: 1237 1240 <Identifier> :: 1243 1256 <Ident> :: 1243 1247 <Expression> :: 1260 1297 <Sequence> :: 1260 1297 <Prefix> :: 1260 1265 <Suffix> :: 1260 1265 <Primary> :: 1260 1265 <Literal> :: 1260 1265 <Char> :: 1261 1261 <CharUnescaped> :: 1261 1261 <Char> :: 1262 1262 <CharUnescaped> :: 1262 1262 <Char> :: 1263 1263 <CharUnescaped> :: 1263 1263 <Prefix> :: 1266 1276 <Suffix> :: 1266 1276 <Primary> :: 1266 1276 <Identifier> :: 1266 1276 <Ident> :: 1266 1275 <Prefix> :: 1277 1286 <Suffix> :: 1277 1286 <Primary> :: 1277 1286 <Identifier> :: 1277 1286 <Ident> :: 1277 1285 <Prefix> :: 1287 1297 <Suffix> :: 1287 1297 <Primary> :: 1287 1297 <Identifier> :: 1287 1297 <Ident> :: 1287 1296 <Definition> :: 1306 1364 <Identifier> :: 1306 1319 <Ident> :: 1306 1312 <Expression> :: 1323 1362 <Sequence> :: 1323 1362 <Prefix> :: 1323 1333 <Suffix> :: 1323 1333 <Primary> :: 1323 1333 <Identifier> :: 1323 1333 <Ident> :: 1323 1332 <Prefix> :: 1334 1340 <Suffix> :: 1334 1340 <Primary> :: 1334 1340 <Identifier> :: 1334 1340 <Ident> :: 1334 1339 <Prefix> :: 1341 1352 <Suffix> :: 1341 1352 <Primary> :: 1341 1350 <Identifier> :: 1341 1350 <Ident> :: 1341 1350 <STAR> :: 1351 1352 <Prefix> :: 1353 1358 <Suffix> :: 1353 1358 <Primary> :: 1353 1358 <Identifier> :: 1353 1358 <Ident> :: 1353 1357 <Prefix> :: 1359 1362 <Suffix> :: 1359 1362 <Primary> :: 1359 1362 <Identifier> :: 1359 1362 <Ident> :: 1359 1361 <Definition> :: 1365 1416 <Attribute> :: 1365 1370 <LEAF> :: 1365 1368 <Identifier> :: 1371 1384 <Ident> :: 1371 1375 <Expression> :: 1388 1408 <Sequence> :: 1388 1408 <Prefix> :: 1388 1397 <Suffix> :: 1388 1397 <Primary> :: 1388 1397 <Literal> :: 1388 1397 <Char> :: 1389 1389 <CharUnescaped> :: 1389 1389 <Char> :: 1390 1390 <CharUnescaped> :: 1390 1390 <Char> :: 1391 1391 <CharUnescaped> :: 1391 1391 <Char> :: 1392 1392 <CharUnescaped> :: 1392 1392 <Char> :: 1393 1393 <CharUnescaped> :: 1393 1393 <Char> :: 1394 1394 <CharUnescaped> :: 1394 1394 <Char> :: 1395 1395 <CharUnescaped> :: 1395 1395 <Prefix> :: 1398 1408 <Suffix> :: 1398 1408 <Primary> :: 1398 1408 <Identifier> :: 1398 1408 <Ident> :: 1398 1407 <Definition> :: 1417 1460 <Identifier> :: 1417 1430 <Ident> :: 1417 1422 <Expression> :: 1434 1458 <Sequence> :: 1434 1458 <Prefix> :: 1434 1437 <Suffix> :: 1434 1437 <Primary> :: 1434 1437 <Identifier> :: 1434 1437 <Ident> :: 1434 1436 <Prefix> :: 1438 1448 <Suffix> :: 1438 1448 <Primary> :: 1438 1448 <Identifier> :: 1438 1448 <Ident> :: 1438 1447 <Prefix> :: 1449 1458 <Suffix> :: 1449 1458 <Primary> :: 1449 1458 <Identifier> :: 1449 1458 <Ident> :: 1449 1457 <Definition> :: 1461 1526 <Attribute> :: 1461 1466 <LEAF> :: 1461 1464 <Identifier> :: 1467 1480 <Ident> :: 1467 1471 <Expression> :: 1484 1518 <Sequence> :: 1484 1518 <Prefix> :: 1484 1500 <Suffix> :: 1484 1500 <Primary> :: 1484 1500 <Expression> :: 1485 1498 <Sequence> :: 1485 1489 <Prefix> :: 1485 1489 <Suffix> :: 1485 1489 <Primary> :: 1485 1489 <Class> :: 1485 1489 <Range> :: 1486 1486 <Char> :: 1486 1486 <CharUnescaped> :: 1486 1486 <Range> :: 1487 1487 <Char> :: 1487 1487 <CharUnescaped> :: 1487 1487 <Sequence> :: 1492 1498 <Prefix> :: 1492 1498 <Suffix> :: 1492 1498 <Primary> :: 1492 1498 <ALPHA> :: 1492 1498 <Prefix> :: 1501 1518 <Suffix> :: 1501 1518 <Primary> :: 1501 1516 <Expression> :: 1502 1515 <Sequence> :: 1502 1506 <Prefix> :: 1502 1506 <Suffix> :: 1502 1506 <Primary> :: 1502 1506 <Class> :: 1502 1506 <Range> :: 1503 1503 <Char> :: 1503 1503 <CharUnescaped> :: 1503 1503 <Range> :: 1504 1504 <Char> :: 1504 1504 <CharUnescaped> :: 1504 1504 <Sequence> :: 1509 1515 <Prefix> :: 1509 1515 <Suffix> :: 1509 1515 <Primary> :: 1509 1515 <ALNUM> :: 1509 1515 <STAR> :: 1517 1518 <Definition> :: 1527 1562 <Identifier> :: 1527 1540 <Ident> :: 1527 1536 <Expression> :: 1544 1560 <Sequence> :: 1544 1560 <Prefix> :: 1544 1549 <Suffix> :: 1544 1549 <Primary> :: 1544 1549 <Identifier> :: 1544 1549 <Ident> :: 1544 1548 <Prefix> :: 1550 1560 <Suffix> :: 1550 1560 <Primary> :: 1550 1560 <Identifier> :: 1550 1560 <Ident> :: 1550 1559 <Definition> :: 1563 1603 <Attribute> :: 1563 1568 <VOID> :: 1563 1566 <Identifier> :: 1569 1582 <Ident> :: 1569 1570 <Expression> :: 1586 1601 <Sequence> :: 1586 1601 <Prefix> :: 1586 1590 <Suffix> :: 1586 1590 <Primary> :: 1586 1590 <Literal> :: 1586 1590 <Char> :: 1587 1587 <CharUnescaped> :: 1587 1587 <Char> :: 1588 1588 <CharUnescaped> :: 1588 1588 <Prefix> :: 1591 1601 <Suffix> :: 1591 1601 <Primary> :: 1591 1601 <Identifier> :: 1591 1601 <Ident> :: 1591 1600 <Definition> :: 1604 1652 <Attribute> :: 1604 1609 <LEAF> :: 1604 1607 <Identifier> :: 1610 1623 <Ident> :: 1610 1613 <Expression> :: 1627 1644 <Sequence> :: 1627 1644 <Prefix> :: 1627 1633 <Suffix> :: 1627 1633 <Primary> :: 1627 1633 <Literal> :: 1627 1633 <Char> :: 1628 1628 <CharUnescaped> :: 1628 1628 <Char> :: 1629 1629 <CharUnescaped> :: 1629 1629 <Char> :: 1630 1630 <CharUnescaped> :: 1630 1630 <Char> :: 1631 1631 <CharUnescaped> :: 1631 1631 <Prefix> :: 1634 1644 <Suffix> :: 1634 1644 <Primary> :: 1634 1644 <Identifier> :: 1634 1644 <Ident> :: 1634 1643 <Definition> :: 1653 1776 <Identifier> :: 1653 1666 <Ident> :: 1653 1659 <Expression> :: 1670 1774 <Sequence> :: 1670 1719 <Prefix> :: 1670 1679 <Suffix> :: 1670 1679 <Primary> :: 1670 1679 <Identifier> :: 1670 1679 <Ident> :: 1670 1678 <Prefix> :: 1680 1698 <Suffix> :: 1680 1698 <Primary> :: 1680 1696 <Expression> :: 1681 1695 <Sequence> :: 1681 1695 <Prefix> :: 1681 1691 <NOT> :: 1681 1681 <Suffix> :: 1682 1691 <Primary> :: 1682 1691 <Identifier> :: 1682 1691 <Ident> :: 1682 1690 <Prefix> :: 1692 1695 <Suffix> :: 1692 1695 <Primary> :: 1692 1695 <Identifier> :: 1692 1695 <Ident> :: 1692 1695 <STAR> :: 1697 1698 <Prefix> :: 1699 1708 <Suffix> :: 1699 1708 <Primary> :: 1699 1708 <Identifier> :: 1699 1708 <Ident> :: 1699 1707 <Prefix> :: 1709 1719 <Suffix> :: 1709 1719 <Primary> :: 1709 1719 <Identifier> :: 1709 1719 <Ident> :: 1709 1718 <Sequence> :: 1722 1774 <Prefix> :: 1722 1732 <Suffix> :: 1722 1732 <Primary> :: 1722 1732 <Identifier> :: 1722 1732 <Ident> :: 1722 1731 <Prefix> :: 1733 1752 <Suffix> :: 1733 1752 <Primary> :: 1733 1750 <Expression> :: 1734 1749 <Sequence> :: 1734 1749 <Prefix> :: 1734 1745 <NOT> :: 1734 1734 <Suffix> :: 1735 1745 <Primary> :: 1735 1745 <Identifier> :: 1735 1745 <Ident> :: 1735 1744 <Prefix> :: 1746 1749 <Suffix> :: 1746 1749 <Primary> :: 1746 1749 <Identifier> :: 1746 1749 <Ident> :: 1746 1749 <STAR> :: 1751 1752 <Prefix> :: 1753 1763 <Suffix> :: 1753 1763 <Primary> :: 1753 1763 <Identifier> :: 1753 1763 <Ident> :: 1753 1762 <Prefix> :: 1764 1774 <Suffix> :: 1764 1774 <Primary> :: 1764 1774 <Identifier> :: 1764 1774 <Ident> :: 1764 1773 <Definition> :: 1777 1822 <Attribute> :: 1777 1782 <LEAF> :: 1777 1780 <Identifier> :: 1783 1796 <Ident> :: 1783 1787 <Expression> :: 1800 1820 <Sequence> :: 1800 1820 <Prefix> :: 1800 1809 <Suffix> :: 1800 1809 <Primary> :: 1800 1809 <Literal> :: 1800 1809 <Char> :: 1801 1801 <CharUnescaped> :: 1801 1801 <Char> :: 1802 1802 <CharUnescaped> :: 1802 1802 <Char> :: 1803 1803 <CharUnescaped> :: 1803 1803 <Char> :: 1804 1804 <CharUnescaped> :: 1804 1804 <Char> :: 1805 1805 <CharUnescaped> :: 1805 1805 <Char> :: 1806 1806 <CharUnescaped> :: 1806 1806 <Char> :: 1807 1807 <CharUnescaped> :: 1807 1807 <Prefix> :: 1810 1820 <Suffix> :: 1810 1820 <Primary> :: 1810 1820 <Identifier> :: 1810 1820 <Ident> :: 1810 1819 <Definition> :: 1823 1862 <Attribute> :: 1823 1828 <LEAF> :: 1823 1826 <Identifier> :: 1829 1842 <Ident> :: 1829 1831 <Expression> :: 1846 1860 <Sequence> :: 1846 1860 <Prefix> :: 1846 1849 <Suffix> :: 1846 1849 <Primary> :: 1846 1849 <Literal> :: 1846 1849 <Char> :: 1847 1847 <CharUnescaped> :: 1847 1847 <Prefix> :: 1850 1860 <Suffix> :: 1850 1860 <Primary> :: 1850 1860 <Identifier> :: 1850 1860 <Ident> :: 1850 1859 <Definition> :: 1863 1902 <Attribute> :: 1863 1868 <VOID> :: 1863 1866 <Identifier> :: 1869 1882 <Ident> :: 1869 1872 <Expression> :: 1886 1900 <Sequence> :: 1886 1900 <Prefix> :: 1886 1889 <Suffix> :: 1886 1889 <Primary> :: 1886 1889 <Literal> :: 1886 1889 <Char> :: 1887 1887 <CharUnescaped> :: 1887 1887 <Prefix> :: 1890 1900 <Suffix> :: 1890 1900 <Primary> :: 1890 1900 <Identifier> :: 1890 1900 <Ident> :: 1890 1899 <Definition> :: 1903 1932 <Attribute> :: 1903 1908 <VOID> :: 1903 1906 <Identifier> :: 1909 1922 <Ident> :: 1909 1913 <Expression> :: 1926 1930 <Sequence> :: 1926 1930 <Prefix> :: 1926 1930 <Suffix> :: 1926 1930 <Primary> :: 1926 1930 <Literal> :: 1926 1930 <Char> :: 1927 1928 <CharSpecial> :: 1927 1928 <Definition> :: 1933 1992 <Attribute> :: 1933 1938 <VOID> :: 1933 1936 <Identifier> :: 1939 1952 <Ident> :: 1939 1941 <Expression> :: 1956 1990 <Sequence> :: 1956 1990 <Prefix> :: 1956 1961 <Suffix> :: 1956 1961 <Primary> :: 1956 1961 <Literal> :: 1956 1961 <Char> :: 1957 1957 <CharUnescaped> :: 1957 1957 <Char> :: 1958 1958 <CharUnescaped> :: 1958 1958 <Char> :: 1959 1959 <CharUnescaped> :: 1959 1959 <Prefix> :: 1962 1979 <NOT> :: 1962 1962 <Suffix> :: 1963 1979 <Primary> :: 1963 1979 <Expression> :: 1964 1977 <Sequence> :: 1964 1968 <Prefix> :: 1964 1968 <Suffix> :: 1964 1968 <Primary> :: 1964 1968 <Class> :: 1964 1968 <Range> :: 1965 1965 <Char> :: 1965 1965 <CharUnescaped> :: 1965 1965 <Range> :: 1966 1966 <Char> :: 1966 1966 <CharUnescaped> :: 1966 1966 <Sequence> :: 1971 1977 <Prefix> :: 1971 1977 <Suffix> :: 1971 1977 <Primary> :: 1971 1977 <ALNUM> :: 1971 1977 <Prefix> :: 1980 1990 <Suffix> :: 1980 1990 <Primary> :: 1980 1990 <Identifier> :: 1980 1990 <Ident> :: 1980 1989 <Definition> :: 1993 2038 <Attribute> :: 1993 1998 <LEAF> :: 1993 1996 <Identifier> :: 1999 2012 <Ident> :: 1999 2002 <Expression> :: 2016 2030 <Sequence> :: 2016 2030 <Prefix> :: 2016 2019 <Suffix> :: 2016 2019 <Primary> :: 2016 2019 <Literal> :: 2016 2019 <Char> :: 2017 2017 <CharUnescaped> :: 2017 2017 <Prefix> :: 2020 2030 <Suffix> :: 2020 2030 <Primary> :: 2020 2030 <Identifier> :: 2020 2030 <Ident> :: 2020 2029 <Definition> :: 2039 2083 <Identifier> :: 2039 2052 <Ident> :: 2039 2044 <Expression> :: 2056 2075 <Sequence> :: 2056 2075 <Prefix> :: 2056 2068 <Suffix> :: 2056 2068 <Primary> :: 2056 2066 <Expression> :: 2057 2065 <Sequence> :: 2057 2060 <Prefix> :: 2057 2060 <Suffix> :: 2057 2060 <Primary> :: 2057 2060 <Identifier> :: 2057 2060 <Ident> :: 2057 2059 <Sequence> :: 2063 2065 <Prefix> :: 2063 2065 <Suffix> :: 2063 2065 <Primary> :: 2063 2065 <Identifier> :: 2063 2065 <Ident> :: 2063 2065 <QUESTION> :: 2067 2068 <Prefix> :: 2069 2075 <Suffix> :: 2069 2075 <Primary> :: 2069 2075 <Identifier> :: 2069 2075 <Ident> :: 2069 2074 <Definition> :: 2084 2284 <Identifier> :: 2084 2097 <Ident> :: 2084 2090 <Expression> :: 2101 2282 <Sequence> :: 2101 2106 <Prefix> :: 2101 2106 <Suffix> :: 2101 2106 <Primary> :: 2101 2106 <Identifier> :: 2101 2106 <Ident> :: 2101 2105 <Sequence> :: 2109 2114 <Prefix> :: 2109 2114 <Suffix> :: 2109 2114 <Primary> :: 2109 2114 <Identifier> :: 2109 2114 <Ident> :: 2109 2113 <Sequence> :: 2117 2122 <Prefix> :: 2117 2122 <Suffix> :: 2117 2122 <Primary> :: 2117 2122 <Identifier> :: 2117 2122 <Ident> :: 2117 2121 <Sequence> :: 2125 2132 <Prefix> :: 2125 2132 <Suffix> :: 2125 2132 <Primary> :: 2125 2132 <Identifier> :: 2125 2132 <Ident> :: 2125 2131 <Sequence> :: 2135 2141 <Prefix> :: 2135 2141 <Suffix> :: 2135 2141 <Primary> :: 2135 2141 <Identifier> :: 2135 2141 <Ident> :: 2135 2140 <Sequence> :: 2144 2149 <Prefix> :: 2144 2149 <Suffix> :: 2144 2149 <Primary> :: 2144 2149 <Identifier> :: 2144 2149 <Ident> :: 2144 2148 <Sequence> :: 2152 2157 <Prefix> :: 2152 2157 <Suffix> :: 2152 2157 <Primary> :: 2152 2157 <Identifier> :: 2152 2157 <Ident> :: 2152 2156 <Sequence> :: 2160 2165 <Prefix> :: 2160 2165 <Suffix> :: 2160 2165 <Primary> :: 2160 2165 <Identifier> :: 2160 2165 <Ident> :: 2160 2164 <Sequence> :: 2168 2177 <Prefix> :: 2168 2177 <Suffix> :: 2168 2177 <Primary> :: 2168 2177 <Identifier> :: 2168 2177 <Ident> :: 2168 2176 <Sequence> :: 2180 2185 <Prefix> :: 2180 2185 <Suffix> :: 2180 2185 <Primary> :: 2180 2185 <Identifier> :: 2180 2185 <Ident> :: 2180 2184 <Sequence> :: 2188 2193 <Prefix> :: 2188 2193 <Suffix> :: 2188 2193 <Primary> :: 2188 2193 <Identifier> :: 2188 2193 <Ident> :: 2188 2192 <Sequence> :: 2196 2201 <Prefix> :: 2196 2201 <Suffix> :: 2196 2201 <Primary> :: 2196 2201 <Identifier> :: 2196 2201 <Ident> :: 2196 2200 <Sequence> :: 2204 2212 <Prefix> :: 2204 2212 <Suffix> :: 2204 2212 <Primary> :: 2204 2212 <Identifier> :: 2204 2212 <Ident> :: 2204 2211 <Sequence> :: 2215 2221 <Prefix> :: 2215 2221 <Suffix> :: 2215 2221 <Primary> :: 2215 2221 <Identifier> :: 2215 2221 <Ident> :: 2215 2220 <Sequence> :: 2224 2234 <Prefix> :: 2224 2234 <Suffix> :: 2224 2234 <Primary> :: 2224 2234 <Identifier> :: 2224 2234 <Ident> :: 2224 2233 <Sequence> :: 2237 2258 <Prefix> :: 2237 2241 <Suffix> :: 2237 2241 <Primary> :: 2237 2241 <Identifier> :: 2237 2241 <Ident> :: 2237 2240 <Prefix> :: 2242 2252 <Suffix> :: 2242 2252 <Primary> :: 2242 2252 <Identifier> :: 2242 2252 <Ident> :: 2242 2251 <Prefix> :: 2253 2258 <Suffix> :: 2253 2258 <Primary> :: 2253 2258 <Identifier> :: 2253 2258 <Ident> :: 2253 2257 <Sequence> :: 2261 2268 <Prefix> :: 2261 2268 <Suffix> :: 2261 2268 <Primary> :: 2261 2268 <Identifier> :: 2261 2268 <Ident> :: 2261 2267 <Sequence> :: 2271 2276 <Prefix> :: 2271 2276 <Suffix> :: 2271 2276 <Primary> :: 2271 2276 <Identifier> :: 2271 2276 <Ident> :: 2271 2275 <Sequence> :: 2279 2282 <Prefix> :: 2279 2282 <Suffix> :: 2279 2282 <Primary> :: 2279 2282 <Identifier> :: 2279 2282 <Ident> :: 2279 2281 <Definition> :: 2285 2330 <Attribute> :: 2285 2290 <LEAF> :: 2285 2288 <Identifier> :: 2291 2304 <Ident> :: 2291 2299 <Expression> :: 2308 2328 <Sequence> :: 2308 2328 <Prefix> :: 2308 2317 <Suffix> :: 2308 2317 <Primary> :: 2308 2317 <Literal> :: 2308 2317 <Char> :: 2309 2309 <CharUnescaped> :: 2309 2309 <Char> :: 2310 2310 <CharUnescaped> :: 2310 2310 <Char> :: 2311 2311 <CharUnescaped> :: 2311 2311 <Char> :: 2312 2312 <CharUnescaped> :: 2312 2312 <Char> :: 2313 2313 <CharUnescaped> :: 2313 2313 <Char> :: 2314 2314 <CharUnescaped> :: 2314 2314 <Char> :: 2315 2315 <CharUnescaped> :: 2315 2315 <Prefix> :: 2318 2328 <Suffix> :: 2318 2328 <Primary> :: 2318 2328 <Identifier> :: 2318 2328 <Ident> :: 2318 2327 <Definition> :: 2331 2376 <Attribute> :: 2331 2336 <LEAF> :: 2331 2334 <Identifier> :: 2337 2350 <Ident> :: 2337 2341 <Expression> :: 2354 2374 <Sequence> :: 2354 2374 <Prefix> :: 2354 2363 <Suffix> :: 2354 2363 <Primary> :: 2354 2363 <Literal> :: 2354 2363 <Char> :: 2355 2355 <CharUnescaped> :: 2355 2355 <Char> :: 2356 2356 <CharUnescaped> :: 2356 2356 <Char> :: 2357 2357 <CharUnescaped> :: 2357 2357 <Char> :: 2358 2358 <CharUnescaped> :: 2358 2358 <Char> :: 2359 2359 <CharUnescaped> :: 2359 2359 <Char> :: 2360 2360 <CharUnescaped> :: 2360 2360 <Char> :: 2361 2361 <CharUnescaped> :: 2361 2361 <Prefix> :: 2364 2374 <Suffix> :: 2364 2374 <Primary> :: 2364 2374 <Identifier> :: 2364 2374 <Ident> :: 2364 2373 <Definition> :: 2377 2422 <Attribute> :: 2377 2382 <LEAF> :: 2377 2380 <Identifier> :: 2383 2396 <Ident> :: 2383 2390 <Expression> :: 2400 2414 <Sequence> :: 2400 2414 <Prefix> :: 2400 2403 <Suffix> :: 2400 2403 <Primary> :: 2400 2403 <Literal> :: 2400 2403 <Char> :: 2401 2401 <CharUnescaped> :: 2401 2401 <Prefix> :: 2404 2414 <Suffix> :: 2404 2414 <Primary> :: 2404 2414 <Identifier> :: 2404 2414 <Ident> :: 2404 2413 <Definition> :: 2423 2461 <Identifier> :: 2423 2436 <Ident> :: 2423 2427 <Expression> :: 2440 2459 <Sequence> :: 2440 2452 <Prefix> :: 2440 2444 <Suffix> :: 2440 2444 <Primary> :: 2440 2444 <Identifier> :: 2440 2444 <Ident> :: 2440 2443 <Prefix> :: 2445 2447 <Suffix> :: 2445 2447 <Primary> :: 2445 2447 <Identifier> :: 2445 2447 <Ident> :: 2445 2446 <Prefix> :: 2448 2452 <Suffix> :: 2448 2452 <Primary> :: 2448 2452 <Identifier> :: 2448 2452 <Ident> :: 2448 2451 <Sequence> :: 2455 2459 <Prefix> :: 2455 2459 <Suffix> :: 2455 2459 <Primary> :: 2455 2459 <Identifier> :: 2455 2459 <Ident> :: 2455 2458 <Definition> :: 2462 2507 <Attribute> :: 2462 2467 <VOID> :: 2462 2465 <Identifier> :: 2468 2481 <Ident> :: 2468 2476 <Expression> :: 2485 2499 <Sequence> :: 2485 2499 <Prefix> :: 2485 2488 <Suffix> :: 2485 2488 <Primary> :: 2485 2488 <Literal> :: 2485 2488 <Char> :: 2486 2486 <CharUnescaped> :: 2486 2486 <Prefix> :: 2489 2499 <Suffix> :: 2489 2499 <Primary> :: 2489 2499 <Identifier> :: 2489 2499 <Ident> :: 2489 2498 <Definition> :: 2508 2534 <Identifier> :: 2508 2521 <Ident> :: 2508 2515 <Expression> :: 2525 2532 <Sequence> :: 2525 2532 <Prefix> :: 2525 2532 <Suffix> :: 2525 2532 <Primary> :: 2525 2530 <Identifier> :: 2525 2530 <Ident> :: 2525 2530 <PLUS> :: 2531 2532 <Definition> :: 2535 2574 <Attribute> :: 2535 2540 <VOID> :: 2535 2538 <Identifier> :: 2541 2554 <Ident> :: 2541 2545 <Expression> :: 2558 2572 <Sequence> :: 2558 2572 <Prefix> :: 2558 2561 <Suffix> :: 2558 2561 <Primary> :: 2558 2561 <Literal> :: 2558 2561 <Char> :: 2559 2559 <CharUnescaped> :: 2559 2559 <Prefix> :: 2562 2572 <Suffix> :: 2562 2572 <Primary> :: 2562 2572 <Identifier> :: 2562 2572 <Ident> :: 2562 2571 <Definition> :: 2575 2620 <Attribute> :: 2575 2580 <LEAF> :: 2575 2578 <Identifier> :: 2581 2594 <Ident> :: 2581 2585 <Expression> :: 2598 2618 <Sequence> :: 2598 2618 <Prefix> :: 2598 2607 <Suffix> :: 2598 2607 <Primary> :: 2598 2607 <Literal> :: 2598 2607 <Char> :: 2599 2599 <CharUnescaped> :: 2599 2599 <Char> :: 2600 2600 <CharUnescaped> :: 2600 2600 <Char> :: 2601 2601 <CharUnescaped> :: 2601 2601 <Char> :: 2602 2602 <CharUnescaped> :: 2602 2602 <Char> :: 2603 2603 <CharUnescaped> :: 2603 2603 <Char> :: 2604 2604 <CharUnescaped> :: 2604 2604 <Char> :: 2605 2605 <CharUnescaped> :: 2605 2605 <Prefix> :: 2608 2618 <Suffix> :: 2608 2618 <Primary> :: 2608 2618 <Identifier> :: 2608 2618 <Ident> :: 2608 2617 <Definition> :: 2621 2666 <Attribute> :: 2621 2626 <LEAF> :: 2621 2624 <Identifier> :: 2627 2640 <Ident> :: 2627 2630 <Expression> :: 2644 2658 <Sequence> :: 2644 2658 <Prefix> :: 2644 2647 <Suffix> :: 2644 2647 <Primary> :: 2644 2647 <Literal> :: 2644 2647 <Char> :: 2645 2645 <CharUnescaped> :: 2645 2645 <Prefix> :: 2648 2658 <Suffix> :: 2648 2658 <Primary> :: 2648 2658 <Identifier> :: 2648 2658 <Ident> :: 2648 2657 <Definition> :: 2667 2713 <Identifier> :: 2667 2680 <Ident> :: 2667 2675 <Expression> :: 2684 2705 <Sequence> :: 2684 2705 <Prefix> :: 2684 2688 <Suffix> :: 2684 2688 <Primary> :: 2684 2688 <Identifier> :: 2684 2688 <Ident> :: 2684 2687 <Prefix> :: 2689 2699 <Suffix> :: 2689 2699 <Primary> :: 2689 2699 <Identifier> :: 2689 2699 <Ident> :: 2689 2698 <Prefix> :: 2700 2705 <Suffix> :: 2700 2705 <Primary> :: 2700 2705 <Identifier> :: 2700 2705 <Ident> :: 2700 2704 <Definition> :: 2714 2766 <Identifier> :: 2714 2727 <Ident> :: 2714 2719 <Expression> :: 2731 2764 <Sequence> :: 2731 2764 <Prefix> :: 2731 2738 <Suffix> :: 2731 2738 <Primary> :: 2731 2738 <Identifier> :: 2731 2738 <Ident> :: 2731 2737 <Prefix> :: 2739 2764 <Suffix> :: 2739 2764 <Primary> :: 2739 2762 <Expression> :: 2740 2761 <Sequence> :: 2740 2748 <Prefix> :: 2740 2748 <Suffix> :: 2740 2748 <Primary> :: 2740 2748 <Identifier> :: 2740 2748 <Ident> :: 2740 2747 <Sequence> :: 2751 2755 <Prefix> :: 2751 2755 <Suffix> :: 2751 2755 <Primary> :: 2751 2755 <Identifier> :: 2751 2755 <Ident> :: 2751 2754 <Sequence> :: 2758 2761 <Prefix> :: 2758 2761 <Suffix> :: 2758 2761 <Primary> :: 2758 2761 <Identifier> :: 2758 2761 <Ident> :: 2758 2761 <QUESTION> :: 2763 2764 <Definition> :: 2767 2795 <Attribute> :: 2767 2772 <VOID> :: 2767 2770 <Identifier> :: 2773 2786 <Ident> :: 2773 2774 <Expression> :: 2790 2793 <Sequence> :: 2790 2793 <Prefix> :: 2790 2793 <Suffix> :: 2790 2793 <Primary> :: 2790 2793 <Literal> :: 2790 2793 <Char> :: 2791 2791 <CharUnescaped> :: 2791 2791 <Definition> :: 2796 2841 <Attribute> :: 2796 2801 <LEAF> :: 2796 2799 <Identifier> :: 2802 2815 <Ident> :: 2802 2806 <Expression> :: 2819 2839 <Sequence> :: 2819 2839 <Prefix> :: 2819 2828 <Suffix> :: 2819 2828 <Primary> :: 2819 2828 <Literal> :: 2819 2828 <Char> :: 2820 2820 <CharUnescaped> :: 2820 2820 <Char> :: 2821 2821 <CharUnescaped> :: 2821 2821 <Char> :: 2822 2822 <CharUnescaped> :: 2822 2822 <Char> :: 2823 2823 <CharUnescaped> :: 2823 2823 <Char> :: 2824 2824 <CharUnescaped> :: 2824 2824 <Char> :: 2825 2825 <CharUnescaped> :: 2825 2825 <Char> :: 2826 2826 <CharUnescaped> :: 2826 2826 <Prefix> :: 2829 2839 <Suffix> :: 2829 2839 <Primary> :: 2829 2839 <Identifier> :: 2829 2839 <Ident> :: 2829 2838 <Definition> :: 2842 2884 <Attribute> :: 2842 2847 <LEAF> :: 2842 2845 <Identifier> :: 2848 2861 <Ident> :: 2848 2851 <Expression> :: 2865 2882 <Sequence> :: 2865 2882 <Prefix> :: 2865 2871 <Suffix> :: 2865 2871 <Primary> :: 2865 2871 <Literal> :: 2865 2871 <Char> :: 2866 2866 <CharUnescaped> :: 2866 2866 <Char> :: 2867 2867 <CharUnescaped> :: 2867 2867 <Char> :: 2868 2868 <CharUnescaped> :: 2868 2868 <Char> :: 2869 2869 <CharUnescaped> :: 2869 2869 <Prefix> :: 2872 2882 <Suffix> :: 2872 2882 <Primary> :: 2872 2882 <Identifier> :: 2872 2882 <Ident> :: 2872 2881 <Definition> :: 2885 2930 <Attribute> :: 2885 2890 <VOID> :: 2885 2888 <Identifier> :: 2891 2904 <Ident> :: 2891 2900 <Expression> :: 2908 2928 <Sequence> :: 2908 2928 <Prefix> :: 2908 2928 <Suffix> :: 2908 2928 <Primary> :: 2908 2926 <Expression> :: 2909 2925 <Sequence> :: 2909 2916 <Prefix> :: 2909 2916 <Suffix> :: 2909 2916 <Primary> :: 2909 2916 <SPACE> :: 2909 2916 <Sequence> :: 2919 2925 <Prefix> :: 2919 2925 <Suffix> :: 2919 2925 <Primary> :: 2919 2925 <Identifier> :: 2919 2925 <Ident> :: 2919 2925 <STAR> :: 2927 2928 <Definition> :: 2931 2979 <Attribute> :: 2931 2936 <LEAF> :: 2931 2934 <Identifier> :: 2937 2950 <Ident> :: 2937 2944 <Expression> :: 2954 2977 <Sequence> :: 2954 2977 <Prefix> :: 2954 2966 <Suffix> :: 2954 2966 <Primary> :: 2954 2966 <Literal> :: 2954 2966 <Char> :: 2955 2955 <CharUnescaped> :: 2955 2955 <Char> :: 2956 2956 <CharUnescaped> :: 2956 2956 <Char> :: 2957 2957 <CharUnescaped> :: 2957 2957 <Char> :: 2958 2958 <CharUnescaped> :: 2958 2958 <Char> :: 2959 2959 <CharUnescaped> :: 2959 2959 <Char> :: 2960 2960 <CharUnescaped> :: 2960 2960 <Char> :: 2961 2961 <CharUnescaped> :: 2961 2961 <Char> :: 2962 2962 <CharUnescaped> :: 2962 2962 <Char> :: 2963 2963 <CharUnescaped> :: 2963 2963 <Char> :: 2964 2964 <CharUnescaped> :: 2964 2964 <Prefix> :: 2967 2977 <Suffix> :: 2967 2977 <Primary> :: 2967 2977 <Identifier> :: 2967 2977 <Ident> :: 2967 2976 <Definition> :: 2980 3027 <Attribute> :: 2980 2985 <LEAF> :: 2980 2983 <Identifier> :: 2986 2999 <Ident> :: 2986 2991 <Expression> :: 3003 3024 <Sequence> :: 3003 3024 <Prefix> :: 3003 3013 <Suffix> :: 3003 3013 <Primary> :: 3003 3013 <Literal> :: 3003 3013 <Char> :: 3004 3004 <CharUnescaped> :: 3004 3004 <Char> :: 3005 3005 <CharUnescaped> :: 3005 3005 <Char> :: 3006 3006 <CharUnescaped> :: 3006 3006 <Char> :: 3007 3007 <CharUnescaped> :: 3007 3007 <Char> :: 3008 3008 <CharUnescaped> :: 3008 3008 <Char> :: 3009 3009 <CharUnescaped> :: 3009 3009 <Char> :: 3010 3010 <CharUnescaped> :: 3010 3010 <Char> :: 3011 3011 <CharUnescaped> :: 3011 3011 <Prefix> :: 3014 3024 <Suffix> :: 3014 3024 <Primary> :: 3014 3024 <Identifier> :: 3014 3024 <Ident> :: 3014 3023 |
Changes to modules/pt/tests/data/ok/peg_peg-ast-templated-fused/3_peg_itself.
|
| | | 1 2 3 4 5 6 7 8 | <Grammar> :: 0 3132 <Header> :: 99 122 <Identifier> :: 103 111 <Ident> :: 103 110 <StartExpr> :: 112 122 <Expression> :: 113 119 <Sequence> :: 113 119 <Prefix> :: 113 119 |
︙ | ︙ | |||
640 641 642 643 644 645 646 | <Char> :: 1204 1204 <CharUnescaped> :: 1204 1204 <Prefix> :: 1207 1217 <Suffix> :: 1207 1217 <Primary> :: 1207 1217 <Identifier> :: 1207 1217 <Ident> :: 1207 1216 | | | | | > | | < | | | | | | > > | | | < | < | | > > > > > | | | | | < | | < < < < | | > > > | | | | | | | | < | | < < | | < | | | | | | < < < | | | | | | | > > > > > | | | | | | < | | | | < < | | | | | | < < | | > > | | | | | | > > | | < < | | | | | > | | | | | | | | | | < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > | | | | | | > > | | < < | | | | | | | | | | > > | | | < < < < < < < | | | | | | > > > > > > | | | | > > > > > > > > > | | | | | | | | | | | > | | | | | | | | | < < | < < < < | | | | | | | > > | | | | | | | > | > | > | | | | | | | | | | | | | | | | | | | | > > > > | | | | | | > > > | | > > | | < < | | | < | < | < < < < < | > | | | | | > > | | < | | | | < < < < < < | | > | | | | | < | | | | | | > | | | | < | | | | | | < < < < | < | | | | | | | | | < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > | > > > > > > > > | | | | | | | | | | | | > | > | > | | | | | | | | | | > | | > | | > | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > | | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > | | | > > > | | > > | | | | | | | | | | | | | | | > | | | > | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | < < | < | < < | | < < | | | | | | | | < < < < < < | | | | | | | | | | | | | | | | > > > > > > | | < < < < < < | | | | | | | | | | | | | | | | > > > > > | | | | < < < < < | | | | | | | | | | | | | | | > > > > | | | | | | | | | | | | | | | < < < < | | | > > > > > | | | | | | > > | > | > | > > > > > > > > > > > < < < < < < < < < < < < < < < < < < < < | | | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 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 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 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 | <Char> :: 1204 1204 <CharUnescaped> :: 1204 1204 <Prefix> :: 1207 1217 <Suffix> :: 1207 1217 <Primary> :: 1207 1217 <Identifier> :: 1207 1217 <Ident> :: 1207 1216 <Definition> :: 1220 1247 <Attribute> :: 1220 1225 <VOID> :: 1220 1223 <Identifier> :: 1226 1239 <Ident> :: 1226 1228 <Expression> :: 1243 1245 <Sequence> :: 1243 1245 <Prefix> :: 1243 1245 <NOT> :: 1243 1243 <Suffix> :: 1244 1245 <Primary> :: 1244 1245 <DOT> :: 1244 1245 <Definition> :: 1248 1285 <Attribute> :: 1248 1253 <VOID> :: 1248 1251 <Identifier> :: 1254 1267 <Ident> :: 1254 1256 <Expression> :: 1271 1277 <Sequence> :: 1271 1277 <Prefix> :: 1271 1277 <Suffix> :: 1271 1277 <Primary> :: 1271 1277 <Class> :: 1271 1277 <Range> :: 1272 1273 <Char> :: 1272 1273 <CharSpecial> :: 1272 1273 <Range> :: 1274 1275 <Char> :: 1274 1275 <CharSpecial> :: 1274 1275 <Definition> :: 1286 1331 <Identifier> :: 1286 1299 <Ident> :: 1286 1295 <Expression> :: 1303 1329 <Sequence> :: 1303 1329 <Prefix> :: 1303 1311 <Suffix> :: 1303 1311 <Primary> :: 1303 1311 <Identifier> :: 1303 1311 <Ident> :: 1303 1310 <Prefix> :: 1312 1329 <Suffix> :: 1312 1329 <Primary> :: 1312 1327 <Expression> :: 1313 1326 <Sequence> :: 1313 1326 <Prefix> :: 1313 1318 <Suffix> :: 1313 1318 <Primary> :: 1313 1318 <Identifier> :: 1313 1318 <Ident> :: 1313 1317 <Prefix> :: 1319 1326 <Suffix> :: 1319 1326 <Primary> :: 1319 1326 <Identifier> :: 1319 1326 <Ident> :: 1319 1326 <STAR> :: 1328 1329 <Definition> :: 1332 1400 <Attribute> :: 1332 1337 <VOID> :: 1332 1335 <Identifier> :: 1338 1351 <Ident> :: 1338 1342 <Expression> :: 1355 1392 <Sequence> :: 1355 1392 <Prefix> :: 1355 1360 <Suffix> :: 1355 1360 <Primary> :: 1355 1360 <Literal> :: 1355 1360 <Char> :: 1356 1356 <CharUnescaped> :: 1356 1356 <Char> :: 1357 1357 <CharUnescaped> :: 1357 1357 <Char> :: 1358 1358 <CharUnescaped> :: 1358 1358 <Prefix> :: 1361 1371 <Suffix> :: 1361 1371 <Primary> :: 1361 1371 <Identifier> :: 1361 1371 <Ident> :: 1361 1370 <Prefix> :: 1372 1381 <Suffix> :: 1372 1381 <Primary> :: 1372 1381 <Identifier> :: 1372 1381 <Ident> :: 1372 1380 <Prefix> :: 1382 1392 <Suffix> :: 1382 1392 <Primary> :: 1382 1392 <Identifier> :: 1382 1392 <Ident> :: 1382 1391 <Definition> :: 1401 1459 <Identifier> :: 1401 1414 <Ident> :: 1401 1407 <Expression> :: 1418 1457 <Sequence> :: 1418 1457 <Prefix> :: 1418 1428 <Suffix> :: 1418 1428 <Primary> :: 1418 1428 <Identifier> :: 1418 1428 <Ident> :: 1418 1427 <Prefix> :: 1429 1435 <Suffix> :: 1429 1435 <Primary> :: 1429 1435 <Identifier> :: 1429 1435 <Ident> :: 1429 1434 <Prefix> :: 1436 1447 <Suffix> :: 1436 1447 <Primary> :: 1436 1445 <Identifier> :: 1436 1445 <Ident> :: 1436 1445 <STAR> :: 1446 1447 <Prefix> :: 1448 1453 <Suffix> :: 1448 1453 <Primary> :: 1448 1453 <Identifier> :: 1448 1453 <Ident> :: 1448 1452 <Prefix> :: 1454 1457 <Suffix> :: 1454 1457 <Primary> :: 1454 1457 <Identifier> :: 1454 1457 <Ident> :: 1454 1456 <Definition> :: 1460 1511 <Attribute> :: 1460 1465 <LEAF> :: 1460 1463 <Identifier> :: 1466 1479 <Ident> :: 1466 1470 <Expression> :: 1483 1503 <Sequence> :: 1483 1503 <Prefix> :: 1483 1492 <Suffix> :: 1483 1492 <Primary> :: 1483 1492 <Literal> :: 1483 1492 <Char> :: 1484 1484 <CharUnescaped> :: 1484 1484 <Char> :: 1485 1485 <CharUnescaped> :: 1485 1485 <Char> :: 1486 1486 <CharUnescaped> :: 1486 1486 <Char> :: 1487 1487 <CharUnescaped> :: 1487 1487 <Char> :: 1488 1488 <CharUnescaped> :: 1488 1488 <Char> :: 1489 1489 <CharUnescaped> :: 1489 1489 <Char> :: 1490 1490 <CharUnescaped> :: 1490 1490 <Prefix> :: 1493 1503 <Suffix> :: 1493 1503 <Primary> :: 1493 1503 <Identifier> :: 1493 1503 <Ident> :: 1493 1502 <Definition> :: 1512 1555 <Identifier> :: 1512 1525 <Ident> :: 1512 1517 <Expression> :: 1529 1553 <Sequence> :: 1529 1553 <Prefix> :: 1529 1532 <Suffix> :: 1529 1532 <Primary> :: 1529 1532 <Identifier> :: 1529 1532 <Ident> :: 1529 1531 <Prefix> :: 1533 1543 <Suffix> :: 1533 1543 <Primary> :: 1533 1543 <Identifier> :: 1533 1543 <Ident> :: 1533 1542 <Prefix> :: 1544 1553 <Suffix> :: 1544 1553 <Primary> :: 1544 1553 <Identifier> :: 1544 1553 <Ident> :: 1544 1552 <Definition> :: 1556 1621 <Attribute> :: 1556 1561 <LEAF> :: 1556 1559 <Identifier> :: 1562 1575 <Ident> :: 1562 1566 <Expression> :: 1579 1613 <Sequence> :: 1579 1613 <Prefix> :: 1579 1595 <Suffix> :: 1579 1595 <Primary> :: 1579 1595 <Expression> :: 1580 1593 <Sequence> :: 1580 1584 <Prefix> :: 1580 1584 <Suffix> :: 1580 1584 <Primary> :: 1580 1584 <Class> :: 1580 1584 <Range> :: 1581 1581 <Char> :: 1581 1581 <CharUnescaped> :: 1581 1581 <Range> :: 1582 1582 <Char> :: 1582 1582 <CharUnescaped> :: 1582 1582 <Sequence> :: 1587 1593 <Prefix> :: 1587 1593 <Suffix> :: 1587 1593 <Primary> :: 1587 1593 <ALPHA> :: 1587 1593 <Prefix> :: 1596 1613 <Suffix> :: 1596 1613 <Primary> :: 1596 1611 <Expression> :: 1597 1610 <Sequence> :: 1597 1601 <Prefix> :: 1597 1601 <Suffix> :: 1597 1601 <Primary> :: 1597 1601 <Class> :: 1597 1601 <Range> :: 1598 1598 <Char> :: 1598 1598 <CharUnescaped> :: 1598 1598 <Range> :: 1599 1599 <Char> :: 1599 1599 <CharUnescaped> :: 1599 1599 <Sequence> :: 1604 1610 <Prefix> :: 1604 1610 <Suffix> :: 1604 1610 <Primary> :: 1604 1610 <ALNUM> :: 1604 1610 <STAR> :: 1612 1613 <Definition> :: 1622 1657 <Identifier> :: 1622 1635 <Ident> :: 1622 1631 <Expression> :: 1639 1655 <Sequence> :: 1639 1655 <Prefix> :: 1639 1644 <Suffix> :: 1639 1644 <Primary> :: 1639 1644 <Identifier> :: 1639 1644 <Ident> :: 1639 1643 <Prefix> :: 1645 1655 <Suffix> :: 1645 1655 <Primary> :: 1645 1655 <Identifier> :: 1645 1655 <Ident> :: 1645 1654 <Definition> :: 1658 1698 <Attribute> :: 1658 1663 <VOID> :: 1658 1661 <Identifier> :: 1664 1677 <Ident> :: 1664 1665 <Expression> :: 1681 1696 <Sequence> :: 1681 1696 <Prefix> :: 1681 1685 <Suffix> :: 1681 1685 <Primary> :: 1681 1685 <Literal> :: 1681 1685 <Char> :: 1682 1682 <CharUnescaped> :: 1682 1682 <Char> :: 1683 1683 <CharUnescaped> :: 1683 1683 <Prefix> :: 1686 1696 <Suffix> :: 1686 1696 <Primary> :: 1686 1696 <Identifier> :: 1686 1696 <Ident> :: 1686 1695 <Definition> :: 1699 1747 <Attribute> :: 1699 1704 <LEAF> :: 1699 1702 <Identifier> :: 1705 1718 <Ident> :: 1705 1708 <Expression> :: 1722 1739 <Sequence> :: 1722 1739 <Prefix> :: 1722 1728 <Suffix> :: 1722 1728 <Primary> :: 1722 1728 <Literal> :: 1722 1728 <Char> :: 1723 1723 <CharUnescaped> :: 1723 1723 <Char> :: 1724 1724 <CharUnescaped> :: 1724 1724 <Char> :: 1725 1725 <CharUnescaped> :: 1725 1725 <Char> :: 1726 1726 <CharUnescaped> :: 1726 1726 <Prefix> :: 1729 1739 <Suffix> :: 1729 1739 <Primary> :: 1729 1739 <Identifier> :: 1729 1739 <Ident> :: 1729 1738 <Definition> :: 1748 1871 <Identifier> :: 1748 1761 <Ident> :: 1748 1754 <Expression> :: 1765 1869 <Sequence> :: 1765 1814 <Prefix> :: 1765 1774 <Suffix> :: 1765 1774 <Primary> :: 1765 1774 <Identifier> :: 1765 1774 <Ident> :: 1765 1773 <Prefix> :: 1775 1793 <Suffix> :: 1775 1793 <Primary> :: 1775 1791 <Expression> :: 1776 1790 <Sequence> :: 1776 1790 <Prefix> :: 1776 1786 <NOT> :: 1776 1776 <Suffix> :: 1777 1786 <Primary> :: 1777 1786 <Identifier> :: 1777 1786 <Ident> :: 1777 1785 <Prefix> :: 1787 1790 <Suffix> :: 1787 1790 <Primary> :: 1787 1790 <Identifier> :: 1787 1790 <Ident> :: 1787 1790 <STAR> :: 1792 1793 <Prefix> :: 1794 1803 <Suffix> :: 1794 1803 <Primary> :: 1794 1803 <Identifier> :: 1794 1803 <Ident> :: 1794 1802 <Prefix> :: 1804 1814 <Suffix> :: 1804 1814 <Primary> :: 1804 1814 <Identifier> :: 1804 1814 <Ident> :: 1804 1813 <Sequence> :: 1817 1869 <Prefix> :: 1817 1827 <Suffix> :: 1817 1827 <Primary> :: 1817 1827 <Identifier> :: 1817 1827 <Ident> :: 1817 1826 <Prefix> :: 1828 1847 <Suffix> :: 1828 1847 <Primary> :: 1828 1845 <Expression> :: 1829 1844 <Sequence> :: 1829 1844 <Prefix> :: 1829 1840 <NOT> :: 1829 1829 <Suffix> :: 1830 1840 <Primary> :: 1830 1840 <Identifier> :: 1830 1840 <Ident> :: 1830 1839 <Prefix> :: 1841 1844 <Suffix> :: 1841 1844 <Primary> :: 1841 1844 <Identifier> :: 1841 1844 <Ident> :: 1841 1844 <STAR> :: 1846 1847 <Prefix> :: 1848 1858 <Suffix> :: 1848 1858 <Primary> :: 1848 1858 <Identifier> :: 1848 1858 <Ident> :: 1848 1857 <Prefix> :: 1859 1869 <Suffix> :: 1859 1869 <Primary> :: 1859 1869 <Identifier> :: 1859 1869 <Ident> :: 1859 1868 <Definition> :: 1872 1917 <Attribute> :: 1872 1877 <LEAF> :: 1872 1875 <Identifier> :: 1878 1891 <Ident> :: 1878 1882 <Expression> :: 1895 1915 <Sequence> :: 1895 1915 <Prefix> :: 1895 1904 <Suffix> :: 1895 1904 <Primary> :: 1895 1904 <Literal> :: 1895 1904 <Char> :: 1896 1896 <CharUnescaped> :: 1896 1896 <Char> :: 1897 1897 <CharUnescaped> :: 1897 1897 <Char> :: 1898 1898 <CharUnescaped> :: 1898 1898 <Char> :: 1899 1899 <CharUnescaped> :: 1899 1899 <Char> :: 1900 1900 <CharUnescaped> :: 1900 1900 <Char> :: 1901 1901 <CharUnescaped> :: 1901 1901 <Char> :: 1902 1902 <CharUnescaped> :: 1902 1902 <Prefix> :: 1905 1915 <Suffix> :: 1905 1915 <Primary> :: 1905 1915 <Identifier> :: 1905 1915 <Ident> :: 1905 1914 <Definition> :: 1918 1957 <Attribute> :: 1918 1923 <LEAF> :: 1918 1921 <Identifier> :: 1924 1937 <Ident> :: 1924 1926 <Expression> :: 1941 1955 <Sequence> :: 1941 1955 <Prefix> :: 1941 1944 <Suffix> :: 1941 1944 <Primary> :: 1941 1944 <Literal> :: 1941 1944 <Char> :: 1942 1942 <CharUnescaped> :: 1942 1942 <Prefix> :: 1945 1955 <Suffix> :: 1945 1955 <Primary> :: 1945 1955 <Identifier> :: 1945 1955 <Ident> :: 1945 1954 <Definition> :: 1958 1997 <Attribute> :: 1958 1963 <VOID> :: 1958 1961 <Identifier> :: 1964 1977 <Ident> :: 1964 1967 <Expression> :: 1981 1995 <Sequence> :: 1981 1995 <Prefix> :: 1981 1984 <Suffix> :: 1981 1984 <Primary> :: 1981 1984 <Literal> :: 1981 1984 <Char> :: 1982 1982 <CharUnescaped> :: 1982 1982 <Prefix> :: 1985 1995 <Suffix> :: 1985 1995 <Primary> :: 1985 1995 <Identifier> :: 1985 1995 <Ident> :: 1985 1994 <Definition> :: 1998 2027 <Attribute> :: 1998 2003 <VOID> :: 1998 2001 <Identifier> :: 2004 2017 <Ident> :: 2004 2008 <Expression> :: 2021 2025 <Sequence> :: 2021 2025 <Prefix> :: 2021 2025 <Suffix> :: 2021 2025 <Primary> :: 2021 2025 <Literal> :: 2021 2025 <Char> :: 2022 2023 <CharSpecial> :: 2022 2023 <Definition> :: 2028 2087 <Attribute> :: 2028 2033 <VOID> :: 2028 2031 <Identifier> :: 2034 2047 <Ident> :: 2034 2036 <Expression> :: 2051 2085 <Sequence> :: 2051 2085 <Prefix> :: 2051 2056 <Suffix> :: 2051 2056 <Primary> :: 2051 2056 <Literal> :: 2051 2056 <Char> :: 2052 2052 <CharUnescaped> :: 2052 2052 <Char> :: 2053 2053 <CharUnescaped> :: 2053 2053 <Char> :: 2054 2054 <CharUnescaped> :: 2054 2054 <Prefix> :: 2057 2074 <NOT> :: 2057 2057 <Suffix> :: 2058 2074 <Primary> :: 2058 2074 <Expression> :: 2059 2072 <Sequence> :: 2059 2063 <Prefix> :: 2059 2063 <Suffix> :: 2059 2063 <Primary> :: 2059 2063 <Class> :: 2059 2063 <Range> :: 2060 2060 <Char> :: 2060 2060 <CharUnescaped> :: 2060 2060 <Range> :: 2061 2061 <Char> :: 2061 2061 <CharUnescaped> :: 2061 2061 <Sequence> :: 2066 2072 <Prefix> :: 2066 2072 <Suffix> :: 2066 2072 <Primary> :: 2066 2072 <ALNUM> :: 2066 2072 <Prefix> :: 2075 2085 <Suffix> :: 2075 2085 <Primary> :: 2075 2085 <Identifier> :: 2075 2085 <Ident> :: 2075 2084 <Definition> :: 2088 2133 <Attribute> :: 2088 2093 <LEAF> :: 2088 2091 <Identifier> :: 2094 2107 <Ident> :: 2094 2097 <Expression> :: 2111 2125 <Sequence> :: 2111 2125 <Prefix> :: 2111 2114 <Suffix> :: 2111 2114 <Primary> :: 2111 2114 <Literal> :: 2111 2114 <Char> :: 2112 2112 <CharUnescaped> :: 2112 2112 <Prefix> :: 2115 2125 <Suffix> :: 2115 2125 <Primary> :: 2115 2125 <Identifier> :: 2115 2125 <Ident> :: 2115 2124 <Definition> :: 2134 2178 <Identifier> :: 2134 2147 <Ident> :: 2134 2139 <Expression> :: 2151 2170 <Sequence> :: 2151 2170 <Prefix> :: 2151 2163 <Suffix> :: 2151 2163 <Primary> :: 2151 2161 <Expression> :: 2152 2160 <Sequence> :: 2152 2155 <Prefix> :: 2152 2155 <Suffix> :: 2152 2155 <Primary> :: 2152 2155 <Identifier> :: 2152 2155 <Ident> :: 2152 2154 <Sequence> :: 2158 2160 <Prefix> :: 2158 2160 <Suffix> :: 2158 2160 <Primary> :: 2158 2160 <Identifier> :: 2158 2160 <Ident> :: 2158 2160 <QUESTION> :: 2162 2163 <Prefix> :: 2164 2170 <Suffix> :: 2164 2170 <Primary> :: 2164 2170 <Identifier> :: 2164 2170 <Ident> :: 2164 2169 <Definition> :: 2179 2379 <Identifier> :: 2179 2192 <Ident> :: 2179 2185 <Expression> :: 2196 2377 <Sequence> :: 2196 2201 <Prefix> :: 2196 2201 <Suffix> :: 2196 2201 <Primary> :: 2196 2201 <Identifier> :: 2196 2201 <Ident> :: 2196 2200 <Sequence> :: 2204 2209 <Prefix> :: 2204 2209 <Suffix> :: 2204 2209 <Primary> :: 2204 2209 <Identifier> :: 2204 2209 <Ident> :: 2204 2208 <Sequence> :: 2212 2217 <Prefix> :: 2212 2217 <Suffix> :: 2212 2217 <Primary> :: 2212 2217 <Identifier> :: 2212 2217 <Ident> :: 2212 2216 <Sequence> :: 2220 2227 <Prefix> :: 2220 2227 <Suffix> :: 2220 2227 <Primary> :: 2220 2227 <Identifier> :: 2220 2227 <Ident> :: 2220 2226 <Sequence> :: 2230 2236 <Prefix> :: 2230 2236 <Suffix> :: 2230 2236 <Primary> :: 2230 2236 <Identifier> :: 2230 2236 <Ident> :: 2230 2235 <Sequence> :: 2239 2244 <Prefix> :: 2239 2244 <Suffix> :: 2239 2244 <Primary> :: 2239 2244 <Identifier> :: 2239 2244 <Ident> :: 2239 2243 <Sequence> :: 2247 2252 <Prefix> :: 2247 2252 <Suffix> :: 2247 2252 <Primary> :: 2247 2252 <Identifier> :: 2247 2252 <Ident> :: 2247 2251 <Sequence> :: 2255 2260 <Prefix> :: 2255 2260 <Suffix> :: 2255 2260 <Primary> :: 2255 2260 <Identifier> :: 2255 2260 <Ident> :: 2255 2259 <Sequence> :: 2263 2272 <Prefix> :: 2263 2272 <Suffix> :: 2263 2272 <Primary> :: 2263 2272 <Identifier> :: 2263 2272 <Ident> :: 2263 2271 <Sequence> :: 2275 2280 <Prefix> :: 2275 2280 <Suffix> :: 2275 2280 <Primary> :: 2275 2280 <Identifier> :: 2275 2280 <Ident> :: 2275 2279 <Sequence> :: 2283 2288 <Prefix> :: 2283 2288 <Suffix> :: 2283 2288 <Primary> :: 2283 2288 <Identifier> :: 2283 2288 <Ident> :: 2283 2287 <Sequence> :: 2291 2296 <Prefix> :: 2291 2296 <Suffix> :: 2291 2296 <Primary> :: 2291 2296 <Identifier> :: 2291 2296 <Ident> :: 2291 2295 <Sequence> :: 2299 2307 <Prefix> :: 2299 2307 <Suffix> :: 2299 2307 <Primary> :: 2299 2307 <Identifier> :: 2299 2307 <Ident> :: 2299 2306 <Sequence> :: 2310 2316 <Prefix> :: 2310 2316 <Suffix> :: 2310 2316 <Primary> :: 2310 2316 <Identifier> :: 2310 2316 <Ident> :: 2310 2315 <Sequence> :: 2319 2329 <Prefix> :: 2319 2329 <Suffix> :: 2319 2329 <Primary> :: 2319 2329 <Identifier> :: 2319 2329 <Ident> :: 2319 2328 <Sequence> :: 2332 2353 <Prefix> :: 2332 2336 <Suffix> :: 2332 2336 <Primary> :: 2332 2336 <Identifier> :: 2332 2336 <Ident> :: 2332 2335 <Prefix> :: 2337 2347 <Suffix> :: 2337 2347 <Primary> :: 2337 2347 <Identifier> :: 2337 2347 <Ident> :: 2337 2346 <Prefix> :: 2348 2353 <Suffix> :: 2348 2353 <Primary> :: 2348 2353 <Identifier> :: 2348 2353 <Ident> :: 2348 2352 <Sequence> :: 2356 2363 <Prefix> :: 2356 2363 <Suffix> :: 2356 2363 <Primary> :: 2356 2363 <Identifier> :: 2356 2363 <Ident> :: 2356 2362 <Sequence> :: 2366 2371 <Prefix> :: 2366 2371 <Suffix> :: 2366 2371 <Primary> :: 2366 2371 <Identifier> :: 2366 2371 <Ident> :: 2366 2370 <Sequence> :: 2374 2377 <Prefix> :: 2374 2377 <Suffix> :: 2374 2377 <Primary> :: 2374 2377 <Identifier> :: 2374 2377 <Ident> :: 2374 2376 <Definition> :: 2380 2425 <Attribute> :: 2380 2385 <LEAF> :: 2380 2383 <Identifier> :: 2386 2399 <Ident> :: 2386 2394 <Expression> :: 2403 2423 <Sequence> :: 2403 2423 <Prefix> :: 2403 2412 <Suffix> :: 2403 2412 <Primary> :: 2403 2412 <Literal> :: 2403 2412 <Char> :: 2404 2404 <CharUnescaped> :: 2404 2404 <Char> :: 2405 2405 <CharUnescaped> :: 2405 2405 <Char> :: 2406 2406 <CharUnescaped> :: 2406 2406 <Char> :: 2407 2407 <CharUnescaped> :: 2407 2407 <Char> :: 2408 2408 <CharUnescaped> :: 2408 2408 <Char> :: 2409 2409 <CharUnescaped> :: 2409 2409 <Char> :: 2410 2410 <CharUnescaped> :: 2410 2410 <Prefix> :: 2413 2423 <Suffix> :: 2413 2423 <Primary> :: 2413 2423 <Identifier> :: 2413 2423 <Ident> :: 2413 2422 <Definition> :: 2426 2471 <Attribute> :: 2426 2431 <LEAF> :: 2426 2429 <Identifier> :: 2432 2445 <Ident> :: 2432 2436 <Expression> :: 2449 2469 <Sequence> :: 2449 2469 <Prefix> :: 2449 2458 <Suffix> :: 2449 2458 <Primary> :: 2449 2458 <Literal> :: 2449 2458 <Char> :: 2450 2450 <CharUnescaped> :: 2450 2450 <Char> :: 2451 2451 <CharUnescaped> :: 2451 2451 <Char> :: 2452 2452 <CharUnescaped> :: 2452 2452 <Char> :: 2453 2453 <CharUnescaped> :: 2453 2453 <Char> :: 2454 2454 <CharUnescaped> :: 2454 2454 <Char> :: 2455 2455 <CharUnescaped> :: 2455 2455 <Char> :: 2456 2456 <CharUnescaped> :: 2456 2456 <Prefix> :: 2459 2469 <Suffix> :: 2459 2469 <Primary> :: 2459 2469 <Identifier> :: 2459 2469 <Ident> :: 2459 2468 <Definition> :: 2472 2517 <Attribute> :: 2472 2477 <LEAF> :: 2472 2475 <Identifier> :: 2478 2491 <Ident> :: 2478 2485 <Expression> :: 2495 2509 <Sequence> :: 2495 2509 <Prefix> :: 2495 2498 <Suffix> :: 2495 2498 <Primary> :: 2495 2498 <Literal> :: 2495 2498 <Char> :: 2496 2496 <CharUnescaped> :: 2496 2496 <Prefix> :: 2499 2509 <Suffix> :: 2499 2509 <Primary> :: 2499 2509 <Identifier> :: 2499 2509 <Ident> :: 2499 2508 <Definition> :: 2518 2556 <Identifier> :: 2518 2531 <Ident> :: 2518 2522 <Expression> :: 2535 2554 <Sequence> :: 2535 2547 <Prefix> :: 2535 2539 <Suffix> :: 2535 2539 <Primary> :: 2535 2539 <Identifier> :: 2535 2539 <Ident> :: 2535 2538 <Prefix> :: 2540 2542 <Suffix> :: 2540 2542 <Primary> :: 2540 2542 <Identifier> :: 2540 2542 <Ident> :: 2540 2541 <Prefix> :: 2543 2547 <Suffix> :: 2543 2547 <Primary> :: 2543 2547 <Identifier> :: 2543 2547 <Ident> :: 2543 2546 <Sequence> :: 2550 2554 <Prefix> :: 2550 2554 <Suffix> :: 2550 2554 <Primary> :: 2550 2554 <Identifier> :: 2550 2554 <Ident> :: 2550 2553 <Definition> :: 2557 2602 <Attribute> :: 2557 2562 <VOID> :: 2557 2560 <Identifier> :: 2563 2576 <Ident> :: 2563 2571 <Expression> :: 2580 2594 <Sequence> :: 2580 2594 <Prefix> :: 2580 2583 <Suffix> :: 2580 2583 <Primary> :: 2580 2583 <Literal> :: 2580 2583 <Char> :: 2581 2581 <CharUnescaped> :: 2581 2581 <Prefix> :: 2584 2594 <Suffix> :: 2584 2594 <Primary> :: 2584 2594 <Identifier> :: 2584 2594 <Ident> :: 2584 2593 <Definition> :: 2603 2629 <Identifier> :: 2603 2616 <Ident> :: 2603 2610 <Expression> :: 2620 2627 <Sequence> :: 2620 2627 <Prefix> :: 2620 2627 <Suffix> :: 2620 2627 <Primary> :: 2620 2625 <Identifier> :: 2620 2625 <Ident> :: 2620 2625 <PLUS> :: 2626 2627 <Definition> :: 2630 2669 <Attribute> :: 2630 2635 <VOID> :: 2630 2633 <Identifier> :: 2636 2649 <Ident> :: 2636 2640 <Expression> :: 2653 2667 <Sequence> :: 2653 2667 <Prefix> :: 2653 2656 <Suffix> :: 2653 2656 <Primary> :: 2653 2656 <Literal> :: 2653 2656 <Char> :: 2654 2654 <CharUnescaped> :: 2654 2654 <Prefix> :: 2657 2667 <Suffix> :: 2657 2667 <Primary> :: 2657 2667 <Identifier> :: 2657 2667 <Ident> :: 2657 2666 <Definition> :: 2670 2715 <Attribute> :: 2670 2675 <LEAF> :: 2670 2673 <Identifier> :: 2676 2689 <Ident> :: 2676 2680 <Expression> :: 2693 2713 <Sequence> :: 2693 2713 <Prefix> :: 2693 2702 <Suffix> :: 2693 2702 <Primary> :: 2693 2702 <Literal> :: 2693 2702 <Char> :: 2694 2694 <CharUnescaped> :: 2694 2694 <Char> :: 2695 2695 <CharUnescaped> :: 2695 2695 <Char> :: 2696 2696 <CharUnescaped> :: 2696 2696 <Char> :: 2697 2697 <CharUnescaped> :: 2697 2697 <Char> :: 2698 2698 <CharUnescaped> :: 2698 2698 <Char> :: 2699 2699 <CharUnescaped> :: 2699 2699 <Char> :: 2700 2700 <CharUnescaped> :: 2700 2700 <Prefix> :: 2703 2713 <Suffix> :: 2703 2713 <Primary> :: 2703 2713 <Identifier> :: 2703 2713 <Ident> :: 2703 2712 <Definition> :: 2716 2761 <Attribute> :: 2716 2721 <LEAF> :: 2716 2719 <Identifier> :: 2722 2735 <Ident> :: 2722 2725 <Expression> :: 2739 2753 <Sequence> :: 2739 2753 <Prefix> :: 2739 2742 <Suffix> :: 2739 2742 <Primary> :: 2739 2742 <Literal> :: 2739 2742 <Char> :: 2740 2740 <CharUnescaped> :: 2740 2740 <Prefix> :: 2743 2753 <Suffix> :: 2743 2753 <Primary> :: 2743 2753 <Identifier> :: 2743 2753 <Ident> :: 2743 2752 <Definition> :: 2762 2808 <Identifier> :: 2762 2775 <Ident> :: 2762 2770 <Expression> :: 2779 2800 <Sequence> :: 2779 2800 <Prefix> :: 2779 2783 <Suffix> :: 2779 2783 <Primary> :: 2779 2783 <Identifier> :: 2779 2783 <Ident> :: 2779 2782 <Prefix> :: 2784 2794 <Suffix> :: 2784 2794 <Primary> :: 2784 2794 <Identifier> :: 2784 2794 <Ident> :: 2784 2793 <Prefix> :: 2795 2800 <Suffix> :: 2795 2800 <Primary> :: 2795 2800 <Identifier> :: 2795 2800 <Ident> :: 2795 2799 <Definition> :: 2809 2861 <Identifier> :: 2809 2822 <Ident> :: 2809 2814 <Expression> :: 2826 2859 <Sequence> :: 2826 2859 <Prefix> :: 2826 2833 <Suffix> :: 2826 2833 <Primary> :: 2826 2833 <Identifier> :: 2826 2833 <Ident> :: 2826 2832 <Prefix> :: 2834 2859 <Suffix> :: 2834 2859 <Primary> :: 2834 2857 <Expression> :: 2835 2856 <Sequence> :: 2835 2843 <Prefix> :: 2835 2843 <Suffix> :: 2835 2843 <Primary> :: 2835 2843 <Identifier> :: 2835 2843 <Ident> :: 2835 2842 <Sequence> :: 2846 2850 <Prefix> :: 2846 2850 <Suffix> :: 2846 2850 <Primary> :: 2846 2850 <Identifier> :: 2846 2850 <Ident> :: 2846 2849 <Sequence> :: 2853 2856 <Prefix> :: 2853 2856 <Suffix> :: 2853 2856 <Primary> :: 2853 2856 <Identifier> :: 2853 2856 <Ident> :: 2853 2856 <QUESTION> :: 2858 2859 <Definition> :: 2862 2890 <Attribute> :: 2862 2867 <VOID> :: 2862 2865 <Identifier> :: 2868 2881 <Ident> :: 2868 2869 <Expression> :: 2885 2888 <Sequence> :: 2885 2888 <Prefix> :: 2885 2888 <Suffix> :: 2885 2888 <Primary> :: 2885 2888 <Literal> :: 2885 2888 <Char> :: 2886 2886 <CharUnescaped> :: 2886 2886 <Definition> :: 2891 2936 <Attribute> :: 2891 2896 <LEAF> :: 2891 2894 <Identifier> :: 2897 2910 <Ident> :: 2897 2901 <Expression> :: 2914 2934 <Sequence> :: 2914 2934 <Prefix> :: 2914 2923 <Suffix> :: 2914 2923 <Primary> :: 2914 2923 <Literal> :: 2914 2923 <Char> :: 2915 2915 <CharUnescaped> :: 2915 2915 <Char> :: 2916 2916 <CharUnescaped> :: 2916 2916 <Char> :: 2917 2917 <CharUnescaped> :: 2917 2917 <Char> :: 2918 2918 <CharUnescaped> :: 2918 2918 <Char> :: 2919 2919 <CharUnescaped> :: 2919 2919 <Char> :: 2920 2920 <CharUnescaped> :: 2920 2920 <Char> :: 2921 2921 <CharUnescaped> :: 2921 2921 <Prefix> :: 2924 2934 <Suffix> :: 2924 2934 <Primary> :: 2924 2934 <Identifier> :: 2924 2934 <Ident> :: 2924 2933 <Definition> :: 2937 2979 <Attribute> :: 2937 2942 <LEAF> :: 2937 2940 <Identifier> :: 2943 2956 <Ident> :: 2943 2946 <Expression> :: 2960 2977 <Sequence> :: 2960 2977 <Prefix> :: 2960 2966 <Suffix> :: 2960 2966 <Primary> :: 2960 2966 <Literal> :: 2960 2966 <Char> :: 2961 2961 <CharUnescaped> :: 2961 2961 <Char> :: 2962 2962 <CharUnescaped> :: 2962 2962 <Char> :: 2963 2963 <CharUnescaped> :: 2963 2963 <Char> :: 2964 2964 <CharUnescaped> :: 2964 2964 <Prefix> :: 2967 2977 <Suffix> :: 2967 2977 <Primary> :: 2967 2977 <Identifier> :: 2967 2977 <Ident> :: 2967 2976 <Definition> :: 2980 3025 <Attribute> :: 2980 2985 <VOID> :: 2980 2983 <Identifier> :: 2986 2999 <Ident> :: 2986 2995 <Expression> :: 3003 3023 <Sequence> :: 3003 3023 <Prefix> :: 3003 3023 <Suffix> :: 3003 3023 <Primary> :: 3003 3021 <Expression> :: 3004 3020 <Sequence> :: 3004 3011 <Prefix> :: 3004 3011 <Suffix> :: 3004 3011 <Primary> :: 3004 3011 <SPACE> :: 3004 3011 <Sequence> :: 3014 3020 <Prefix> :: 3014 3020 <Suffix> :: 3014 3020 <Primary> :: 3014 3020 <Identifier> :: 3014 3020 <Ident> :: 3014 3020 <STAR> :: 3022 3023 <Definition> :: 3026 3074 <Attribute> :: 3026 3031 <LEAF> :: 3026 3029 <Identifier> :: 3032 3045 <Ident> :: 3032 3039 <Expression> :: 3049 3072 <Sequence> :: 3049 3072 <Prefix> :: 3049 3061 <Suffix> :: 3049 3061 <Primary> :: 3049 3061 <Literal> :: 3049 3061 <Char> :: 3050 3050 <CharUnescaped> :: 3050 3050 <Char> :: 3051 3051 <CharUnescaped> :: 3051 3051 <Char> :: 3052 3052 <CharUnescaped> :: 3052 3052 <Char> :: 3053 3053 <CharUnescaped> :: 3053 3053 <Char> :: 3054 3054 <CharUnescaped> :: 3054 3054 <Char> :: 3055 3055 <CharUnescaped> :: 3055 3055 <Char> :: 3056 3056 <CharUnescaped> :: 3056 3056 <Char> :: 3057 3057 <CharUnescaped> :: 3057 3057 <Char> :: 3058 3058 <CharUnescaped> :: 3058 3058 <Char> :: 3059 3059 <CharUnescaped> :: 3059 3059 <Prefix> :: 3062 3072 <Suffix> :: 3062 3072 <Primary> :: 3062 3072 <Identifier> :: 3062 3072 <Ident> :: 3062 3071 <Definition> :: 3075 3122 <Attribute> :: 3075 3080 <LEAF> :: 3075 3078 <Identifier> :: 3081 3094 <Ident> :: 3081 3086 <Expression> :: 3098 3119 <Sequence> :: 3098 3119 <Prefix> :: 3098 3108 <Suffix> :: 3098 3108 <Primary> :: 3098 3108 <Literal> :: 3098 3108 <Char> :: 3099 3099 <CharUnescaped> :: 3099 3099 <Char> :: 3100 3100 <CharUnescaped> :: 3100 3100 <Char> :: 3101 3101 <CharUnescaped> :: 3101 3101 <Char> :: 3102 3102 <CharUnescaped> :: 3102 3102 <Char> :: 3103 3103 <CharUnescaped> :: 3103 3103 <Char> :: 3104 3104 <CharUnescaped> :: 3104 3104 <Char> :: 3105 3105 <CharUnescaped> :: 3105 3105 <Char> :: 3106 3106 <CharUnescaped> :: 3106 3106 <Prefix> :: 3109 3119 <Suffix> :: 3109 3119 <Primary> :: 3109 3119 <Identifier> :: 3109 3119 <Ident> :: 3109 3118 |
Changes to modules/pt/tests/data/ok/peg_peg-ast-templated/3_peg_itself.
|
| | | 1 2 3 4 5 6 7 8 | <Grammar> :: 0 3498 <Header> :: 99 122 <Identifier> :: 103 111 <Ident> :: 103 110 <StartExpr> :: 112 122 <Expression> :: 113 119 <Sequence> :: 113 119 <Prefix> :: 113 119 |
︙ | ︙ | |||
832 833 834 835 836 837 838 | <Char> :: 1361 1361 <CharUnescaped> :: 1361 1361 <Prefix> :: 1364 1374 <Suffix> :: 1364 1374 <Primary> :: 1364 1374 <Identifier> :: 1364 1374 <Ident> :: 1364 1373 | | | | | > | | < | | | | | | | | | | | | | > | | | | | | > | < < | | | | | < | | < < < < | | > > > | | | | | | | < < | | | | | | | > > | | | | | | | > > < | | | | | | > | | | | | > | | | | | | < | | | | < < | | | | | | < < | | > > | | | | | | > > | | < < | | | | | > | | | | | | | | | | | | | < | | > > | | > | | | > | > | | > > | > | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | | | > > | | | | | < | | | | | < | | | | | | > > | | | | | | | < | < < < < | | | | < < < < | | | < | | | | > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | > | | | | | | | | | < | < | | | | < | < < | | < | | < | | | | | | | > | > > > > > | > | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < | | | < < | | | | | | | | | > > | | | > > | | | | | < | | | | | < | > | | | | | > > | | < | | | | < < < < < < | | < < < < | < | | | | | | | | < | | | > | | | | | | | < < < < < < | | < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > | | | | | | | | | | | | | < | < | < < < | < | | < | | > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | > | | | > | > | | > > | | | | | | | | > | | | | | | > | | | < | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > | | | | | < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 | <Char> :: 1361 1361 <CharUnescaped> :: 1361 1361 <Prefix> :: 1364 1374 <Suffix> :: 1364 1374 <Primary> :: 1364 1374 <Identifier> :: 1364 1374 <Ident> :: 1364 1373 <Definition> :: 1377 1404 <Attribute> :: 1377 1382 <VOID> :: 1377 1380 <Identifier> :: 1383 1396 <Ident> :: 1383 1385 <Expression> :: 1400 1402 <Sequence> :: 1400 1402 <Prefix> :: 1400 1402 <NOT> :: 1400 1400 <Suffix> :: 1401 1402 <Primary> :: 1401 1402 <DOT> :: 1401 1402 <Definition> :: 1405 1447 <Attribute> :: 1405 1410 <VOID> :: 1405 1408 <Identifier> :: 1411 1424 <Ident> :: 1411 1413 <Expression> :: 1428 1439 <Sequence> :: 1428 1432 <Prefix> :: 1428 1432 <Suffix> :: 1428 1432 <Primary> :: 1428 1432 <Literal> :: 1428 1432 <Char> :: 1429 1430 <CharSpecial> :: 1429 1430 <Sequence> :: 1435 1439 <Prefix> :: 1435 1439 <Suffix> :: 1435 1439 <Primary> :: 1435 1439 <Literal> :: 1435 1439 <Char> :: 1436 1437 <CharSpecial> :: 1436 1437 <Definition> :: 1448 1493 <Identifier> :: 1448 1461 <Ident> :: 1448 1457 <Expression> :: 1465 1491 <Sequence> :: 1465 1491 <Prefix> :: 1465 1473 <Suffix> :: 1465 1473 <Primary> :: 1465 1473 <Identifier> :: 1465 1473 <Ident> :: 1465 1472 <Prefix> :: 1474 1491 <Suffix> :: 1474 1491 <Primary> :: 1474 1489 <Expression> :: 1475 1488 <Sequence> :: 1475 1488 <Prefix> :: 1475 1480 <Suffix> :: 1475 1480 <Primary> :: 1475 1480 <Identifier> :: 1475 1480 <Ident> :: 1475 1479 <Prefix> :: 1481 1488 <Suffix> :: 1481 1488 <Primary> :: 1481 1488 <Identifier> :: 1481 1488 <Ident> :: 1481 1488 <STAR> :: 1490 1491 <Definition> :: 1494 1568 <Attribute> :: 1494 1499 <VOID> :: 1494 1497 <Identifier> :: 1500 1513 <Ident> :: 1500 1504 <Expression> :: 1517 1560 <Sequence> :: 1517 1560 <Prefix> :: 1517 1520 <Suffix> :: 1517 1520 <Primary> :: 1517 1520 <Literal> :: 1517 1520 <Char> :: 1518 1518 <CharUnescaped> :: 1518 1518 <Prefix> :: 1521 1524 <Suffix> :: 1521 1524 <Primary> :: 1521 1524 <Literal> :: 1521 1524 <Char> :: 1522 1522 <CharUnescaped> :: 1522 1522 <Prefix> :: 1525 1528 <Suffix> :: 1525 1528 <Primary> :: 1525 1528 <Literal> :: 1525 1528 <Char> :: 1526 1526 <CharUnescaped> :: 1526 1526 <Prefix> :: 1529 1539 <Suffix> :: 1529 1539 <Primary> :: 1529 1539 <Identifier> :: 1529 1539 <Ident> :: 1529 1538 <Prefix> :: 1540 1549 <Suffix> :: 1540 1549 <Primary> :: 1540 1549 <Identifier> :: 1540 1549 <Ident> :: 1540 1548 <Prefix> :: 1550 1560 <Suffix> :: 1550 1560 <Primary> :: 1550 1560 <Identifier> :: 1550 1560 <Ident> :: 1550 1559 <Definition> :: 1569 1627 <Identifier> :: 1569 1582 <Ident> :: 1569 1575 <Expression> :: 1586 1625 <Sequence> :: 1586 1625 <Prefix> :: 1586 1596 <Suffix> :: 1586 1596 <Primary> :: 1586 1596 <Identifier> :: 1586 1596 <Ident> :: 1586 1595 <Prefix> :: 1597 1603 <Suffix> :: 1597 1603 <Primary> :: 1597 1603 <Identifier> :: 1597 1603 <Ident> :: 1597 1602 <Prefix> :: 1604 1615 <Suffix> :: 1604 1615 <Primary> :: 1604 1613 <Identifier> :: 1604 1613 <Ident> :: 1604 1613 <STAR> :: 1614 1615 <Prefix> :: 1616 1621 <Suffix> :: 1616 1621 <Primary> :: 1616 1621 <Identifier> :: 1616 1621 <Ident> :: 1616 1620 <Prefix> :: 1622 1625 <Suffix> :: 1622 1625 <Primary> :: 1622 1625 <Identifier> :: 1622 1625 <Ident> :: 1622 1624 <Definition> :: 1628 1697 <Attribute> :: 1628 1633 <LEAF> :: 1628 1631 <Identifier> :: 1634 1647 <Ident> :: 1634 1638 <Expression> :: 1651 1689 <Sequence> :: 1651 1689 <Prefix> :: 1651 1654 <Suffix> :: 1651 1654 <Primary> :: 1651 1654 <Literal> :: 1651 1654 <Char> :: 1652 1652 <CharUnescaped> :: 1652 1652 <Prefix> :: 1655 1658 <Suffix> :: 1655 1658 <Primary> :: 1655 1658 <Literal> :: 1655 1658 <Char> :: 1656 1656 <CharUnescaped> :: 1656 1656 <Prefix> :: 1659 1662 <Suffix> :: 1659 1662 <Primary> :: 1659 1662 <Literal> :: 1659 1662 <Char> :: 1660 1660 <CharUnescaped> :: 1660 1660 <Prefix> :: 1663 1666 <Suffix> :: 1663 1666 <Primary> :: 1663 1666 <Literal> :: 1663 1666 <Char> :: 1664 1664 <CharUnescaped> :: 1664 1664 <Prefix> :: 1667 1670 <Suffix> :: 1667 1670 <Primary> :: 1667 1670 <Literal> :: 1667 1670 <Char> :: 1668 1668 <CharUnescaped> :: 1668 1668 <Prefix> :: 1671 1674 <Suffix> :: 1671 1674 <Primary> :: 1671 1674 <Literal> :: 1671 1674 <Char> :: 1672 1672 <CharUnescaped> :: 1672 1672 <Prefix> :: 1675 1678 <Suffix> :: 1675 1678 <Primary> :: 1675 1678 <Literal> :: 1675 1678 <Char> :: 1676 1676 <CharUnescaped> :: 1676 1676 <Prefix> :: 1679 1689 <Suffix> :: 1679 1689 <Primary> :: 1679 1689 <Identifier> :: 1679 1689 <Ident> :: 1679 1688 <Definition> :: 1698 1741 <Identifier> :: 1698 1711 <Ident> :: 1698 1703 <Expression> :: 1715 1739 <Sequence> :: 1715 1739 <Prefix> :: 1715 1718 <Suffix> :: 1715 1718 <Primary> :: 1715 1718 <Identifier> :: 1715 1718 <Ident> :: 1715 1717 <Prefix> :: 1719 1729 <Suffix> :: 1719 1729 <Primary> :: 1719 1729 <Identifier> :: 1719 1729 <Ident> :: 1719 1728 <Prefix> :: 1730 1739 <Suffix> :: 1730 1739 <Primary> :: 1730 1739 <Identifier> :: 1730 1739 <Ident> :: 1730 1738 <Definition> :: 1742 1817 <Attribute> :: 1742 1747 <LEAF> :: 1742 1745 <Identifier> :: 1748 1761 <Ident> :: 1748 1752 <Expression> :: 1765 1809 <Sequence> :: 1765 1809 <Prefix> :: 1765 1786 <Suffix> :: 1765 1786 <Primary> :: 1765 1786 <Expression> :: 1766 1784 <Sequence> :: 1766 1769 <Prefix> :: 1766 1769 <Suffix> :: 1766 1769 <Primary> :: 1766 1769 <Literal> :: 1766 1769 <Char> :: 1767 1767 <CharUnescaped> :: 1767 1767 <Sequence> :: 1772 1775 <Prefix> :: 1772 1775 <Suffix> :: 1772 1775 <Primary> :: 1772 1775 <Literal> :: 1772 1775 <Char> :: 1773 1773 <CharUnescaped> :: 1773 1773 <Sequence> :: 1778 1784 <Prefix> :: 1778 1784 <Suffix> :: 1778 1784 <Primary> :: 1778 1784 <ALPHA> :: 1778 1784 <Prefix> :: 1787 1809 <Suffix> :: 1787 1809 <Primary> :: 1787 1807 <Expression> :: 1788 1806 <Sequence> :: 1788 1791 <Prefix> :: 1788 1791 <Suffix> :: 1788 1791 <Primary> :: 1788 1791 <Literal> :: 1788 1791 <Char> :: 1789 1789 <CharUnescaped> :: 1789 1789 <Sequence> :: 1794 1797 <Prefix> :: 1794 1797 <Suffix> :: 1794 1797 <Primary> :: 1794 1797 <Literal> :: 1794 1797 <Char> :: 1795 1795 <CharUnescaped> :: 1795 1795 <Sequence> :: 1800 1806 <Prefix> :: 1800 1806 <Suffix> :: 1800 1806 <Primary> :: 1800 1806 <ALNUM> :: 1800 1806 <STAR> :: 1808 1809 <Definition> :: 1818 1853 <Identifier> :: 1818 1831 <Ident> :: 1818 1827 <Expression> :: 1835 1851 <Sequence> :: 1835 1851 <Prefix> :: 1835 1840 <Suffix> :: 1835 1840 <Primary> :: 1835 1840 <Identifier> :: 1835 1840 <Ident> :: 1835 1839 <Prefix> :: 1841 1851 <Suffix> :: 1841 1851 <Primary> :: 1841 1851 <Identifier> :: 1841 1851 <Ident> :: 1841 1850 <Definition> :: 1854 1897 <Attribute> :: 1854 1859 <VOID> :: 1854 1857 <Identifier> :: 1860 1873 <Ident> :: 1860 1861 <Expression> :: 1877 1895 <Sequence> :: 1877 1895 <Prefix> :: 1877 1880 <Suffix> :: 1877 1880 <Primary> :: 1877 1880 <Literal> :: 1877 1880 <Char> :: 1878 1878 <CharUnescaped> :: 1878 1878 <Prefix> :: 1881 1884 <Suffix> :: 1881 1884 <Primary> :: 1881 1884 <Literal> :: 1881 1884 <Char> :: 1882 1882 <CharUnescaped> :: 1882 1882 <Prefix> :: 1885 1895 <Suffix> :: 1885 1895 <Primary> :: 1885 1895 <Identifier> :: 1885 1895 <Ident> :: 1885 1894 <Definition> :: 1898 1955 <Attribute> :: 1898 1903 <LEAF> :: 1898 1901 <Identifier> :: 1904 1917 <Ident> :: 1904 1907 <Expression> :: 1921 1947 <Sequence> :: 1921 1947 <Prefix> :: 1921 1924 <Suffix> :: 1921 1924 <Primary> :: 1921 1924 <Literal> :: 1921 1924 <Char> :: 1922 1922 <CharUnescaped> :: 1922 1922 <Prefix> :: 1925 1928 <Suffix> :: 1925 1928 <Primary> :: 1925 1928 <Literal> :: 1925 1928 <Char> :: 1926 1926 <CharUnescaped> :: 1926 1926 <Prefix> :: 1929 1932 <Suffix> :: 1929 1932 <Primary> :: 1929 1932 <Literal> :: 1929 1932 <Char> :: 1930 1930 <CharUnescaped> :: 1930 1930 <Prefix> :: 1933 1936 <Suffix> :: 1933 1936 <Primary> :: 1933 1936 <Literal> :: 1933 1936 <Char> :: 1934 1934 <CharUnescaped> :: 1934 1934 <Prefix> :: 1937 1947 <Suffix> :: 1937 1947 <Primary> :: 1937 1947 <Identifier> :: 1937 1947 <Ident> :: 1937 1946 <Definition> :: 1956 2079 <Identifier> :: 1956 1969 <Ident> :: 1956 1962 <Expression> :: 1973 2077 <Sequence> :: 1973 2022 <Prefix> :: 1973 1982 <Suffix> :: 1973 1982 <Primary> :: 1973 1982 <Identifier> :: 1973 1982 <Ident> :: 1973 1981 <Prefix> :: 1983 2001 <Suffix> :: 1983 2001 <Primary> :: 1983 1999 <Expression> :: 1984 1998 <Sequence> :: 1984 1998 <Prefix> :: 1984 1994 <NOT> :: 1984 1984 <Suffix> :: 1985 1994 <Primary> :: 1985 1994 <Identifier> :: 1985 1994 <Ident> :: 1985 1993 <Prefix> :: 1995 1998 <Suffix> :: 1995 1998 <Primary> :: 1995 1998 <Identifier> :: 1995 1998 <Ident> :: 1995 1998 <STAR> :: 2000 2001 <Prefix> :: 2002 2011 <Suffix> :: 2002 2011 <Primary> :: 2002 2011 <Identifier> :: 2002 2011 <Ident> :: 2002 2010 <Prefix> :: 2012 2022 <Suffix> :: 2012 2022 <Primary> :: 2012 2022 <Identifier> :: 2012 2022 <Ident> :: 2012 2021 <Sequence> :: 2025 2077 <Prefix> :: 2025 2035 <Suffix> :: 2025 2035 <Primary> :: 2025 2035 <Identifier> :: 2025 2035 <Ident> :: 2025 2034 <Prefix> :: 2036 2055 <Suffix> :: 2036 2055 <Primary> :: 2036 2053 <Expression> :: 2037 2052 <Sequence> :: 2037 2052 <Prefix> :: 2037 2048 <NOT> :: 2037 2037 <Suffix> :: 2038 2048 <Primary> :: 2038 2048 <Identifier> :: 2038 2048 <Ident> :: 2038 2047 <Prefix> :: 2049 2052 <Suffix> :: 2049 2052 <Primary> :: 2049 2052 <Identifier> :: 2049 2052 <Ident> :: 2049 2052 <STAR> :: 2054 2055 <Prefix> :: 2056 2066 <Suffix> :: 2056 2066 <Primary> :: 2056 2066 <Identifier> :: 2056 2066 <Ident> :: 2056 2065 <Prefix> :: 2067 2077 <Suffix> :: 2067 2077 <Primary> :: 2067 2077 <Identifier> :: 2067 2077 <Ident> :: 2067 2076 <Definition> :: 2080 2143 <Attribute> :: 2080 2085 <LEAF> :: 2080 2083 <Identifier> :: 2086 2099 <Ident> :: 2086 2090 <Expression> :: 2103 2141 <Sequence> :: 2103 2141 <Prefix> :: 2103 2106 <Suffix> :: 2103 2106 <Primary> :: 2103 2106 <Literal> :: 2103 2106 <Char> :: 2104 2104 <CharUnescaped> :: 2104 2104 <Prefix> :: 2107 2110 <Suffix> :: 2107 2110 <Primary> :: 2107 2110 <Literal> :: 2107 2110 <Char> :: 2108 2108 <CharUnescaped> :: 2108 2108 <Prefix> :: 2111 2114 <Suffix> :: 2111 2114 <Primary> :: 2111 2114 <Literal> :: 2111 2114 <Char> :: 2112 2112 <CharUnescaped> :: 2112 2112 <Prefix> :: 2115 2118 <Suffix> :: 2115 2118 <Primary> :: 2115 2118 <Literal> :: 2115 2118 <Char> :: 2116 2116 <CharUnescaped> :: 2116 2116 <Prefix> :: 2119 2122 <Suffix> :: 2119 2122 <Primary> :: 2119 2122 <Literal> :: 2119 2122 <Char> :: 2120 2120 <CharUnescaped> :: 2120 2120 <Prefix> :: 2123 2126 <Suffix> :: 2123 2126 <Primary> :: 2123 2126 <Literal> :: 2123 2126 <Char> :: 2124 2124 <CharUnescaped> :: 2124 2124 <Prefix> :: 2127 2130 <Suffix> :: 2127 2130 <Primary> :: 2127 2130 <Literal> :: 2127 2130 <Char> :: 2128 2128 <CharUnescaped> :: 2128 2128 <Prefix> :: 2131 2141 <Suffix> :: 2131 2141 <Primary> :: 2131 2141 <Identifier> :: 2131 2141 <Ident> :: 2131 2140 <Definition> :: 2144 2183 <Attribute> :: 2144 2149 <LEAF> :: 2144 2147 <Identifier> :: 2150 2163 <Ident> :: 2150 2152 <Expression> :: 2167 2181 <Sequence> :: 2167 2181 <Prefix> :: 2167 2170 <Suffix> :: 2167 2170 <Primary> :: 2167 2170 <Literal> :: 2167 2170 <Char> :: 2168 2168 <CharUnescaped> :: 2168 2168 <Prefix> :: 2171 2181 <Suffix> :: 2171 2181 <Primary> :: 2171 2181 <Identifier> :: 2171 2181 <Ident> :: 2171 2180 <Definition> :: 2184 2223 <Attribute> :: 2184 2189 <VOID> :: 2184 2187 <Identifier> :: 2190 2203 <Ident> :: 2190 2193 <Expression> :: 2207 2221 <Sequence> :: 2207 2221 <Prefix> :: 2207 2210 <Suffix> :: 2207 2210 <Primary> :: 2207 2210 <Literal> :: 2207 2210 <Char> :: 2208 2208 <CharUnescaped> :: 2208 2208 <Prefix> :: 2211 2221 <Suffix> :: 2211 2221 <Primary> :: 2211 2221 <Identifier> :: 2211 2221 <Ident> :: 2211 2220 <Definition> :: 2224 2253 <Attribute> :: 2224 2229 <VOID> :: 2224 2227 <Identifier> :: 2230 2243 <Ident> :: 2230 2234 <Expression> :: 2247 2251 <Sequence> :: 2247 2251 <Prefix> :: 2247 2251 <Suffix> :: 2247 2251 <Primary> :: 2247 2251 <Literal> :: 2247 2251 <Char> :: 2248 2249 <CharSpecial> :: 2248 2249 <Definition> :: 2254 2324 <Attribute> :: 2254 2259 <VOID> :: 2254 2257 <Identifier> :: 2260 2273 <Ident> :: 2260 2262 <Expression> :: 2277 2322 <Sequence> :: 2277 2322 <Prefix> :: 2277 2280 <Suffix> :: 2277 2280 <Primary> :: 2277 2280 <Literal> :: 2277 2280 <Char> :: 2278 2278 <CharUnescaped> :: 2278 2278 <Prefix> :: 2281 2284 <Suffix> :: 2281 2284 <Primary> :: 2281 2284 <Literal> :: 2281 2284 <Char> :: 2282 2282 <CharUnescaped> :: 2282 2282 <Prefix> :: 2285 2288 <Suffix> :: 2285 2288 <Primary> :: 2285 2288 <Literal> :: 2285 2288 <Char> :: 2286 2286 <CharUnescaped> :: 2286 2286 <Prefix> :: 2289 2311 <NOT> :: 2289 2289 <Suffix> :: 2290 2311 <Primary> :: 2290 2311 <Expression> :: 2291 2309 <Sequence> :: 2291 2294 <Prefix> :: 2291 2294 <Suffix> :: 2291 2294 <Primary> :: 2291 2294 <Literal> :: 2291 2294 <Char> :: 2292 2292 <CharUnescaped> :: 2292 2292 <Sequence> :: 2297 2300 <Prefix> :: 2297 2300 <Suffix> :: 2297 2300 <Primary> :: 2297 2300 <Literal> :: 2297 2300 <Char> :: 2298 2298 <CharUnescaped> :: 2298 2298 <Sequence> :: 2303 2309 <Prefix> :: 2303 2309 <Suffix> :: 2303 2309 <Primary> :: 2303 2309 <ALNUM> :: 2303 2309 <Prefix> :: 2312 2322 <Suffix> :: 2312 2322 <Primary> :: 2312 2322 <Identifier> :: 2312 2322 <Ident> :: 2312 2321 <Definition> :: 2325 2370 <Attribute> :: 2325 2330 <LEAF> :: 2325 2328 <Identifier> :: 2331 2344 <Ident> :: 2331 2334 <Expression> :: 2348 2362 <Sequence> :: 2348 2362 <Prefix> :: 2348 2351 <Suffix> :: 2348 2351 <Primary> :: 2348 2351 <Literal> :: 2348 2351 <Char> :: 2349 2349 <CharUnescaped> :: 2349 2349 <Prefix> :: 2352 2362 <Suffix> :: 2352 2362 <Primary> :: 2352 2362 <Identifier> :: 2352 2362 <Ident> :: 2352 2361 <Definition> :: 2371 2415 <Identifier> :: 2371 2384 <Ident> :: 2371 2376 <Expression> :: 2388 2407 <Sequence> :: 2388 2407 <Prefix> :: 2388 2400 <Suffix> :: 2388 2400 <Primary> :: 2388 2398 <Expression> :: 2389 2397 <Sequence> :: 2389 2392 <Prefix> :: 2389 2392 <Suffix> :: 2389 2392 <Primary> :: 2389 2392 <Identifier> :: 2389 2392 <Ident> :: 2389 2391 <Sequence> :: 2395 2397 <Prefix> :: 2395 2397 <Suffix> :: 2395 2397 <Primary> :: 2395 2397 <Identifier> :: 2395 2397 <Ident> :: 2395 2397 <QUESTION> :: 2399 2400 <Prefix> :: 2401 2407 <Suffix> :: 2401 2407 <Primary> :: 2401 2407 <Identifier> :: 2401 2407 <Ident> :: 2401 2406 <Definition> :: 2416 2616 <Identifier> :: 2416 2429 <Ident> :: 2416 2422 <Expression> :: 2433 2614 <Sequence> :: 2433 2438 <Prefix> :: 2433 2438 <Suffix> :: 2433 2438 <Primary> :: 2433 2438 <Identifier> :: 2433 2438 <Ident> :: 2433 2437 <Sequence> :: 2441 2446 <Prefix> :: 2441 2446 <Suffix> :: 2441 2446 <Primary> :: 2441 2446 <Identifier> :: 2441 2446 <Ident> :: 2441 2445 <Sequence> :: 2449 2454 <Prefix> :: 2449 2454 <Suffix> :: 2449 2454 <Primary> :: 2449 2454 <Identifier> :: 2449 2454 <Ident> :: 2449 2453 <Sequence> :: 2457 2464 <Prefix> :: 2457 2464 <Suffix> :: 2457 2464 <Primary> :: 2457 2464 <Identifier> :: 2457 2464 <Ident> :: 2457 2463 <Sequence> :: 2467 2473 <Prefix> :: 2467 2473 <Suffix> :: 2467 2473 <Primary> :: 2467 2473 <Identifier> :: 2467 2473 <Ident> :: 2467 2472 <Sequence> :: 2476 2481 <Prefix> :: 2476 2481 <Suffix> :: 2476 2481 <Primary> :: 2476 2481 <Identifier> :: 2476 2481 <Ident> :: 2476 2480 <Sequence> :: 2484 2489 <Prefix> :: 2484 2489 <Suffix> :: 2484 2489 <Primary> :: 2484 2489 <Identifier> :: 2484 2489 <Ident> :: 2484 2488 <Sequence> :: 2492 2497 <Prefix> :: 2492 2497 <Suffix> :: 2492 2497 <Primary> :: 2492 2497 <Identifier> :: 2492 2497 <Ident> :: 2492 2496 <Sequence> :: 2500 2509 <Prefix> :: 2500 2509 <Suffix> :: 2500 2509 <Primary> :: 2500 2509 <Identifier> :: 2500 2509 <Ident> :: 2500 2508 <Sequence> :: 2512 2517 <Prefix> :: 2512 2517 <Suffix> :: 2512 2517 <Primary> :: 2512 2517 <Identifier> :: 2512 2517 <Ident> :: 2512 2516 <Sequence> :: 2520 2525 <Prefix> :: 2520 2525 <Suffix> :: 2520 2525 <Primary> :: 2520 2525 <Identifier> :: 2520 2525 <Ident> :: 2520 2524 <Sequence> :: 2528 2533 <Prefix> :: 2528 2533 <Suffix> :: 2528 2533 <Primary> :: 2528 2533 <Identifier> :: 2528 2533 <Ident> :: 2528 2532 <Sequence> :: 2536 2544 <Prefix> :: 2536 2544 <Suffix> :: 2536 2544 <Primary> :: 2536 2544 <Identifier> :: 2536 2544 <Ident> :: 2536 2543 <Sequence> :: 2547 2553 <Prefix> :: 2547 2553 <Suffix> :: 2547 2553 <Primary> :: 2547 2553 <Identifier> :: 2547 2553 <Ident> :: 2547 2552 <Sequence> :: 2556 2566 <Prefix> :: 2556 2566 <Suffix> :: 2556 2566 <Primary> :: 2556 2566 <Identifier> :: 2556 2566 <Ident> :: 2556 2565 <Sequence> :: 2569 2590 <Prefix> :: 2569 2573 <Suffix> :: 2569 2573 <Primary> :: 2569 2573 <Identifier> :: 2569 2573 <Ident> :: 2569 2572 <Prefix> :: 2574 2584 <Suffix> :: 2574 2584 <Primary> :: 2574 2584 <Identifier> :: 2574 2584 <Ident> :: 2574 2583 <Prefix> :: 2585 2590 <Suffix> :: 2585 2590 <Primary> :: 2585 2590 <Identifier> :: 2585 2590 <Ident> :: 2585 2589 <Sequence> :: 2593 2600 <Prefix> :: 2593 2600 <Suffix> :: 2593 2600 <Primary> :: 2593 2600 <Identifier> :: 2593 2600 <Ident> :: 2593 2599 <Sequence> :: 2603 2608 <Prefix> :: 2603 2608 <Suffix> :: 2603 2608 <Primary> :: 2603 2608 <Identifier> :: 2603 2608 <Ident> :: 2603 2607 <Sequence> :: 2611 2614 <Prefix> :: 2611 2614 <Suffix> :: 2611 2614 <Primary> :: 2611 2614 <Identifier> :: 2611 2614 <Ident> :: 2611 2613 <Definition> :: 2617 2680 <Attribute> :: 2617 2622 <LEAF> :: 2617 2620 <Identifier> :: 2623 2636 <Ident> :: 2623 2631 <Expression> :: 2640 2678 <Sequence> :: 2640 2678 <Prefix> :: 2640 2643 <Suffix> :: 2640 2643 <Primary> :: 2640 2643 <Literal> :: 2640 2643 <Char> :: 2641 2641 <CharUnescaped> :: 2641 2641 <Prefix> :: 2644 2647 <Suffix> :: 2644 2647 <Primary> :: 2644 2647 <Literal> :: 2644 2647 <Char> :: 2645 2645 <CharUnescaped> :: 2645 2645 <Prefix> :: 2648 2651 <Suffix> :: 2648 2651 <Primary> :: 2648 2651 <Literal> :: 2648 2651 <Char> :: 2649 2649 <CharUnescaped> :: 2649 2649 <Prefix> :: 2652 2655 <Suffix> :: 2652 2655 <Primary> :: 2652 2655 <Literal> :: 2652 2655 <Char> :: 2653 2653 <CharUnescaped> :: 2653 2653 <Prefix> :: 2656 2659 <Suffix> :: 2656 2659 <Primary> :: 2656 2659 <Literal> :: 2656 2659 <Char> :: 2657 2657 <CharUnescaped> :: 2657 2657 <Prefix> :: 2660 2663 <Suffix> :: 2660 2663 <Primary> :: 2660 2663 <Literal> :: 2660 2663 <Char> :: 2661 2661 <CharUnescaped> :: 2661 2661 <Prefix> :: 2664 2667 <Suffix> :: 2664 2667 <Primary> :: 2664 2667 <Literal> :: 2664 2667 <Char> :: 2665 2665 <CharUnescaped> :: 2665 2665 <Prefix> :: 2668 2678 <Suffix> :: 2668 2678 <Primary> :: 2668 2678 <Identifier> :: 2668 2678 <Ident> :: 2668 2677 <Definition> :: 2681 2744 <Attribute> :: 2681 2686 <LEAF> :: 2681 2684 <Identifier> :: 2687 2700 <Ident> :: 2687 2691 <Expression> :: 2704 2742 <Sequence> :: 2704 2742 <Prefix> :: 2704 2707 <Suffix> :: 2704 2707 <Primary> :: 2704 2707 <Literal> :: 2704 2707 <Char> :: 2705 2705 <CharUnescaped> :: 2705 2705 <Prefix> :: 2708 2711 <Suffix> :: 2708 2711 <Primary> :: 2708 2711 <Literal> :: 2708 2711 <Char> :: 2709 2709 <CharUnescaped> :: 2709 2709 <Prefix> :: 2712 2715 <Suffix> :: 2712 2715 <Primary> :: 2712 2715 <Literal> :: 2712 2715 <Char> :: 2713 2713 <CharUnescaped> :: 2713 2713 <Prefix> :: 2716 2719 <Suffix> :: 2716 2719 <Primary> :: 2716 2719 <Literal> :: 2716 2719 <Char> :: 2717 2717 <CharUnescaped> :: 2717 2717 <Prefix> :: 2720 2723 <Suffix> :: 2720 2723 <Primary> :: 2720 2723 <Literal> :: 2720 2723 <Char> :: 2721 2721 <CharUnescaped> :: 2721 2721 <Prefix> :: 2724 2727 <Suffix> :: 2724 2727 <Primary> :: 2724 2727 <Literal> :: 2724 2727 <Char> :: 2725 2725 <CharUnescaped> :: 2725 2725 <Prefix> :: 2728 2731 <Suffix> :: 2728 2731 <Primary> :: 2728 2731 <Literal> :: 2728 2731 <Char> :: 2729 2729 <CharUnescaped> :: 2729 2729 <Prefix> :: 2732 2742 <Suffix> :: 2732 2742 <Primary> :: 2732 2742 <Identifier> :: 2732 2742 <Ident> :: 2732 2741 <Definition> :: 2745 2790 <Attribute> :: 2745 2750 <LEAF> :: 2745 2748 <Identifier> :: 2751 2764 <Ident> :: 2751 2758 <Expression> :: 2768 2782 <Sequence> :: 2768 2782 <Prefix> :: 2768 2771 <Suffix> :: 2768 2771 <Primary> :: 2768 2771 <Literal> :: 2768 2771 <Char> :: 2769 2769 <CharUnescaped> :: 2769 2769 <Prefix> :: 2772 2782 <Suffix> :: 2772 2782 <Primary> :: 2772 2782 <Identifier> :: 2772 2782 <Ident> :: 2772 2781 <Definition> :: 2791 2829 <Identifier> :: 2791 2804 <Ident> :: 2791 2795 <Expression> :: 2808 2827 <Sequence> :: 2808 2820 <Prefix> :: 2808 2812 <Suffix> :: 2808 2812 <Primary> :: 2808 2812 <Identifier> :: 2808 2812 <Ident> :: 2808 2811 <Prefix> :: 2813 2815 <Suffix> :: 2813 2815 <Primary> :: 2813 2815 <Identifier> :: 2813 2815 <Ident> :: 2813 2814 <Prefix> :: 2816 2820 <Suffix> :: 2816 2820 <Primary> :: 2816 2820 <Identifier> :: 2816 2820 <Ident> :: 2816 2819 <Sequence> :: 2823 2827 <Prefix> :: 2823 2827 <Suffix> :: 2823 2827 <Primary> :: 2823 2827 <Identifier> :: 2823 2827 <Ident> :: 2823 2826 <Definition> :: 2830 2875 <Attribute> :: 2830 2835 <VOID> :: 2830 2833 <Identifier> :: 2836 2849 <Ident> :: 2836 2844 <Expression> :: 2853 2867 <Sequence> :: 2853 2867 <Prefix> :: 2853 2856 <Suffix> :: 2853 2856 <Primary> :: 2853 2856 <Literal> :: 2853 2856 <Char> :: 2854 2854 <CharUnescaped> :: 2854 2854 <Prefix> :: 2857 2867 <Suffix> :: 2857 2867 <Primary> :: 2857 2867 <Identifier> :: 2857 2867 <Ident> :: 2857 2866 <Definition> :: 2876 2902 <Identifier> :: 2876 2889 <Ident> :: 2876 2883 <Expression> :: 2893 2900 <Sequence> :: 2893 2900 <Prefix> :: 2893 2900 <Suffix> :: 2893 2900 <Primary> :: 2893 2898 <Identifier> :: 2893 2898 <Ident> :: 2893 2898 <PLUS> :: 2899 2900 <Definition> :: 2903 2942 <Attribute> :: 2903 2908 <VOID> :: 2903 2906 <Identifier> :: 2909 2922 <Ident> :: 2909 2913 <Expression> :: 2926 2940 <Sequence> :: 2926 2940 <Prefix> :: 2926 2929 <Suffix> :: 2926 2929 <Primary> :: 2926 2929 <Literal> :: 2926 2929 <Char> :: 2927 2927 <CharUnescaped> :: 2927 2927 <Prefix> :: 2930 2940 <Suffix> :: 2930 2940 <Primary> :: 2930 2940 <Identifier> :: 2930 2940 <Ident> :: 2930 2939 <Definition> :: 2943 3006 <Attribute> :: 2943 2948 <LEAF> :: 2943 2946 <Identifier> :: 2949 2962 <Ident> :: 2949 2953 <Expression> :: 2966 3004 <Sequence> :: 2966 3004 <Prefix> :: 2966 2969 <Suffix> :: 2966 2969 <Primary> :: 2966 2969 <Literal> :: 2966 2969 <Char> :: 2967 2967 <CharUnescaped> :: 2967 2967 <Prefix> :: 2970 2973 <Suffix> :: 2970 2973 <Primary> :: 2970 2973 <Literal> :: 2970 2973 <Char> :: 2971 2971 <CharUnescaped> :: 2971 2971 <Prefix> :: 2974 2977 <Suffix> :: 2974 2977 <Primary> :: 2974 2977 <Literal> :: 2974 2977 <Char> :: 2975 2975 <CharUnescaped> :: 2975 2975 <Prefix> :: 2978 2981 <Suffix> :: 2978 2981 <Primary> :: 2978 2981 <Literal> :: 2978 2981 <Char> :: 2979 2979 <CharUnescaped> :: 2979 2979 <Prefix> :: 2982 2985 <Suffix> :: 2982 2985 <Primary> :: 2982 2985 <Literal> :: 2982 2985 <Char> :: 2983 2983 <CharUnescaped> :: 2983 2983 <Prefix> :: 2986 2989 <Suffix> :: 2986 2989 <Primary> :: 2986 2989 <Literal> :: 2986 2989 <Char> :: 2987 2987 <CharUnescaped> :: 2987 2987 <Prefix> :: 2990 2993 <Suffix> :: 2990 2993 <Primary> :: 2990 2993 <Literal> :: 2990 2993 <Char> :: 2991 2991 <CharUnescaped> :: 2991 2991 <Prefix> :: 2994 3004 <Suffix> :: 2994 3004 <Primary> :: 2994 3004 <Identifier> :: 2994 3004 <Ident> :: 2994 3003 <Definition> :: 3007 3052 <Attribute> :: 3007 3012 <LEAF> :: 3007 3010 <Identifier> :: 3013 3026 <Ident> :: 3013 3016 <Expression> :: 3030 3044 <Sequence> :: 3030 3044 <Prefix> :: 3030 3033 <Suffix> :: 3030 3033 <Primary> :: 3030 3033 <Literal> :: 3030 3033 <Char> :: 3031 3031 <CharUnescaped> :: 3031 3031 <Prefix> :: 3034 3044 <Suffix> :: 3034 3044 <Primary> :: 3034 3044 <Identifier> :: 3034 3044 <Ident> :: 3034 3043 <Definition> :: 3053 3099 <Identifier> :: 3053 3066 <Ident> :: 3053 3061 <Expression> :: 3070 3091 <Sequence> :: 3070 3091 <Prefix> :: 3070 3074 <Suffix> :: 3070 3074 <Primary> :: 3070 3074 <Identifier> :: 3070 3074 <Ident> :: 3070 3073 <Prefix> :: 3075 3085 <Suffix> :: 3075 3085 <Primary> :: 3075 3085 <Identifier> :: 3075 3085 <Ident> :: 3075 3084 <Prefix> :: 3086 3091 <Suffix> :: 3086 3091 <Primary> :: 3086 3091 <Identifier> :: 3086 3091 <Ident> :: 3086 3090 <Definition> :: 3100 3152 <Identifier> :: 3100 3113 <Ident> :: 3100 3105 <Expression> :: 3117 3150 <Sequence> :: 3117 3150 <Prefix> :: 3117 3124 <Suffix> :: 3117 3124 <Primary> :: 3117 3124 <Identifier> :: 3117 3124 <Ident> :: 3117 3123 <Prefix> :: 3125 3150 <Suffix> :: 3125 3150 <Primary> :: 3125 3148 <Expression> :: 3126 3147 <Sequence> :: 3126 3134 <Prefix> :: 3126 3134 <Suffix> :: 3126 3134 <Primary> :: 3126 3134 <Identifier> :: 3126 3134 <Ident> :: 3126 3133 <Sequence> :: 3137 3141 <Prefix> :: 3137 3141 <Suffix> :: 3137 3141 <Primary> :: 3137 3141 <Identifier> :: 3137 3141 <Ident> :: 3137 3140 <Sequence> :: 3144 3147 <Prefix> :: 3144 3147 <Suffix> :: 3144 3147 <Primary> :: 3144 3147 <Identifier> :: 3144 3147 <Ident> :: 3144 3147 <QUESTION> :: 3149 3150 <Definition> :: 3153 3181 <Attribute> :: 3153 3158 <VOID> :: 3153 3156 <Identifier> :: 3159 3172 <Ident> :: 3159 3160 <Expression> :: 3176 3179 <Sequence> :: 3176 3179 <Prefix> :: 3176 3179 <Suffix> :: 3176 3179 <Primary> :: 3176 3179 <Literal> :: 3176 3179 <Char> :: 3177 3177 <CharUnescaped> :: 3177 3177 <Definition> :: 3182 3245 <Attribute> :: 3182 3187 <LEAF> :: 3182 3185 <Identifier> :: 3188 3201 <Ident> :: 3188 3192 <Expression> :: 3205 3243 <Sequence> :: 3205 3243 <Prefix> :: 3205 3208 <Suffix> :: 3205 3208 <Primary> :: 3205 3208 <Literal> :: 3205 3208 <Char> :: 3206 3206 <CharUnescaped> :: 3206 3206 <Prefix> :: 3209 3212 <Suffix> :: 3209 3212 <Primary> :: 3209 3212 <Literal> :: 3209 3212 <Char> :: 3210 3210 <CharUnescaped> :: 3210 3210 <Prefix> :: 3213 3216 <Suffix> :: 3213 3216 <Primary> :: 3213 3216 <Literal> :: 3213 3216 <Char> :: 3214 3214 <CharUnescaped> :: 3214 3214 <Prefix> :: 3217 3220 <Suffix> :: 3217 3220 <Primary> :: 3217 3220 <Literal> :: 3217 3220 <Char> :: 3218 3218 <CharUnescaped> :: 3218 3218 <Prefix> :: 3221 3224 <Suffix> :: 3221 3224 <Primary> :: 3221 3224 <Literal> :: 3221 3224 <Char> :: 3222 3222 <CharUnescaped> :: 3222 3222 <Prefix> :: 3225 3228 <Suffix> :: 3225 3228 <Primary> :: 3225 3228 <Literal> :: 3225 3228 <Char> :: 3226 3226 <CharUnescaped> :: 3226 3226 <Prefix> :: 3229 3232 <Suffix> :: 3229 3232 <Primary> :: 3229 3232 <Literal> :: 3229 3232 <Char> :: 3230 3230 <CharUnescaped> :: 3230 3230 <Prefix> :: 3233 3243 <Suffix> :: 3233 3243 <Primary> :: 3233 3243 <Identifier> :: 3233 3243 <Ident> :: 3233 3242 <Definition> :: 3246 3297 <Attribute> :: 3246 3251 <LEAF> :: 3246 3249 <Identifier> :: 3252 3265 <Ident> :: 3252 3255 <Expression> :: 3269 3295 <Sequence> :: 3269 3295 <Prefix> :: 3269 3272 <Suffix> :: 3269 3272 <Primary> :: 3269 3272 <Literal> :: 3269 3272 <Char> :: 3270 3270 <CharUnescaped> :: 3270 3270 <Prefix> :: 3273 3276 <Suffix> :: 3273 3276 <Primary> :: 3273 3276 <Literal> :: 3273 3276 <Char> :: 3274 3274 <CharUnescaped> :: 3274 3274 <Prefix> :: 3277 3280 <Suffix> :: 3277 3280 <Primary> :: 3277 3280 <Literal> :: 3277 3280 <Char> :: 3278 3278 <CharUnescaped> :: 3278 3278 <Prefix> :: 3281 3284 <Suffix> :: 3281 3284 <Primary> :: 3281 3284 <Literal> :: 3281 3284 <Char> :: 3282 3282 <CharUnescaped> :: 3282 3282 <Prefix> :: 3285 3295 <Suffix> :: 3285 3295 <Primary> :: 3285 3295 <Identifier> :: 3285 3295 <Ident> :: 3285 3294 <Definition> :: 3298 3343 <Attribute> :: 3298 3303 <VOID> :: 3298 3301 <Identifier> :: 3304 3317 <Ident> :: 3304 3313 <Expression> :: 3321 3341 <Sequence> :: 3321 3341 <Prefix> :: 3321 3341 <Suffix> :: 3321 3341 <Primary> :: 3321 3339 <Expression> :: 3322 3338 <Sequence> :: 3322 3329 <Prefix> :: 3322 3329 <Suffix> :: 3322 3329 <Primary> :: 3322 3329 <SPACE> :: 3322 3329 <Sequence> :: 3332 3338 <Prefix> :: 3332 3338 <Suffix> :: 3332 3338 <Primary> :: 3332 3338 <Identifier> :: 3332 3338 <Ident> :: 3332 3338 <STAR> :: 3340 3341 <Definition> :: 3344 3419 <Attribute> :: 3344 3349 <LEAF> :: 3344 3347 <Identifier> :: 3350 3363 <Ident> :: 3350 3357 <Expression> :: 3367 3417 <Sequence> :: 3367 3417 <Prefix> :: 3367 3370 <Suffix> :: 3367 3370 <Primary> :: 3367 3370 <Literal> :: 3367 3370 <Char> :: 3368 3368 <CharUnescaped> :: 3368 3368 <Prefix> :: 3371 3374 <Suffix> :: 3371 3374 <Primary> :: 3371 3374 <Literal> :: 3371 3374 <Char> :: 3372 3372 <CharUnescaped> :: 3372 3372 <Prefix> :: 3375 3378 <Suffix> :: 3375 3378 <Primary> :: 3375 3378 <Literal> :: 3375 3378 <Char> :: 3376 3376 <CharUnescaped> :: 3376 3376 <Prefix> :: 3379 3382 <Suffix> :: 3379 3382 <Primary> :: 3379 3382 <Literal> :: 3379 3382 <Char> :: 3380 3380 <CharUnescaped> :: 3380 3380 <Prefix> :: 3383 3386 <Suffix> :: 3383 3386 <Primary> :: 3383 3386 <Literal> :: 3383 3386 <Char> :: 3384 3384 <CharUnescaped> :: 3384 3384 <Prefix> :: 3387 3390 <Suffix> :: 3387 3390 <Primary> :: 3387 3390 <Literal> :: 3387 3390 <Char> :: 3388 3388 <CharUnescaped> :: 3388 3388 <Prefix> :: 3391 3394 <Suffix> :: 3391 3394 <Primary> :: 3391 3394 <Literal> :: 3391 3394 <Char> :: 3392 3392 <CharUnescaped> :: 3392 3392 <Prefix> :: 3395 3398 <Suffix> :: 3395 3398 <Primary> :: 3395 3398 <Literal> :: 3395 3398 <Char> :: 3396 3396 <CharUnescaped> :: 3396 3396 <Prefix> :: 3399 3402 <Suffix> :: 3399 3402 <Primary> :: 3399 3402 <Literal> :: 3399 3402 <Char> :: 3400 3400 <CharUnescaped> :: 3400 3400 <Prefix> :: 3403 3406 <Suffix> :: 3403 3406 <Primary> :: 3403 3406 <Literal> :: 3403 3406 <Char> :: 3404 3404 <CharUnescaped> :: 3404 3404 <Prefix> :: 3407 3417 <Suffix> :: 3407 3417 <Primary> :: 3407 3417 <Identifier> :: 3407 3417 <Ident> :: 3407 3416 <Definition> :: 3420 3488 <Attribute> :: 3420 3425 <LEAF> :: 3420 3423 <Identifier> :: 3426 3439 <Ident> :: 3426 3431 <Expression> :: 3443 3485 <Sequence> :: 3443 3485 <Prefix> :: 3443 3446 <Suffix> :: 3443 3446 <Primary> :: 3443 3446 <Literal> :: 3443 3446 <Char> :: 3444 3444 <CharUnescaped> :: 3444 3444 <Prefix> :: 3447 3450 <Suffix> :: 3447 3450 <Primary> :: 3447 3450 <Literal> :: 3447 3450 <Char> :: 3448 3448 <CharUnescaped> :: 3448 3448 <Prefix> :: 3451 3454 <Suffix> :: 3451 3454 <Primary> :: 3451 3454 <Literal> :: 3451 3454 <Char> :: 3452 3452 <CharUnescaped> :: 3452 3452 <Prefix> :: 3455 3458 <Suffix> :: 3455 3458 <Primary> :: 3455 3458 <Literal> :: 3455 3458 <Char> :: 3456 3456 <CharUnescaped> :: 3456 3456 <Prefix> :: 3459 3462 <Suffix> :: 3459 3462 <Primary> :: 3459 3462 <Literal> :: 3459 3462 <Char> :: 3460 3460 <CharUnescaped> :: 3460 3460 <Prefix> :: 3463 3466 <Suffix> :: 3463 3466 <Primary> :: 3463 3466 <Literal> :: 3463 3466 <Char> :: 3464 3464 <CharUnescaped> :: 3464 3464 <Prefix> :: 3467 3470 <Suffix> :: 3467 3470 <Primary> :: 3467 3470 <Literal> :: 3467 3470 <Char> :: 3468 3468 <CharUnescaped> :: 3468 3468 <Prefix> :: 3471 3474 <Suffix> :: 3471 3474 <Primary> :: 3471 3474 <Literal> :: 3471 3474 <Char> :: 3472 3472 <CharUnescaped> :: 3472 3472 <Prefix> :: 3475 3485 <Suffix> :: 3475 3485 <Primary> :: 3475 3485 <Identifier> :: 3475 3485 <Ident> :: 3475 3484 |
Changes to modules/pt/tests/data/ok/peg_peg-ast/3_peg_itself.
|
| | | 1 2 3 4 5 6 7 8 | <Grammar> :: 0 3398 <Header> :: 0 27 <Identifier> :: 4 16 <Ident> :: 4 15 <StartExpr> :: 17 27 <Expression> :: 18 24 <Sequence> :: 18 24 <Prefix> :: 18 24 |
︙ | ︙ | |||
832 833 834 835 836 837 838 | <Char> :: 1266 1266 <CharUnescaped> :: 1266 1266 <Prefix> :: 1269 1279 <Suffix> :: 1269 1279 <Primary> :: 1269 1279 <Identifier> :: 1269 1279 <Ident> :: 1269 1278 | | | | | > | | < | | | | | | | | | | | | | > | | | | | | > | < < | < < < < | > > > | | < < < < | | > > > | | | | | < | < | | | | | | | | > > | | | | | | | | | > | | | | | > | | | | | > | | | | | | < | | | | < < | | | | | | < < | | > > | | | | | | > > | | < < | | | | | > | | | | | | | | | | | | | < | | > > | | > | | | > | > | | > > | > | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | | | > > | | | | | < | | | | | < | | | | | | > > | | | | | | | < | < < < < | | | | < < | | | < < < | | | | > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | > | | | | | | | | | < | < | | | | < | < < | < < | | | | | | | | | | > | > > > > > | > | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < | | | < < | | | | | | | | | > | > | | > > | | | | | < | | | | | < | > | | | | | > > | | < | | | | < < < < < < | | < < < < < | | | | | | | | | < | | | > | | | | | | | < < < < < < | | < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > | | | | | | | | | | | | | < | < | < < < | < | | < | | > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | > > | > | | > > | | | | | | | | > | | | | | | > | | | < | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > | | | | | < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 | <Char> :: 1266 1266 <CharUnescaped> :: 1266 1266 <Prefix> :: 1269 1279 <Suffix> :: 1269 1279 <Primary> :: 1269 1279 <Identifier> :: 1269 1279 <Ident> :: 1269 1278 <Definition> :: 1282 1309 <Attribute> :: 1282 1287 <VOID> :: 1282 1285 <Identifier> :: 1288 1301 <Ident> :: 1288 1290 <Expression> :: 1305 1307 <Sequence> :: 1305 1307 <Prefix> :: 1305 1307 <NOT> :: 1305 1305 <Suffix> :: 1306 1307 <Primary> :: 1306 1307 <DOT> :: 1306 1307 <Definition> :: 1310 1352 <Attribute> :: 1310 1315 <VOID> :: 1310 1313 <Identifier> :: 1316 1329 <Ident> :: 1316 1318 <Expression> :: 1333 1344 <Sequence> :: 1333 1337 <Prefix> :: 1333 1337 <Suffix> :: 1333 1337 <Primary> :: 1333 1337 <Literal> :: 1333 1337 <Char> :: 1334 1335 <CharSpecial> :: 1334 1335 <Sequence> :: 1340 1344 <Prefix> :: 1340 1344 <Suffix> :: 1340 1344 <Primary> :: 1340 1344 <Literal> :: 1340 1344 <Char> :: 1341 1342 <CharSpecial> :: 1341 1342 <Definition> :: 1353 1398 <Identifier> :: 1353 1366 <Ident> :: 1353 1362 <Expression> :: 1370 1396 <Sequence> :: 1370 1396 <Prefix> :: 1370 1378 <Suffix> :: 1370 1378 <Primary> :: 1370 1378 <Identifier> :: 1370 1378 <Ident> :: 1370 1377 <Prefix> :: 1379 1396 <Suffix> :: 1379 1396 <Primary> :: 1379 1394 <Expression> :: 1380 1393 <Sequence> :: 1380 1393 <Prefix> :: 1380 1385 <Suffix> :: 1380 1385 <Primary> :: 1380 1385 <Identifier> :: 1380 1385 <Ident> :: 1380 1384 <Prefix> :: 1386 1393 <Suffix> :: 1386 1393 <Primary> :: 1386 1393 <Identifier> :: 1386 1393 <Ident> :: 1386 1393 <STAR> :: 1395 1396 <Definition> :: 1399 1473 <Attribute> :: 1399 1404 <VOID> :: 1399 1402 <Identifier> :: 1405 1418 <Ident> :: 1405 1409 <Expression> :: 1422 1465 <Sequence> :: 1422 1465 <Prefix> :: 1422 1425 <Suffix> :: 1422 1425 <Primary> :: 1422 1425 <Literal> :: 1422 1425 <Char> :: 1423 1423 <CharUnescaped> :: 1423 1423 <Prefix> :: 1426 1429 <Suffix> :: 1426 1429 <Primary> :: 1426 1429 <Literal> :: 1426 1429 <Char> :: 1427 1427 <CharUnescaped> :: 1427 1427 <Prefix> :: 1430 1433 <Suffix> :: 1430 1433 <Primary> :: 1430 1433 <Literal> :: 1430 1433 <Char> :: 1431 1431 <CharUnescaped> :: 1431 1431 <Prefix> :: 1434 1444 <Suffix> :: 1434 1444 <Primary> :: 1434 1444 <Identifier> :: 1434 1444 <Ident> :: 1434 1443 <Prefix> :: 1445 1454 <Suffix> :: 1445 1454 <Primary> :: 1445 1454 <Identifier> :: 1445 1454 <Ident> :: 1445 1453 <Prefix> :: 1455 1465 <Suffix> :: 1455 1465 <Primary> :: 1455 1465 <Identifier> :: 1455 1465 <Ident> :: 1455 1464 <Definition> :: 1474 1532 <Identifier> :: 1474 1487 <Ident> :: 1474 1480 <Expression> :: 1491 1530 <Sequence> :: 1491 1530 <Prefix> :: 1491 1501 <Suffix> :: 1491 1501 <Primary> :: 1491 1501 <Identifier> :: 1491 1501 <Ident> :: 1491 1500 <Prefix> :: 1502 1508 <Suffix> :: 1502 1508 <Primary> :: 1502 1508 <Identifier> :: 1502 1508 <Ident> :: 1502 1507 <Prefix> :: 1509 1520 <Suffix> :: 1509 1520 <Primary> :: 1509 1518 <Identifier> :: 1509 1518 <Ident> :: 1509 1518 <STAR> :: 1519 1520 <Prefix> :: 1521 1526 <Suffix> :: 1521 1526 <Primary> :: 1521 1526 <Identifier> :: 1521 1526 <Ident> :: 1521 1525 <Prefix> :: 1527 1530 <Suffix> :: 1527 1530 <Primary> :: 1527 1530 <Identifier> :: 1527 1530 <Ident> :: 1527 1529 <Definition> :: 1533 1602 <Attribute> :: 1533 1538 <LEAF> :: 1533 1536 <Identifier> :: 1539 1552 <Ident> :: 1539 1543 <Expression> :: 1556 1594 <Sequence> :: 1556 1594 <Prefix> :: 1556 1559 <Suffix> :: 1556 1559 <Primary> :: 1556 1559 <Literal> :: 1556 1559 <Char> :: 1557 1557 <CharUnescaped> :: 1557 1557 <Prefix> :: 1560 1563 <Suffix> :: 1560 1563 <Primary> :: 1560 1563 <Literal> :: 1560 1563 <Char> :: 1561 1561 <CharUnescaped> :: 1561 1561 <Prefix> :: 1564 1567 <Suffix> :: 1564 1567 <Primary> :: 1564 1567 <Literal> :: 1564 1567 <Char> :: 1565 1565 <CharUnescaped> :: 1565 1565 <Prefix> :: 1568 1571 <Suffix> :: 1568 1571 <Primary> :: 1568 1571 <Literal> :: 1568 1571 <Char> :: 1569 1569 <CharUnescaped> :: 1569 1569 <Prefix> :: 1572 1575 <Suffix> :: 1572 1575 <Primary> :: 1572 1575 <Literal> :: 1572 1575 <Char> :: 1573 1573 <CharUnescaped> :: 1573 1573 <Prefix> :: 1576 1579 <Suffix> :: 1576 1579 <Primary> :: 1576 1579 <Literal> :: 1576 1579 <Char> :: 1577 1577 <CharUnescaped> :: 1577 1577 <Prefix> :: 1580 1583 <Suffix> :: 1580 1583 <Primary> :: 1580 1583 <Literal> :: 1580 1583 <Char> :: 1581 1581 <CharUnescaped> :: 1581 1581 <Prefix> :: 1584 1594 <Suffix> :: 1584 1594 <Primary> :: 1584 1594 <Identifier> :: 1584 1594 <Ident> :: 1584 1593 <Definition> :: 1603 1646 <Identifier> :: 1603 1616 <Ident> :: 1603 1608 <Expression> :: 1620 1644 <Sequence> :: 1620 1644 <Prefix> :: 1620 1623 <Suffix> :: 1620 1623 <Primary> :: 1620 1623 <Identifier> :: 1620 1623 <Ident> :: 1620 1622 <Prefix> :: 1624 1634 <Suffix> :: 1624 1634 <Primary> :: 1624 1634 <Identifier> :: 1624 1634 <Ident> :: 1624 1633 <Prefix> :: 1635 1644 <Suffix> :: 1635 1644 <Primary> :: 1635 1644 <Identifier> :: 1635 1644 <Ident> :: 1635 1643 <Definition> :: 1647 1722 <Attribute> :: 1647 1652 <LEAF> :: 1647 1650 <Identifier> :: 1653 1666 <Ident> :: 1653 1657 <Expression> :: 1670 1714 <Sequence> :: 1670 1714 <Prefix> :: 1670 1691 <Suffix> :: 1670 1691 <Primary> :: 1670 1691 <Expression> :: 1671 1689 <Sequence> :: 1671 1674 <Prefix> :: 1671 1674 <Suffix> :: 1671 1674 <Primary> :: 1671 1674 <Literal> :: 1671 1674 <Char> :: 1672 1672 <CharUnescaped> :: 1672 1672 <Sequence> :: 1677 1680 <Prefix> :: 1677 1680 <Suffix> :: 1677 1680 <Primary> :: 1677 1680 <Literal> :: 1677 1680 <Char> :: 1678 1678 <CharUnescaped> :: 1678 1678 <Sequence> :: 1683 1689 <Prefix> :: 1683 1689 <Suffix> :: 1683 1689 <Primary> :: 1683 1689 <ALPHA> :: 1683 1689 <Prefix> :: 1692 1714 <Suffix> :: 1692 1714 <Primary> :: 1692 1712 <Expression> :: 1693 1711 <Sequence> :: 1693 1696 <Prefix> :: 1693 1696 <Suffix> :: 1693 1696 <Primary> :: 1693 1696 <Literal> :: 1693 1696 <Char> :: 1694 1694 <CharUnescaped> :: 1694 1694 <Sequence> :: 1699 1702 <Prefix> :: 1699 1702 <Suffix> :: 1699 1702 <Primary> :: 1699 1702 <Literal> :: 1699 1702 <Char> :: 1700 1700 <CharUnescaped> :: 1700 1700 <Sequence> :: 1705 1711 <Prefix> :: 1705 1711 <Suffix> :: 1705 1711 <Primary> :: 1705 1711 <ALNUM> :: 1705 1711 <STAR> :: 1713 1714 <Definition> :: 1723 1758 <Identifier> :: 1723 1736 <Ident> :: 1723 1732 <Expression> :: 1740 1756 <Sequence> :: 1740 1756 <Prefix> :: 1740 1745 <Suffix> :: 1740 1745 <Primary> :: 1740 1745 <Identifier> :: 1740 1745 <Ident> :: 1740 1744 <Prefix> :: 1746 1756 <Suffix> :: 1746 1756 <Primary> :: 1746 1756 <Identifier> :: 1746 1756 <Ident> :: 1746 1755 <Definition> :: 1759 1802 <Attribute> :: 1759 1764 <VOID> :: 1759 1762 <Identifier> :: 1765 1778 <Ident> :: 1765 1766 <Expression> :: 1782 1800 <Sequence> :: 1782 1800 <Prefix> :: 1782 1785 <Suffix> :: 1782 1785 <Primary> :: 1782 1785 <Literal> :: 1782 1785 <Char> :: 1783 1783 <CharUnescaped> :: 1783 1783 <Prefix> :: 1786 1789 <Suffix> :: 1786 1789 <Primary> :: 1786 1789 <Literal> :: 1786 1789 <Char> :: 1787 1787 <CharUnescaped> :: 1787 1787 <Prefix> :: 1790 1800 <Suffix> :: 1790 1800 <Primary> :: 1790 1800 <Identifier> :: 1790 1800 <Ident> :: 1790 1799 <Definition> :: 1803 1860 <Attribute> :: 1803 1808 <LEAF> :: 1803 1806 <Identifier> :: 1809 1822 <Ident> :: 1809 1812 <Expression> :: 1826 1852 <Sequence> :: 1826 1852 <Prefix> :: 1826 1829 <Suffix> :: 1826 1829 <Primary> :: 1826 1829 <Literal> :: 1826 1829 <Char> :: 1827 1827 <CharUnescaped> :: 1827 1827 <Prefix> :: 1830 1833 <Suffix> :: 1830 1833 <Primary> :: 1830 1833 <Literal> :: 1830 1833 <Char> :: 1831 1831 <CharUnescaped> :: 1831 1831 <Prefix> :: 1834 1837 <Suffix> :: 1834 1837 <Primary> :: 1834 1837 <Literal> :: 1834 1837 <Char> :: 1835 1835 <CharUnescaped> :: 1835 1835 <Prefix> :: 1838 1841 <Suffix> :: 1838 1841 <Primary> :: 1838 1841 <Literal> :: 1838 1841 <Char> :: 1839 1839 <CharUnescaped> :: 1839 1839 <Prefix> :: 1842 1852 <Suffix> :: 1842 1852 <Primary> :: 1842 1852 <Identifier> :: 1842 1852 <Ident> :: 1842 1851 <Definition> :: 1861 1984 <Identifier> :: 1861 1874 <Ident> :: 1861 1867 <Expression> :: 1878 1982 <Sequence> :: 1878 1927 <Prefix> :: 1878 1887 <Suffix> :: 1878 1887 <Primary> :: 1878 1887 <Identifier> :: 1878 1887 <Ident> :: 1878 1886 <Prefix> :: 1888 1906 <Suffix> :: 1888 1906 <Primary> :: 1888 1904 <Expression> :: 1889 1903 <Sequence> :: 1889 1903 <Prefix> :: 1889 1899 <NOT> :: 1889 1889 <Suffix> :: 1890 1899 <Primary> :: 1890 1899 <Identifier> :: 1890 1899 <Ident> :: 1890 1898 <Prefix> :: 1900 1903 <Suffix> :: 1900 1903 <Primary> :: 1900 1903 <Identifier> :: 1900 1903 <Ident> :: 1900 1903 <STAR> :: 1905 1906 <Prefix> :: 1907 1916 <Suffix> :: 1907 1916 <Primary> :: 1907 1916 <Identifier> :: 1907 1916 <Ident> :: 1907 1915 <Prefix> :: 1917 1927 <Suffix> :: 1917 1927 <Primary> :: 1917 1927 <Identifier> :: 1917 1927 <Ident> :: 1917 1926 <Sequence> :: 1930 1982 <Prefix> :: 1930 1940 <Suffix> :: 1930 1940 <Primary> :: 1930 1940 <Identifier> :: 1930 1940 <Ident> :: 1930 1939 <Prefix> :: 1941 1960 <Suffix> :: 1941 1960 <Primary> :: 1941 1958 <Expression> :: 1942 1957 <Sequence> :: 1942 1957 <Prefix> :: 1942 1953 <NOT> :: 1942 1942 <Suffix> :: 1943 1953 <Primary> :: 1943 1953 <Identifier> :: 1943 1953 <Ident> :: 1943 1952 <Prefix> :: 1954 1957 <Suffix> :: 1954 1957 <Primary> :: 1954 1957 <Identifier> :: 1954 1957 <Ident> :: 1954 1957 <STAR> :: 1959 1960 <Prefix> :: 1961 1971 <Suffix> :: 1961 1971 <Primary> :: 1961 1971 <Identifier> :: 1961 1971 <Ident> :: 1961 1970 <Prefix> :: 1972 1982 <Suffix> :: 1972 1982 <Primary> :: 1972 1982 <Identifier> :: 1972 1982 <Ident> :: 1972 1981 <Definition> :: 1985 2048 <Attribute> :: 1985 1990 <LEAF> :: 1985 1988 <Identifier> :: 1991 2004 <Ident> :: 1991 1995 <Expression> :: 2008 2046 <Sequence> :: 2008 2046 <Prefix> :: 2008 2011 <Suffix> :: 2008 2011 <Primary> :: 2008 2011 <Literal> :: 2008 2011 <Char> :: 2009 2009 <CharUnescaped> :: 2009 2009 <Prefix> :: 2012 2015 <Suffix> :: 2012 2015 <Primary> :: 2012 2015 <Literal> :: 2012 2015 <Char> :: 2013 2013 <CharUnescaped> :: 2013 2013 <Prefix> :: 2016 2019 <Suffix> :: 2016 2019 <Primary> :: 2016 2019 <Literal> :: 2016 2019 <Char> :: 2017 2017 <CharUnescaped> :: 2017 2017 <Prefix> :: 2020 2023 <Suffix> :: 2020 2023 <Primary> :: 2020 2023 <Literal> :: 2020 2023 <Char> :: 2021 2021 <CharUnescaped> :: 2021 2021 <Prefix> :: 2024 2027 <Suffix> :: 2024 2027 <Primary> :: 2024 2027 <Literal> :: 2024 2027 <Char> :: 2025 2025 <CharUnescaped> :: 2025 2025 <Prefix> :: 2028 2031 <Suffix> :: 2028 2031 <Primary> :: 2028 2031 <Literal> :: 2028 2031 <Char> :: 2029 2029 <CharUnescaped> :: 2029 2029 <Prefix> :: 2032 2035 <Suffix> :: 2032 2035 <Primary> :: 2032 2035 <Literal> :: 2032 2035 <Char> :: 2033 2033 <CharUnescaped> :: 2033 2033 <Prefix> :: 2036 2046 <Suffix> :: 2036 2046 <Primary> :: 2036 2046 <Identifier> :: 2036 2046 <Ident> :: 2036 2045 <Definition> :: 2049 2088 <Attribute> :: 2049 2054 <LEAF> :: 2049 2052 <Identifier> :: 2055 2068 <Ident> :: 2055 2057 <Expression> :: 2072 2086 <Sequence> :: 2072 2086 <Prefix> :: 2072 2075 <Suffix> :: 2072 2075 <Primary> :: 2072 2075 <Literal> :: 2072 2075 <Char> :: 2073 2073 <CharUnescaped> :: 2073 2073 <Prefix> :: 2076 2086 <Suffix> :: 2076 2086 <Primary> :: 2076 2086 <Identifier> :: 2076 2086 <Ident> :: 2076 2085 <Definition> :: 2089 2128 <Attribute> :: 2089 2094 <VOID> :: 2089 2092 <Identifier> :: 2095 2108 <Ident> :: 2095 2098 <Expression> :: 2112 2126 <Sequence> :: 2112 2126 <Prefix> :: 2112 2115 <Suffix> :: 2112 2115 <Primary> :: 2112 2115 <Literal> :: 2112 2115 <Char> :: 2113 2113 <CharUnescaped> :: 2113 2113 <Prefix> :: 2116 2126 <Suffix> :: 2116 2126 <Primary> :: 2116 2126 <Identifier> :: 2116 2126 <Ident> :: 2116 2125 <Definition> :: 2129 2158 <Attribute> :: 2129 2134 <VOID> :: 2129 2132 <Identifier> :: 2135 2148 <Ident> :: 2135 2139 <Expression> :: 2152 2156 <Sequence> :: 2152 2156 <Prefix> :: 2152 2156 <Suffix> :: 2152 2156 <Primary> :: 2152 2156 <Literal> :: 2152 2156 <Char> :: 2153 2154 <CharSpecial> :: 2153 2154 <Definition> :: 2159 2229 <Attribute> :: 2159 2164 <VOID> :: 2159 2162 <Identifier> :: 2165 2178 <Ident> :: 2165 2167 <Expression> :: 2182 2227 <Sequence> :: 2182 2227 <Prefix> :: 2182 2185 <Suffix> :: 2182 2185 <Primary> :: 2182 2185 <Literal> :: 2182 2185 <Char> :: 2183 2183 <CharUnescaped> :: 2183 2183 <Prefix> :: 2186 2189 <Suffix> :: 2186 2189 <Primary> :: 2186 2189 <Literal> :: 2186 2189 <Char> :: 2187 2187 <CharUnescaped> :: 2187 2187 <Prefix> :: 2190 2193 <Suffix> :: 2190 2193 <Primary> :: 2190 2193 <Literal> :: 2190 2193 <Char> :: 2191 2191 <CharUnescaped> :: 2191 2191 <Prefix> :: 2194 2216 <NOT> :: 2194 2194 <Suffix> :: 2195 2216 <Primary> :: 2195 2216 <Expression> :: 2196 2214 <Sequence> :: 2196 2199 <Prefix> :: 2196 2199 <Suffix> :: 2196 2199 <Primary> :: 2196 2199 <Literal> :: 2196 2199 <Char> :: 2197 2197 <CharUnescaped> :: 2197 2197 <Sequence> :: 2202 2205 <Prefix> :: 2202 2205 <Suffix> :: 2202 2205 <Primary> :: 2202 2205 <Literal> :: 2202 2205 <Char> :: 2203 2203 <CharUnescaped> :: 2203 2203 <Sequence> :: 2208 2214 <Prefix> :: 2208 2214 <Suffix> :: 2208 2214 <Primary> :: 2208 2214 <ALNUM> :: 2208 2214 <Prefix> :: 2217 2227 <Suffix> :: 2217 2227 <Primary> :: 2217 2227 <Identifier> :: 2217 2227 <Ident> :: 2217 2226 <Definition> :: 2230 2275 <Attribute> :: 2230 2235 <LEAF> :: 2230 2233 <Identifier> :: 2236 2249 <Ident> :: 2236 2239 <Expression> :: 2253 2267 <Sequence> :: 2253 2267 <Prefix> :: 2253 2256 <Suffix> :: 2253 2256 <Primary> :: 2253 2256 <Literal> :: 2253 2256 <Char> :: 2254 2254 <CharUnescaped> :: 2254 2254 <Prefix> :: 2257 2267 <Suffix> :: 2257 2267 <Primary> :: 2257 2267 <Identifier> :: 2257 2267 <Ident> :: 2257 2266 <Definition> :: 2276 2320 <Identifier> :: 2276 2289 <Ident> :: 2276 2281 <Expression> :: 2293 2312 <Sequence> :: 2293 2312 <Prefix> :: 2293 2305 <Suffix> :: 2293 2305 <Primary> :: 2293 2303 <Expression> :: 2294 2302 <Sequence> :: 2294 2297 <Prefix> :: 2294 2297 <Suffix> :: 2294 2297 <Primary> :: 2294 2297 <Identifier> :: 2294 2297 <Ident> :: 2294 2296 <Sequence> :: 2300 2302 <Prefix> :: 2300 2302 <Suffix> :: 2300 2302 <Primary> :: 2300 2302 <Identifier> :: 2300 2302 <Ident> :: 2300 2302 <QUESTION> :: 2304 2305 <Prefix> :: 2306 2312 <Suffix> :: 2306 2312 <Primary> :: 2306 2312 <Identifier> :: 2306 2312 <Ident> :: 2306 2311 <Definition> :: 2321 2521 <Identifier> :: 2321 2334 <Ident> :: 2321 2327 <Expression> :: 2338 2519 <Sequence> :: 2338 2343 <Prefix> :: 2338 2343 <Suffix> :: 2338 2343 <Primary> :: 2338 2343 <Identifier> :: 2338 2343 <Ident> :: 2338 2342 <Sequence> :: 2346 2351 <Prefix> :: 2346 2351 <Suffix> :: 2346 2351 <Primary> :: 2346 2351 <Identifier> :: 2346 2351 <Ident> :: 2346 2350 <Sequence> :: 2354 2359 <Prefix> :: 2354 2359 <Suffix> :: 2354 2359 <Primary> :: 2354 2359 <Identifier> :: 2354 2359 <Ident> :: 2354 2358 <Sequence> :: 2362 2369 <Prefix> :: 2362 2369 <Suffix> :: 2362 2369 <Primary> :: 2362 2369 <Identifier> :: 2362 2369 <Ident> :: 2362 2368 <Sequence> :: 2372 2378 <Prefix> :: 2372 2378 <Suffix> :: 2372 2378 <Primary> :: 2372 2378 <Identifier> :: 2372 2378 <Ident> :: 2372 2377 <Sequence> :: 2381 2386 <Prefix> :: 2381 2386 <Suffix> :: 2381 2386 <Primary> :: 2381 2386 <Identifier> :: 2381 2386 <Ident> :: 2381 2385 <Sequence> :: 2389 2394 <Prefix> :: 2389 2394 <Suffix> :: 2389 2394 <Primary> :: 2389 2394 <Identifier> :: 2389 2394 <Ident> :: 2389 2393 <Sequence> :: 2397 2402 <Prefix> :: 2397 2402 <Suffix> :: 2397 2402 <Primary> :: 2397 2402 <Identifier> :: 2397 2402 <Ident> :: 2397 2401 <Sequence> :: 2405 2414 <Prefix> :: 2405 2414 <Suffix> :: 2405 2414 <Primary> :: 2405 2414 <Identifier> :: 2405 2414 <Ident> :: 2405 2413 <Sequence> :: 2417 2422 <Prefix> :: 2417 2422 <Suffix> :: 2417 2422 <Primary> :: 2417 2422 <Identifier> :: 2417 2422 <Ident> :: 2417 2421 <Sequence> :: 2425 2430 <Prefix> :: 2425 2430 <Suffix> :: 2425 2430 <Primary> :: 2425 2430 <Identifier> :: 2425 2430 <Ident> :: 2425 2429 <Sequence> :: 2433 2438 <Prefix> :: 2433 2438 <Suffix> :: 2433 2438 <Primary> :: 2433 2438 <Identifier> :: 2433 2438 <Ident> :: 2433 2437 <Sequence> :: 2441 2449 <Prefix> :: 2441 2449 <Suffix> :: 2441 2449 <Primary> :: 2441 2449 <Identifier> :: 2441 2449 <Ident> :: 2441 2448 <Sequence> :: 2452 2458 <Prefix> :: 2452 2458 <Suffix> :: 2452 2458 <Primary> :: 2452 2458 <Identifier> :: 2452 2458 <Ident> :: 2452 2457 <Sequence> :: 2461 2471 <Prefix> :: 2461 2471 <Suffix> :: 2461 2471 <Primary> :: 2461 2471 <Identifier> :: 2461 2471 <Ident> :: 2461 2470 <Sequence> :: 2474 2495 <Prefix> :: 2474 2478 <Suffix> :: 2474 2478 <Primary> :: 2474 2478 <Identifier> :: 2474 2478 <Ident> :: 2474 2477 <Prefix> :: 2479 2489 <Suffix> :: 2479 2489 <Primary> :: 2479 2489 <Identifier> :: 2479 2489 <Ident> :: 2479 2488 <Prefix> :: 2490 2495 <Suffix> :: 2490 2495 <Primary> :: 2490 2495 <Identifier> :: 2490 2495 <Ident> :: 2490 2494 <Sequence> :: 2498 2505 <Prefix> :: 2498 2505 <Suffix> :: 2498 2505 <Primary> :: 2498 2505 <Identifier> :: 2498 2505 <Ident> :: 2498 2504 <Sequence> :: 2508 2513 <Prefix> :: 2508 2513 <Suffix> :: 2508 2513 <Primary> :: 2508 2513 <Identifier> :: 2508 2513 <Ident> :: 2508 2512 <Sequence> :: 2516 2519 <Prefix> :: 2516 2519 <Suffix> :: 2516 2519 <Primary> :: 2516 2519 <Identifier> :: 2516 2519 <Ident> :: 2516 2518 <Definition> :: 2522 2585 <Attribute> :: 2522 2527 <LEAF> :: 2522 2525 <Identifier> :: 2528 2541 <Ident> :: 2528 2536 <Expression> :: 2545 2583 <Sequence> :: 2545 2583 <Prefix> :: 2545 2548 <Suffix> :: 2545 2548 <Primary> :: 2545 2548 <Literal> :: 2545 2548 <Char> :: 2546 2546 <CharUnescaped> :: 2546 2546 <Prefix> :: 2549 2552 <Suffix> :: 2549 2552 <Primary> :: 2549 2552 <Literal> :: 2549 2552 <Char> :: 2550 2550 <CharUnescaped> :: 2550 2550 <Prefix> :: 2553 2556 <Suffix> :: 2553 2556 <Primary> :: 2553 2556 <Literal> :: 2553 2556 <Char> :: 2554 2554 <CharUnescaped> :: 2554 2554 <Prefix> :: 2557 2560 <Suffix> :: 2557 2560 <Primary> :: 2557 2560 <Literal> :: 2557 2560 <Char> :: 2558 2558 <CharUnescaped> :: 2558 2558 <Prefix> :: 2561 2564 <Suffix> :: 2561 2564 <Primary> :: 2561 2564 <Literal> :: 2561 2564 <Char> :: 2562 2562 <CharUnescaped> :: 2562 2562 <Prefix> :: 2565 2568 <Suffix> :: 2565 2568 <Primary> :: 2565 2568 <Literal> :: 2565 2568 <Char> :: 2566 2566 <CharUnescaped> :: 2566 2566 <Prefix> :: 2569 2572 <Suffix> :: 2569 2572 <Primary> :: 2569 2572 <Literal> :: 2569 2572 <Char> :: 2570 2570 <CharUnescaped> :: 2570 2570 <Prefix> :: 2573 2583 <Suffix> :: 2573 2583 <Primary> :: 2573 2583 <Identifier> :: 2573 2583 <Ident> :: 2573 2582 <Definition> :: 2586 2649 <Attribute> :: 2586 2591 <LEAF> :: 2586 2589 <Identifier> :: 2592 2605 <Ident> :: 2592 2596 <Expression> :: 2609 2647 <Sequence> :: 2609 2647 <Prefix> :: 2609 2612 <Suffix> :: 2609 2612 <Primary> :: 2609 2612 <Literal> :: 2609 2612 <Char> :: 2610 2610 <CharUnescaped> :: 2610 2610 <Prefix> :: 2613 2616 <Suffix> :: 2613 2616 <Primary> :: 2613 2616 <Literal> :: 2613 2616 <Char> :: 2614 2614 <CharUnescaped> :: 2614 2614 <Prefix> :: 2617 2620 <Suffix> :: 2617 2620 <Primary> :: 2617 2620 <Literal> :: 2617 2620 <Char> :: 2618 2618 <CharUnescaped> :: 2618 2618 <Prefix> :: 2621 2624 <Suffix> :: 2621 2624 <Primary> :: 2621 2624 <Literal> :: 2621 2624 <Char> :: 2622 2622 <CharUnescaped> :: 2622 2622 <Prefix> :: 2625 2628 <Suffix> :: 2625 2628 <Primary> :: 2625 2628 <Literal> :: 2625 2628 <Char> :: 2626 2626 <CharUnescaped> :: 2626 2626 <Prefix> :: 2629 2632 <Suffix> :: 2629 2632 <Primary> :: 2629 2632 <Literal> :: 2629 2632 <Char> :: 2630 2630 <CharUnescaped> :: 2630 2630 <Prefix> :: 2633 2636 <Suffix> :: 2633 2636 <Primary> :: 2633 2636 <Literal> :: 2633 2636 <Char> :: 2634 2634 <CharUnescaped> :: 2634 2634 <Prefix> :: 2637 2647 <Suffix> :: 2637 2647 <Primary> :: 2637 2647 <Identifier> :: 2637 2647 <Ident> :: 2637 2646 <Definition> :: 2650 2695 <Attribute> :: 2650 2655 <LEAF> :: 2650 2653 <Identifier> :: 2656 2669 <Ident> :: 2656 2663 <Expression> :: 2673 2687 <Sequence> :: 2673 2687 <Prefix> :: 2673 2676 <Suffix> :: 2673 2676 <Primary> :: 2673 2676 <Literal> :: 2673 2676 <Char> :: 2674 2674 <CharUnescaped> :: 2674 2674 <Prefix> :: 2677 2687 <Suffix> :: 2677 2687 <Primary> :: 2677 2687 <Identifier> :: 2677 2687 <Ident> :: 2677 2686 <Definition> :: 2696 2734 <Identifier> :: 2696 2709 <Ident> :: 2696 2700 <Expression> :: 2713 2732 <Sequence> :: 2713 2725 <Prefix> :: 2713 2717 <Suffix> :: 2713 2717 <Primary> :: 2713 2717 <Identifier> :: 2713 2717 <Ident> :: 2713 2716 <Prefix> :: 2718 2720 <Suffix> :: 2718 2720 <Primary> :: 2718 2720 <Identifier> :: 2718 2720 <Ident> :: 2718 2719 <Prefix> :: 2721 2725 <Suffix> :: 2721 2725 <Primary> :: 2721 2725 <Identifier> :: 2721 2725 <Ident> :: 2721 2724 <Sequence> :: 2728 2732 <Prefix> :: 2728 2732 <Suffix> :: 2728 2732 <Primary> :: 2728 2732 <Identifier> :: 2728 2732 <Ident> :: 2728 2731 <Definition> :: 2735 2780 <Attribute> :: 2735 2740 <VOID> :: 2735 2738 <Identifier> :: 2741 2754 <Ident> :: 2741 2749 <Expression> :: 2758 2772 <Sequence> :: 2758 2772 <Prefix> :: 2758 2761 <Suffix> :: 2758 2761 <Primary> :: 2758 2761 <Literal> :: 2758 2761 <Char> :: 2759 2759 <CharUnescaped> :: 2759 2759 <Prefix> :: 2762 2772 <Suffix> :: 2762 2772 <Primary> :: 2762 2772 <Identifier> :: 2762 2772 <Ident> :: 2762 2771 <Definition> :: 2781 2807 <Identifier> :: 2781 2794 <Ident> :: 2781 2788 <Expression> :: 2798 2805 <Sequence> :: 2798 2805 <Prefix> :: 2798 2805 <Suffix> :: 2798 2805 <Primary> :: 2798 2803 <Identifier> :: 2798 2803 <Ident> :: 2798 2803 <PLUS> :: 2804 2805 <Definition> :: 2808 2847 <Attribute> :: 2808 2813 <VOID> :: 2808 2811 <Identifier> :: 2814 2827 <Ident> :: 2814 2818 <Expression> :: 2831 2845 <Sequence> :: 2831 2845 <Prefix> :: 2831 2834 <Suffix> :: 2831 2834 <Primary> :: 2831 2834 <Literal> :: 2831 2834 <Char> :: 2832 2832 <CharUnescaped> :: 2832 2832 <Prefix> :: 2835 2845 <Suffix> :: 2835 2845 <Primary> :: 2835 2845 <Identifier> :: 2835 2845 <Ident> :: 2835 2844 <Definition> :: 2848 2911 <Attribute> :: 2848 2853 <LEAF> :: 2848 2851 <Identifier> :: 2854 2867 <Ident> :: 2854 2858 <Expression> :: 2871 2909 <Sequence> :: 2871 2909 <Prefix> :: 2871 2874 <Suffix> :: 2871 2874 <Primary> :: 2871 2874 <Literal> :: 2871 2874 <Char> :: 2872 2872 <CharUnescaped> :: 2872 2872 <Prefix> :: 2875 2878 <Suffix> :: 2875 2878 <Primary> :: 2875 2878 <Literal> :: 2875 2878 <Char> :: 2876 2876 <CharUnescaped> :: 2876 2876 <Prefix> :: 2879 2882 <Suffix> :: 2879 2882 <Primary> :: 2879 2882 <Literal> :: 2879 2882 <Char> :: 2880 2880 <CharUnescaped> :: 2880 2880 <Prefix> :: 2883 2886 <Suffix> :: 2883 2886 <Primary> :: 2883 2886 <Literal> :: 2883 2886 <Char> :: 2884 2884 <CharUnescaped> :: 2884 2884 <Prefix> :: 2887 2890 <Suffix> :: 2887 2890 <Primary> :: 2887 2890 <Literal> :: 2887 2890 <Char> :: 2888 2888 <CharUnescaped> :: 2888 2888 <Prefix> :: 2891 2894 <Suffix> :: 2891 2894 <Primary> :: 2891 2894 <Literal> :: 2891 2894 <Char> :: 2892 2892 <CharUnescaped> :: 2892 2892 <Prefix> :: 2895 2898 <Suffix> :: 2895 2898 <Primary> :: 2895 2898 <Literal> :: 2895 2898 <Char> :: 2896 2896 <CharUnescaped> :: 2896 2896 <Prefix> :: 2899 2909 <Suffix> :: 2899 2909 <Primary> :: 2899 2909 <Identifier> :: 2899 2909 <Ident> :: 2899 2908 <Definition> :: 2912 2957 <Attribute> :: 2912 2917 <LEAF> :: 2912 2915 <Identifier> :: 2918 2931 <Ident> :: 2918 2921 <Expression> :: 2935 2949 <Sequence> :: 2935 2949 <Prefix> :: 2935 2938 <Suffix> :: 2935 2938 <Primary> :: 2935 2938 <Literal> :: 2935 2938 <Char> :: 2936 2936 <CharUnescaped> :: 2936 2936 <Prefix> :: 2939 2949 <Suffix> :: 2939 2949 <Primary> :: 2939 2949 <Identifier> :: 2939 2949 <Ident> :: 2939 2948 <Definition> :: 2958 3004 <Identifier> :: 2958 2971 <Ident> :: 2958 2966 <Expression> :: 2975 2996 <Sequence> :: 2975 2996 <Prefix> :: 2975 2979 <Suffix> :: 2975 2979 <Primary> :: 2975 2979 <Identifier> :: 2975 2979 <Ident> :: 2975 2978 <Prefix> :: 2980 2990 <Suffix> :: 2980 2990 <Primary> :: 2980 2990 <Identifier> :: 2980 2990 <Ident> :: 2980 2989 <Prefix> :: 2991 2996 <Suffix> :: 2991 2996 <Primary> :: 2991 2996 <Identifier> :: 2991 2996 <Ident> :: 2991 2995 <Definition> :: 3005 3057 <Identifier> :: 3005 3018 <Ident> :: 3005 3010 <Expression> :: 3022 3055 <Sequence> :: 3022 3055 <Prefix> :: 3022 3029 <Suffix> :: 3022 3029 <Primary> :: 3022 3029 <Identifier> :: 3022 3029 <Ident> :: 3022 3028 <Prefix> :: 3030 3055 <Suffix> :: 3030 3055 <Primary> :: 3030 3053 <Expression> :: 3031 3052 <Sequence> :: 3031 3039 <Prefix> :: 3031 3039 <Suffix> :: 3031 3039 <Primary> :: 3031 3039 <Identifier> :: 3031 3039 <Ident> :: 3031 3038 <Sequence> :: 3042 3046 <Prefix> :: 3042 3046 <Suffix> :: 3042 3046 <Primary> :: 3042 3046 <Identifier> :: 3042 3046 <Ident> :: 3042 3045 <Sequence> :: 3049 3052 <Prefix> :: 3049 3052 <Suffix> :: 3049 3052 <Primary> :: 3049 3052 <Identifier> :: 3049 3052 <Ident> :: 3049 3052 <QUESTION> :: 3054 3055 <Definition> :: 3058 3086 <Attribute> :: 3058 3063 <VOID> :: 3058 3061 <Identifier> :: 3064 3077 <Ident> :: 3064 3065 <Expression> :: 3081 3084 <Sequence> :: 3081 3084 <Prefix> :: 3081 3084 <Suffix> :: 3081 3084 <Primary> :: 3081 3084 <Literal> :: 3081 3084 <Char> :: 3082 3082 <CharUnescaped> :: 3082 3082 <Definition> :: 3087 3150 <Attribute> :: 3087 3092 <LEAF> :: 3087 3090 <Identifier> :: 3093 3106 <Ident> :: 3093 3097 <Expression> :: 3110 3148 <Sequence> :: 3110 3148 <Prefix> :: 3110 3113 <Suffix> :: 3110 3113 <Primary> :: 3110 3113 <Literal> :: 3110 3113 <Char> :: 3111 3111 <CharUnescaped> :: 3111 3111 <Prefix> :: 3114 3117 <Suffix> :: 3114 3117 <Primary> :: 3114 3117 <Literal> :: 3114 3117 <Char> :: 3115 3115 <CharUnescaped> :: 3115 3115 <Prefix> :: 3118 3121 <Suffix> :: 3118 3121 <Primary> :: 3118 3121 <Literal> :: 3118 3121 <Char> :: 3119 3119 <CharUnescaped> :: 3119 3119 <Prefix> :: 3122 3125 <Suffix> :: 3122 3125 <Primary> :: 3122 3125 <Literal> :: 3122 3125 <Char> :: 3123 3123 <CharUnescaped> :: 3123 3123 <Prefix> :: 3126 3129 <Suffix> :: 3126 3129 <Primary> :: 3126 3129 <Literal> :: 3126 3129 <Char> :: 3127 3127 <CharUnescaped> :: 3127 3127 <Prefix> :: 3130 3133 <Suffix> :: 3130 3133 <Primary> :: 3130 3133 <Literal> :: 3130 3133 <Char> :: 3131 3131 <CharUnescaped> :: 3131 3131 <Prefix> :: 3134 3137 <Suffix> :: 3134 3137 <Primary> :: 3134 3137 <Literal> :: 3134 3137 <Char> :: 3135 3135 <CharUnescaped> :: 3135 3135 <Prefix> :: 3138 3148 <Suffix> :: 3138 3148 <Primary> :: 3138 3148 <Identifier> :: 3138 3148 <Ident> :: 3138 3147 <Definition> :: 3151 3202 <Attribute> :: 3151 3156 <LEAF> :: 3151 3154 <Identifier> :: 3157 3170 <Ident> :: 3157 3160 <Expression> :: 3174 3200 <Sequence> :: 3174 3200 <Prefix> :: 3174 3177 <Suffix> :: 3174 3177 <Primary> :: 3174 3177 <Literal> :: 3174 3177 <Char> :: 3175 3175 <CharUnescaped> :: 3175 3175 <Prefix> :: 3178 3181 <Suffix> :: 3178 3181 <Primary> :: 3178 3181 <Literal> :: 3178 3181 <Char> :: 3179 3179 <CharUnescaped> :: 3179 3179 <Prefix> :: 3182 3185 <Suffix> :: 3182 3185 <Primary> :: 3182 3185 <Literal> :: 3182 3185 <Char> :: 3183 3183 <CharUnescaped> :: 3183 3183 <Prefix> :: 3186 3189 <Suffix> :: 3186 3189 <Primary> :: 3186 3189 <Literal> :: 3186 3189 <Char> :: 3187 3187 <CharUnescaped> :: 3187 3187 <Prefix> :: 3190 3200 <Suffix> :: 3190 3200 <Primary> :: 3190 3200 <Identifier> :: 3190 3200 <Ident> :: 3190 3199 <Definition> :: 3203 3248 <Attribute> :: 3203 3208 <VOID> :: 3203 3206 <Identifier> :: 3209 3222 <Ident> :: 3209 3218 <Expression> :: 3226 3246 <Sequence> :: 3226 3246 <Prefix> :: 3226 3246 <Suffix> :: 3226 3246 <Primary> :: 3226 3244 <Expression> :: 3227 3243 <Sequence> :: 3227 3234 <Prefix> :: 3227 3234 <Suffix> :: 3227 3234 <Primary> :: 3227 3234 <SPACE> :: 3227 3234 <Sequence> :: 3237 3243 <Prefix> :: 3237 3243 <Suffix> :: 3237 3243 <Primary> :: 3237 3243 <Identifier> :: 3237 3243 <Ident> :: 3237 3243 <STAR> :: 3245 3246 <Definition> :: 3249 3324 <Attribute> :: 3249 3254 <LEAF> :: 3249 3252 <Identifier> :: 3255 3268 <Ident> :: 3255 3262 <Expression> :: 3272 3322 <Sequence> :: 3272 3322 <Prefix> :: 3272 3275 <Suffix> :: 3272 3275 <Primary> :: 3272 3275 <Literal> :: 3272 3275 <Char> :: 3273 3273 <CharUnescaped> :: 3273 3273 <Prefix> :: 3276 3279 <Suffix> :: 3276 3279 <Primary> :: 3276 3279 <Literal> :: 3276 3279 <Char> :: 3277 3277 <CharUnescaped> :: 3277 3277 <Prefix> :: 3280 3283 <Suffix> :: 3280 3283 <Primary> :: 3280 3283 <Literal> :: 3280 3283 <Char> :: 3281 3281 <CharUnescaped> :: 3281 3281 <Prefix> :: 3284 3287 <Suffix> :: 3284 3287 <Primary> :: 3284 3287 <Literal> :: 3284 3287 <Char> :: 3285 3285 <CharUnescaped> :: 3285 3285 <Prefix> :: 3288 3291 <Suffix> :: 3288 3291 <Primary> :: 3288 3291 <Literal> :: 3288 3291 <Char> :: 3289 3289 <CharUnescaped> :: 3289 3289 <Prefix> :: 3292 3295 <Suffix> :: 3292 3295 <Primary> :: 3292 3295 <Literal> :: 3292 3295 <Char> :: 3293 3293 <CharUnescaped> :: 3293 3293 <Prefix> :: 3296 3299 <Suffix> :: 3296 3299 <Primary> :: 3296 3299 <Literal> :: 3296 3299 <Char> :: 3297 3297 <CharUnescaped> :: 3297 3297 <Prefix> :: 3300 3303 <Suffix> :: 3300 3303 <Primary> :: 3300 3303 <Literal> :: 3300 3303 <Char> :: 3301 3301 <CharUnescaped> :: 3301 3301 <Prefix> :: 3304 3307 <Suffix> :: 3304 3307 <Primary> :: 3304 3307 <Literal> :: 3304 3307 <Char> :: 3305 3305 <CharUnescaped> :: 3305 3305 <Prefix> :: 3308 3311 <Suffix> :: 3308 3311 <Primary> :: 3308 3311 <Literal> :: 3308 3311 <Char> :: 3309 3309 <CharUnescaped> :: 3309 3309 <Prefix> :: 3312 3322 <Suffix> :: 3312 3322 <Primary> :: 3312 3322 <Identifier> :: 3312 3322 <Ident> :: 3312 3321 <Definition> :: 3325 3393 <Attribute> :: 3325 3330 <LEAF> :: 3325 3328 <Identifier> :: 3331 3344 <Ident> :: 3331 3336 <Expression> :: 3348 3390 <Sequence> :: 3348 3390 <Prefix> :: 3348 3351 <Suffix> :: 3348 3351 <Primary> :: 3348 3351 <Literal> :: 3348 3351 <Char> :: 3349 3349 <CharUnescaped> :: 3349 3349 <Prefix> :: 3352 3355 <Suffix> :: 3352 3355 <Primary> :: 3352 3355 <Literal> :: 3352 3355 <Char> :: 3353 3353 <CharUnescaped> :: 3353 3353 <Prefix> :: 3356 3359 <Suffix> :: 3356 3359 <Primary> :: 3356 3359 <Literal> :: 3356 3359 <Char> :: 3357 3357 <CharUnescaped> :: 3357 3357 <Prefix> :: 3360 3363 <Suffix> :: 3360 3363 <Primary> :: 3360 3363 <Literal> :: 3360 3363 <Char> :: 3361 3361 <CharUnescaped> :: 3361 3361 <Prefix> :: 3364 3367 <Suffix> :: 3364 3367 <Primary> :: 3364 3367 <Literal> :: 3364 3367 <Char> :: 3365 3365 <CharUnescaped> :: 3365 3365 <Prefix> :: 3368 3371 <Suffix> :: 3368 3371 <Primary> :: 3368 3371 <Literal> :: 3368 3371 <Char> :: 3369 3369 <CharUnescaped> :: 3369 3369 <Prefix> :: 3372 3375 <Suffix> :: 3372 3375 <Primary> :: 3372 3375 <Literal> :: 3372 3375 <Char> :: 3373 3373 <CharUnescaped> :: 3373 3373 <Prefix> :: 3376 3379 <Suffix> :: 3376 3379 <Primary> :: 3376 3379 <Literal> :: 3376 3379 <Char> :: 3377 3377 <CharUnescaped> :: 3377 3377 <Prefix> :: 3380 3390 <Suffix> :: 3380 3390 <Primary> :: 3380 3390 <Identifier> :: 3380 3390 <Ident> :: 3380 3389 |
Changes to modules/pt/tests/data/ok/peg_peg-fused/3_peg_itself.
︙ | ︙ | |||
19 20 21 22 23 24 25 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<control>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<ddigit>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<digit>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; | < | | | 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 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<control>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<ddigit>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<digit>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; void: EOF <- !. ; void: EOL <- [\n\r] ; Expression <- Sequence (SLASH Sequence)* ; void: Final <- 'END' WHITESPACE SEMICOLON WHITESPACE ; Grammar <- WHITESPACE Header Definition* Final EOF ; leaf: GRAPH <- '<graph>' WHITESPACE ; Header <- PEG Identifier StartExpr ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Identifier <- Ident WHITESPACE ; void: IS <- '<-' WHITESPACE ; leaf: LEAF <- 'leaf' WHITESPACE ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; leaf: LOWER <- '<lower>' WHITESPACE ; leaf: NOT <- '!' WHITESPACE ; void: OPEN <- '(' WHITESPACE ; void: OPENB <- '\[' ; void: PEG <- 'PEG' !([_:] / <alnum>) WHITESPACE ; leaf: PLUS <- '+' WHITESPACE ; Prefix <- (AND / NOT)? Suffix ; Primary <- ALNUM / ALPHA / ASCII / CONTROL / DDIGIT / DIGIT / GRAPH / LOWER / PRINTABLE / PUNCT / SPACE / UPPER / WORDCHAR / XDIGIT / Identifier / OPEN Expression CLOSE / Literal / Class / DOT ; leaf: PRINTABLE <- '<print>' WHITESPACE ; leaf: PUNCT <- '<punct>' WHITESPACE ; leaf: QUESTION <- '?' WHITESPACE ; Range <- Char TO Char / Char ; |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_peg-templated-fused/3_peg_itself.
︙ | ︙ | |||
23 24 25 26 27 28 29 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<control>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<ddigit>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<digit>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; | < | | | 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 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<control>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<ddigit>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<digit>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; void: EOF <- !. ; void: EOL <- [\n\r] ; Expression <- Sequence (SLASH Sequence)* ; void: Final <- 'END' WHITESPACE SEMICOLON WHITESPACE ; Grammar <- WHITESPACE Header Definition* Final EOF ; leaf: GRAPH <- '<graph>' WHITESPACE ; Header <- PEG Identifier StartExpr ; leaf: Ident <- ([_:] / <alpha>) ([_:] / <alnum>)* ; Identifier <- Ident WHITESPACE ; void: IS <- '<-' WHITESPACE ; leaf: LEAF <- 'leaf' WHITESPACE ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; leaf: LOWER <- '<lower>' WHITESPACE ; leaf: NOT <- '!' WHITESPACE ; void: OPEN <- '(' WHITESPACE ; void: OPENB <- '\[' ; void: PEG <- 'PEG' !([_:] / <alnum>) WHITESPACE ; leaf: PLUS <- '+' WHITESPACE ; Prefix <- (AND / NOT)? Suffix ; Primary <- ALNUM / ALPHA / ASCII / CONTROL / DDIGIT / DIGIT / GRAPH / LOWER / PRINTABLE / PUNCT / SPACE / UPPER / WORDCHAR / XDIGIT / Identifier / OPEN Expression CLOSE / Literal / Class / DOT ; leaf: PRINTABLE <- '<print>' WHITESPACE ; leaf: PUNCT <- '<punct>' WHITESPACE ; leaf: QUESTION <- '?' WHITESPACE ; Range <- Char TO Char / Char ; |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_peg-templated/3_peg_itself.
︙ | ︙ | |||
23 24 25 26 27 28 29 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<' 'c' 'o' 'n' 't' 'r' 'o' 'l' '>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<' 'd' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; | < | | | 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 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<' 'c' 'o' 'n' 't' 'r' 'o' 'l' '>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<' 'd' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; void: EOF <- !. ; void: EOL <- '\n' / '\r' ; Expression <- Sequence (SLASH Sequence)* ; void: Final <- 'E' 'N' 'D' WHITESPACE SEMICOLON WHITESPACE ; Grammar <- WHITESPACE Header Definition* Final EOF ; leaf: GRAPH <- '<' 'g' 'r' 'a' 'p' 'h' '>' WHITESPACE ; Header <- PEG Identifier StartExpr ; leaf: Ident <- ('_' / ':' / <alpha>) ('_' / ':' / <alnum>)* ; Identifier <- Ident WHITESPACE ; void: IS <- '<' '-' WHITESPACE ; leaf: LEAF <- 'l' 'e' 'a' 'f' WHITESPACE ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; leaf: LOWER <- '<' 'l' 'o' 'w' 'e' 'r' '>' WHITESPACE ; leaf: NOT <- '!' WHITESPACE ; void: OPEN <- '(' WHITESPACE ; void: OPENB <- '\[' ; void: PEG <- 'P' 'E' 'G' !('_' / ':' / <alnum>) WHITESPACE ; leaf: PLUS <- '+' WHITESPACE ; Prefix <- (AND / NOT)? Suffix ; Primary <- ALNUM / ALPHA / ASCII / CONTROL / DDIGIT / DIGIT / GRAPH / LOWER / PRINTABLE / PUNCT / SPACE / UPPER / WORDCHAR / XDIGIT / Identifier / OPEN Expression CLOSE / Literal / Class / DOT ; leaf: PRINTABLE <- '<' 'p' 'r' 'i' 'n' 't' '>' WHITESPACE ; leaf: PUNCT <- '<' 'p' 'u' 'n' 'c' 't' '>' WHITESPACE ; leaf: QUESTION <- '?' WHITESPACE ; Range <- Char TO Char / Char ; |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_peg/3_peg_itself.
︙ | ︙ | |||
19 20 21 22 23 24 25 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<' 'c' 'o' 'n' 't' 'r' 'o' 'l' '>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<' 'd' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; | < | | | 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 | void: COMMENT <- '#' (!EOL .)* EOL ; leaf: CONTROL <- '<' 'c' 'o' 'n' 't' 'r' 'o' 'l' '>' WHITESPACE ; void: DAPOSTROPH <- '\"' ; leaf: DDIGIT <- '<' 'd' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; Definition <- Attribute? Identifier IS Expression SEMICOLON ; leaf: DIGIT <- '<' 'd' 'i' 'g' 'i' 't' '>' WHITESPACE ; leaf: DOT <- '.' WHITESPACE ; void: EOF <- !. ; void: EOL <- '\n' / '\r' ; Expression <- Sequence (SLASH Sequence)* ; void: Final <- 'E' 'N' 'D' WHITESPACE SEMICOLON WHITESPACE ; Grammar <- WHITESPACE Header Definition* Final EOF ; leaf: GRAPH <- '<' 'g' 'r' 'a' 'p' 'h' '>' WHITESPACE ; Header <- PEG Identifier StartExpr ; leaf: Ident <- ('_' / ':' / <alpha>) ('_' / ':' / <alnum>)* ; Identifier <- Ident WHITESPACE ; void: IS <- '<' '-' WHITESPACE ; leaf: LEAF <- 'l' 'e' 'a' 'f' WHITESPACE ; Literal <- APOSTROPH (!APOSTROPH Char)* APOSTROPH WHITESPACE / DAPOSTROPH (!DAPOSTROPH Char)* DAPOSTROPH WHITESPACE ; leaf: LOWER <- '<' 'l' 'o' 'w' 'e' 'r' '>' WHITESPACE ; leaf: NOT <- '!' WHITESPACE ; void: OPEN <- '(' WHITESPACE ; void: OPENB <- '\[' ; void: PEG <- 'P' 'E' 'G' !('_' / ':' / <alnum>) WHITESPACE ; leaf: PLUS <- '+' WHITESPACE ; Prefix <- (AND / NOT)? Suffix ; Primary <- ALNUM / ALPHA / ASCII / CONTROL / DDIGIT / DIGIT / GRAPH / LOWER / PRINTABLE / PUNCT / SPACE / UPPER / WORDCHAR / XDIGIT / Identifier / OPEN Expression CLOSE / Literal / Class / DOT ; leaf: PRINTABLE <- '<' 'p' 'r' 'i' 'n' 't' '>' WHITESPACE ; leaf: PUNCT <- '<' 'p' 'u' 'n' 'c' 't' '>' WHITESPACE ; leaf: QUESTION <- '?' WHITESPACE ; Range <- Char TO Char / Char ; |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_serial-canonical/3_peg_itself.
|
| | | | 1 2 | pt::grammar::peg {rules {ALNUM {is {x {t <} {t a} {t l} {t n} {t u} {t m} {t >} {n WHITESPACE}} mode leaf} ALPHA {is {x {t <} {t a} {t l} {t p} {t h} {t a} {t >} {n WHITESPACE}} mode leaf} AND {is {x {t &} {n WHITESPACE}} mode leaf} APOSTROPH {is {t '} mode void} ASCII {is {x {t <} {t a} {t s} {t c} {t i} {t i} {t >} {n WHITESPACE}} mode leaf} Attribute {is {x {/ {n VOID} {n LEAF}} {n COLON}} mode value} Char {is {/ {n CharSpecial} {n CharOctalFull} {n CharOctalPart} {n CharUnicode} {n CharUnescaped}} mode value} CharOctalFull {is {x {t \\} {.. 0 2} {.. 0 7} {.. 0 7}} mode leaf} CharOctalPart {is {x {t \\} {.. 0 7} {? {.. 0 7}}} mode leaf} CharSpecial {is {x {t \\} {/ {t n} {t r} {t t} {t '} {t {"}} {t {[}} {t \]} {t \\}}} mode leaf} CharUnescaped {is {x {! {t \\}} dot} mode leaf} CharUnicode {is {x {t \\} {t u} xdigit {? {x xdigit {? {x xdigit {? xdigit}}}}}} mode leaf} Class {is {x {n OPENB} {* {x {! {n CLOSEB}} {n Range}}} {n CLOSEB} {n WHITESPACE}} mode value} CLOSE {is {x {t )} {n WHITESPACE}} mode void} CLOSEB {is {t \]} mode void} COLON {is {x {t :} {n WHITESPACE}} mode void} COMMENT {is {x {t #} {* {x {! {n EOL}} dot}} {n EOL}} mode void} CONTROL {is {x {t <} {t c} {t o} {t n} {t t} {t r} {t o} {t l} {t >} {n WHITESPACE}} mode leaf} DAPOSTROPH {is {t {"}} mode void} DDIGIT {is {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} mode leaf} Definition {is {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}} mode value} DIGIT {is {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} mode leaf} DOT {is {x {t .} {n WHITESPACE}} mode leaf} EOF {is {! dot} mode void} EOL {is {/ {t { }} {t { }}} mode void} Expression {is {x {n Sequence} {* {x {n SLASH} {n Sequence}}}} mode value} Final {is {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}} mode void} Grammar {is {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}} mode value} GRAPH {is {x {t <} {t g} {t r} {t a} {t p} {t h} {t >} {n WHITESPACE}} mode leaf} Header {is {x {n PEG} {n Identifier} {n StartExpr}} mode value} Ident {is {x {/ {t _} {t :} alpha} {* {/ {t _} {t :} alnum}}} mode leaf} Identifier {is {x {n Ident} {n WHITESPACE}} mode value} IS {is {x {t <} {t -} {n WHITESPACE}} mode void} LEAF {is {x {t l} {t e} {t a} {t f} {n WHITESPACE}} mode leaf} Literal {is {/ {x {n APOSTROPH} {* {x {! {n APOSTROPH}} {n Char}}} {n APOSTROPH} {n WHITESPACE}} {x {n DAPOSTROPH} {* {x {! {n DAPOSTROPH}} {n Char}}} {n DAPOSTROPH} {n WHITESPACE}}} mode value} LOWER {is {x {t <} {t l} {t o} {t w} {t e} {t r} {t >} {n WHITESPACE}} mode leaf} NOT {is {x {t !} {n WHITESPACE}} mode leaf} OPEN {is {x {t (} {n WHITESPACE}} mode void} OPENB {is {t {[}} mode void} PEG {is {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}} mode void} PLUS {is {x {t +} {n WHITESPACE}} mode leaf} Prefix {is {x {? {/ {n AND} {n NOT}}} {n Suffix}} mode value} Primary {is {/ {n ALNUM} {n ALPHA} {n ASCII} {n CONTROL} {n DDIGIT} {n DIGIT} {n GRAPH} {n LOWER} {n PRINTABLE} {n PUNCT} {n SPACE} {n UPPER} {n WORDCHAR} {n XDIGIT} {n Identifier} {x {n OPEN} {n Expression} {n CLOSE}} {n Literal} {n Class} {n DOT}} mode value} PRINTABLE {is {x {t <} {t p} {t r} {t i} {t n} {t t} {t >} {n WHITESPACE}} mode leaf} PUNCT {is {x {t <} {t p} {t u} {t n} {t c} {t t} {t >} {n WHITESPACE}} mode leaf} QUESTION {is {x {t ?} {n WHITESPACE}} mode leaf} Range {is {/ {x {n Char} {n TO} {n Char}} {n Char}} mode value} SEMICOLON {is {x {t {;}} {n WHITESPACE}} mode void} Sequence {is {+ {n Prefix}} mode value} SLASH {is {x {t /} {n WHITESPACE}} mode void} SPACE {is {x {t <} {t s} {t p} {t a} {t c} {t e} {t >} {n WHITESPACE}} mode leaf} STAR {is {x {t *} {n WHITESPACE}} mode leaf} StartExpr {is {x {n OPEN} {n Expression} {n CLOSE}} mode value} Suffix {is {x {n Primary} {? {/ {n QUESTION} {n STAR} {n PLUS}}}} mode value} TO {is {t -} mode void} UPPER {is {x {t <} {t u} {t p} {t p} {t e} {t r} {t >} {n WHITESPACE}} mode leaf} VOID {is {x {t v} {t o} {t i} {t d} {n WHITESPACE}} mode leaf} WHITESPACE {is {* {/ space {n COMMENT}}} mode void} WORDCHAR {is {x {t <} {t w} {t o} {t r} {t d} {t c} {t h} {t a} {t r} {t >} {n WHITESPACE}} mode leaf} XDIGIT {is {x {t <} {t x} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}} mode leaf}} start {n Grammar}} |
Changes to modules/pt/tests/data/ok/peg_serial-print/3_peg_itself.
︙ | ︙ | |||
164 165 166 167 168 169 170 | x ? (Attribute) (Identifier) (IS) (Expression) (SEMICOLON) | < < < < < < | > > > | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | x ? (Attribute) (Identifier) (IS) (Expression) (SEMICOLON) EOF :: <void> := ! <dot> EOL :: <void> := / '\n' '\r' Expression :: <value> := x (Sequence) * x (SLASH) (Sequence) Final :: <void> := x 'E' 'N' 'D' (WHITESPACE) (SEMICOLON) (WHITESPACE) GRAPH :: <leaf> := x '<' 'g' 'r' |
︙ | ︙ | |||
284 285 286 287 288 289 290 291 292 293 294 295 296 297 | OPENB :: <void> := '[' PEG :: <void> := x 'P' 'E' 'G' (WHITESPACE) PLUS :: <leaf> := x '+' (WHITESPACE) PRINTABLE :: <leaf> := x | > > > > > | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | OPENB :: <void> := '[' PEG :: <void> := x 'P' 'E' 'G' ! / '_' ':' <alnum> (WHITESPACE) PLUS :: <leaf> := x '+' (WHITESPACE) PRINTABLE :: <leaf> := x |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_serial/3_peg_itself.
︙ | ︙ | |||
19 20 21 22 23 24 25 | CharUnicode {mode leaf is {x {t \134} {t u} xdigit {? {x xdigit {? {x xdigit {? xdigit}}}}}}} Class {mode value is {x {n OPENB} {* {x {! {n CLOSEB}} {n Range}}} {n CLOSEB} {n WHITESPACE}}} DAPOSTROPH {mode void is {t \42}} DDIGIT {mode leaf is {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}}} DIGIT {mode leaf is {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}}} DOT {mode leaf is {x {t .} {n WHITESPACE}}} Definition {mode value is {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}}} | < | | | 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 | CharUnicode {mode leaf is {x {t \134} {t u} xdigit {? {x xdigit {? {x xdigit {? xdigit}}}}}}} Class {mode value is {x {n OPENB} {* {x {! {n CLOSEB}} {n Range}}} {n CLOSEB} {n WHITESPACE}}} DAPOSTROPH {mode void is {t \42}} DDIGIT {mode leaf is {x {t <} {t d} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}}} DIGIT {mode leaf is {x {t <} {t d} {t i} {t g} {t i} {t t} {t >} {n WHITESPACE}}} DOT {mode leaf is {x {t .} {n WHITESPACE}}} Definition {mode value is {x {? {n Attribute}} {n Identifier} {n IS} {n Expression} {n SEMICOLON}}} EOF {mode void is {! dot}} EOL {mode void is {/ {t \n} {t \r}}} Expression {mode value is {x {n Sequence} {* {x {n SLASH} {n Sequence}}}}} Final {mode void is {x {t E} {t N} {t D} {n WHITESPACE} {n SEMICOLON} {n WHITESPACE}}} GRAPH {mode leaf is {x {t <} {t g} {t r} {t a} {t p} {t h} {t >} {n WHITESPACE}}} Grammar {mode value is {x {n WHITESPACE} {n Header} {* {n Definition}} {n Final} {n EOF}}} Header {mode value is {x {n PEG} {n Identifier} {n StartExpr}}} IS {mode void is {x {t <} {t -} {n WHITESPACE}}} Ident {mode leaf is {x {/ {t _} {t :} alpha} {* {/ {t _} {t :} alnum}}}} Identifier {mode value is {x {n Ident} {n WHITESPACE}}} LEAF {mode leaf is {x {t l} {t e} {t a} {t f} {n WHITESPACE}}} LOWER {mode leaf is {x {t <} {t l} {t o} {t w} {t e} {t r} {t >} {n WHITESPACE}}} Literal {mode value is {/ {x {n APOSTROPH} {* {x {! {n APOSTROPH}} {n Char}}} {n APOSTROPH} {n WHITESPACE}} {x {n DAPOSTROPH} {* {x {! {n DAPOSTROPH}} {n Char}}} {n DAPOSTROPH} {n WHITESPACE}}}} NOT {mode leaf is {x {t !} {n WHITESPACE}}} OPEN {mode void is {x {t \50} {n WHITESPACE}}} OPENB {mode void is {t \133}} PEG {mode void is {x {t P} {t E} {t G} {! {/ {t _} {t :} alnum}} {n WHITESPACE}}} PLUS {mode leaf is {x {t +} {n WHITESPACE}}} PRINTABLE {mode leaf is {x {t <} {t p} {t r} {t i} {t n} {t t} {t >} {n WHITESPACE}}} PUNCT {mode leaf is {x {t <} {t p} {t u} {t n} {t c} {t t} {t >} {n WHITESPACE}}} Prefix {mode value is {x {? {/ {n AND} {n NOT}}} {n Suffix}}} Primary {mode value is {/ {n ALNUM} {n ALPHA} {n ASCII} {n CONTROL} {n DDIGIT} {n DIGIT} {n GRAPH} {n LOWER} {n PRINTABLE} {n PUNCT} {n SPACE} {n UPPER} {n WORDCHAR} {n XDIGIT} {n Identifier} {x {n OPEN} {n Expression} {n CLOSE}} {n Literal} {n Class} {n DOT}}} QUESTION {mode leaf is {x {t ?} {n WHITESPACE}}} Range {mode value is {/ {x {n Char} {n TO} {n Char}} {n Char}}} |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_tclparam-snit/3_peg_itself.
︙ | ︙ | |||
946 947 948 949 950 951 952 | $myparser si:next_char . $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | $myparser si:next_char . $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } # # void Symbol 'EOF' # proc sym_EOF {} { upvar 1 myparser myparser # ! # <dot> $myparser si:void_void_symbol_start EOF notahead_157 $myparser si:void_clear_symbol_end EOF return } proc notahead_157 {} { upvar 1 myparser myparser # ! # <dot> $myparser i_loc_push $myparser i_input_next dot $myparser si:void_notahead_exit return |
︙ | ︙ | |||
1024 1025 1026 1027 1028 1029 1030 | # (Sequence) # * # x # (SLASH) # (Sequence) $myparser si:value_symbol_start Expression | | | | | | | | > | | | > > > | | 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | # (Sequence) # * # x # (SLASH) # (Sequence) $myparser si:value_symbol_start Expression sequence_169 $myparser si:reduce_symbol_end Expression return } proc sequence_169 {} { upvar 1 myparser myparser # x # (Sequence) # * # x # (SLASH) # (Sequence) $myparser si:value_state_push sym_Sequence $myparser si:valuevalue_part kleene_167 $myparser si:value_state_merge return } proc kleene_167 {} { upvar 1 myparser myparser # * # x # (SLASH) # (Sequence) while {1} { $myparser si:void2_state_push sequence_165 $myparser si:kleene_close } return } proc sequence_165 {} { upvar 1 myparser myparser # x # (SLASH) # (Sequence) $myparser si:void_state_push sym_SLASH $myparser si:voidvalue_part sym_Sequence $myparser si:value_state_merge return } # # void Symbol 'Final' # proc sym_Final {} { upvar 1 myparser myparser # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) $myparser si:void_void_symbol_start Final sequence_176 $myparser si:void_clear_symbol_end Final return } proc sequence_176 {} { upvar 1 myparser myparser # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str END $myparser si:voidvoid_part sym_WHITESPACE $myparser si:voidvoid_part sym_SEMICOLON $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } |
︙ | ︙ | |||
1118 1119 1120 1121 1122 1123 1124 | # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:value_symbol_start Grammar | | | | | | 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 | # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:value_symbol_start Grammar sequence_186 $myparser si:reduce_symbol_end Grammar return } proc sequence_186 {} { upvar 1 myparser myparser # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) $myparser si:void_state_push sym_WHITESPACE $myparser si:voidvalue_part sym_Header $myparser si:valuevalue_part kleene_182 $myparser si:valuevalue_part sym_Final $myparser si:valuevalue_part sym_EOF $myparser si:value_state_merge return } proc kleene_182 {} { upvar 1 myparser myparser # * # (Definition) while {1} { $myparser si:void2_state_push sym_Definition $myparser si:kleene_close |
︙ | ︙ | |||
1168 1169 1170 1171 1172 1173 1174 | proc sym_GRAPH {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_symbol_start GRAPH | | | | 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | proc sym_GRAPH {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_symbol_start GRAPH sequence_191 $myparser si:void_leaf_symbol_end GRAPH return } proc sequence_191 {} { upvar 1 myparser myparser # x # "<graph>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <graph> $myparser si:voidvoid_part |
︙ | ︙ | |||
1197 1198 1199 1200 1201 1202 1203 | proc sym_Header {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:value_symbol_start Header | | | | 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | proc sym_Header {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:value_symbol_start Header sequence_197 $myparser si:reduce_symbol_end Header return } proc sequence_197 {} { upvar 1 myparser myparser # x # (PEG) # (Identifier) # (StartExpr) $myparser si:void_state_push sym_PEG |
︙ | ︙ | |||
1233 1234 1235 1236 1237 1238 1239 | # <alpha> # * # / # [_:] # <alnum> $myparser si:void_symbol_start Ident | | | | | | | | | | 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | # <alpha> # * # / # [_:] # <alnum> $myparser si:void_symbol_start Ident sequence_210 $myparser si:void_leaf_symbol_end Ident return } proc sequence_210 {} { upvar 1 myparser myparser # x # / # [_:] # <alpha> # * # / # [_:] # <alnum> $myparser si:void_state_push choice_202 $myparser si:voidvoid_part kleene_208 $myparser si:void_state_merge return } proc choice_202 {} { upvar 1 myparser myparser # / # [_:] # <alpha> $myparser si:void_state_push $myparser si:next_class _: $myparser si:voidvoid_branch $myparser si:next_alpha $myparser si:void_state_merge return } proc kleene_208 {} { upvar 1 myparser myparser # * # / # [_:] # <alnum> while {1} { $myparser si:void2_state_push choice_206 $myparser si:kleene_close } return } proc choice_206 {} { upvar 1 myparser myparser # / # [_:] # <alnum> $myparser si:void_state_push $myparser si:next_class _: $myparser si:voidvoid_branch |
︙ | ︙ | |||
1306 1307 1308 1309 1310 1311 1312 | proc sym_Identifier {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_symbol_start Identifier | | | | 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 | proc sym_Identifier {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_symbol_start Identifier sequence_215 $myparser si:reduce_symbol_end Identifier return } proc sequence_215 {} { upvar 1 myparser myparser # x # (Ident) # (WHITESPACE) $myparser si:value_state_push sym_Ident $myparser si:valuevalue_part |
︙ | ︙ | |||
1334 1335 1336 1337 1338 1339 1340 | proc sym_IS {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_void_symbol_start IS | | | | 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 | proc sym_IS {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_void_symbol_start IS sequence_220 $myparser si:void_clear_symbol_end IS return } proc sequence_220 {} { upvar 1 myparser myparser # x # "<-" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <- $myparser si:voidvoid_part |
︙ | ︙ | |||
1362 1363 1364 1365 1366 1367 1368 | proc sym_LEAF {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_symbol_start LEAF | | | | 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | proc sym_LEAF {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_symbol_start LEAF sequence_225 $myparser si:void_leaf_symbol_end LEAF return } proc sequence_225 {} { upvar 1 myparser myparser # x # "leaf" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str leaf $myparser si:voidvoid_part |
︙ | ︙ | |||
1406 1407 1408 1409 1410 1411 1412 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_symbol_start Literal | | | | 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_symbol_start Literal choice_254 $myparser si:reduce_symbol_end Literal return } proc choice_254 {} { upvar 1 myparser myparser # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
1433 1434 1435 1436 1437 1438 1439 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_state_push | | | | | | | | | | | | | | | | | | | | 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:value_state_push sequence_239 $myparser si:valuevalue_branch sequence_252 $myparser si:value_state_merge return } proc sequence_239 {} { upvar 1 myparser myparser # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) $myparser si:void_state_push sym_APOSTROPH $myparser si:voidvalue_part kleene_235 $myparser si:valuevalue_part sym_APOSTROPH $myparser si:valuevalue_part sym_WHITESPACE $myparser si:value_state_merge return } proc kleene_235 {} { upvar 1 myparser myparser # * # x # ! # (APOSTROPH) # (Char) while {1} { $myparser si:void2_state_push sequence_233 $myparser si:kleene_close } return } proc sequence_233 {} { upvar 1 myparser myparser # x # ! # (APOSTROPH) # (Char) $myparser si:void_state_push notahead_230 $myparser si:voidvalue_part sym_Char $myparser si:value_state_merge return } proc notahead_230 {} { upvar 1 myparser myparser # ! # (APOSTROPH) $myparser i_loc_push sym_APOSTROPH $myparser si:void_notahead_exit return } proc sequence_252 {} { upvar 1 myparser myparser # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) $myparser si:void_state_push sym_DAPOSTROPH $myparser si:voidvalue_part kleene_248 $myparser si:valuevalue_part sym_DAPOSTROPH $myparser si:valuevalue_part sym_WHITESPACE $myparser si:value_state_merge return } proc kleene_248 {} { upvar 1 myparser myparser # * # x # ! # (DAPOSTROPH) # (Char) while {1} { $myparser si:void2_state_push sequence_246 $myparser si:kleene_close } return } proc sequence_246 {} { upvar 1 myparser myparser # x # ! # (DAPOSTROPH) # (Char) $myparser si:void_state_push notahead_243 $myparser si:voidvalue_part sym_Char $myparser si:value_state_merge return } proc notahead_243 {} { upvar 1 myparser myparser # ! # (DAPOSTROPH) $myparser i_loc_push sym_DAPOSTROPH $myparser si:void_notahead_exit return } # # leaf Symbol 'LOWER' # proc sym_LOWER {} { upvar 1 myparser myparser # x # "<lower>" # (WHITESPACE) $myparser si:void_symbol_start LOWER sequence_259 $myparser si:void_leaf_symbol_end LOWER return } proc sequence_259 {} { upvar 1 myparser myparser # x # "<lower>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <lower> $myparser si:voidvoid_part |
︙ | ︙ | |||
1602 1603 1604 1605 1606 1607 1608 | proc sym_NOT {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_symbol_start NOT | | | | 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 | proc sym_NOT {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_symbol_start NOT sequence_264 $myparser si:void_leaf_symbol_end NOT return } proc sequence_264 {} { upvar 1 myparser myparser # x # '!' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char ! $myparser si:voidvoid_part |
︙ | ︙ | |||
1630 1631 1632 1633 1634 1635 1636 | proc sym_OPEN {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_void_symbol_start OPEN | | | | 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 | proc sym_OPEN {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_void_symbol_start OPEN sequence_269 $myparser si:void_clear_symbol_end OPEN return } proc sequence_269 {} { upvar 1 myparser myparser # x # '\(' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char \50 $myparser si:voidvoid_part |
︙ | ︙ | |||
1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | # # void Symbol 'PEG' # proc sym_PEG {} { upvar 1 myparser myparser # x # "PEG" # (WHITESPACE) $myparser si:void_void_symbol_start PEG | > > > > | | > > > > > > > > > > > > > > > > > > | | | 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 | # # void Symbol 'PEG' # proc sym_PEG {} { upvar 1 myparser myparser # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) $myparser si:void_void_symbol_start PEG sequence_281 $myparser si:void_clear_symbol_end PEG return } proc sequence_281 {} { upvar 1 myparser myparser # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str PEG $myparser si:voidvoid_part notahead_278 $myparser si:voidvoid_part sym_WHITESPACE $myparser si:void_state_merge return } proc notahead_278 {} { upvar 1 myparser myparser # ! # / # [_:] # <alnum> $myparser i_loc_push choice_206 $myparser si:void_notahead_exit return } # # leaf Symbol 'PLUS' # proc sym_PLUS {} { upvar 1 myparser myparser # x # '+' # (WHITESPACE) $myparser si:void_symbol_start PLUS sequence_286 $myparser si:void_leaf_symbol_end PLUS return } proc sequence_286 {} { upvar 1 myparser myparser # x # '+' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char + $myparser si:voidvoid_part |
︙ | ︙ | |||
1730 1731 1732 1733 1734 1735 1736 | # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_symbol_start Prefix | | | | | | | | 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 | # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_symbol_start Prefix sequence_296 $myparser si:reduce_symbol_end Prefix return } proc sequence_296 {} { upvar 1 myparser myparser # x # ? # / # (AND) # (NOT) # (Suffix) $myparser si:value_state_push optional_293 $myparser si:valuevalue_part sym_Suffix $myparser si:value_state_merge return } proc optional_293 {} { upvar 1 myparser myparser # ? # / # (AND) # (NOT) $myparser si:void2_state_push choice_291 $myparser si:void_state_merge_ok return } proc choice_291 {} { upvar 1 myparser myparser # / # (AND) # (NOT) $myparser si:value_state_push sym_AND $myparser si:valuevalue_branch |
︙ | ︙ | |||
1806 1807 1808 1809 1810 1811 1812 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) $myparser si:value_symbol_start Primary | | | | 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) $myparser si:value_symbol_start Primary choice_322 $myparser si:reduce_symbol_end Primary return } proc choice_322 {} { upvar 1 myparser myparser # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
1867 1868 1869 1870 1871 1872 1873 | $myparser si:valuevalue_branch sym_WORDCHAR $myparser si:valuevalue_branch sym_XDIGIT $myparser si:valuevalue_branch sym_Identifier $myparser si:valuevalue_branch | | | | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 | $myparser si:valuevalue_branch sym_WORDCHAR $myparser si:valuevalue_branch sym_XDIGIT $myparser si:valuevalue_branch sym_Identifier $myparser si:valuevalue_branch sequence_317 $myparser si:valuevalue_branch sym_Literal $myparser si:valuevalue_branch sym_Class $myparser si:valuevalue_branch sym_DOT $myparser si:value_state_merge return } proc sequence_317 {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:void_state_push sym_OPEN |
︙ | ︙ | |||
1904 1905 1906 1907 1908 1909 1910 | proc sym_PRINTABLE {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_symbol_start PRINTABLE | | | | 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 | proc sym_PRINTABLE {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_symbol_start PRINTABLE sequence_327 $myparser si:void_leaf_symbol_end PRINTABLE return } proc sequence_327 {} { upvar 1 myparser myparser # x # "<print>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <print> $myparser si:voidvoid_part |
︙ | ︙ | |||
1932 1933 1934 1935 1936 1937 1938 | proc sym_PUNCT {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_symbol_start PUNCT | | | | 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 | proc sym_PUNCT {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_symbol_start PUNCT sequence_332 $myparser si:void_leaf_symbol_end PUNCT return } proc sequence_332 {} { upvar 1 myparser myparser # x # "<punct>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <punct> $myparser si:voidvoid_part |
︙ | ︙ | |||
1960 1961 1962 1963 1964 1965 1966 | proc sym_QUESTION {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_symbol_start QUESTION | | | | 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 | proc sym_QUESTION {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_symbol_start QUESTION sequence_337 $myparser si:void_leaf_symbol_end QUESTION return } proc sequence_337 {} { upvar 1 myparser myparser # x # '?' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char ? $myparser si:voidvoid_part |
︙ | ︙ | |||
1991 1992 1993 1994 1995 1996 1997 | # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_symbol_start Range | | | | | | 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_symbol_start Range choice_346 $myparser si:reduce_symbol_end Range return } proc choice_346 {} { upvar 1 myparser myparser # / # x # (Char) # (TO) # (Char) # (Char) $myparser si:value_state_push sequence_343 $myparser si:valuevalue_branch sym_Char $myparser si:value_state_merge return } proc sequence_343 {} { upvar 1 myparser myparser # x # (Char) # (TO) # (Char) $myparser si:value_state_push sym_Char |
︙ | ︙ | |||
2038 2039 2040 2041 2042 2043 2044 | proc sym_SEMICOLON {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_void_symbol_start SEMICOLON | | | | 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 | proc sym_SEMICOLON {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_void_symbol_start SEMICOLON sequence_351 $myparser si:void_clear_symbol_end SEMICOLON return } proc sequence_351 {} { upvar 1 myparser myparser # x # ';' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char \73 $myparser si:voidvoid_part |
︙ | ︙ | |||
2065 2066 2067 2068 2069 2070 2071 | # proc sym_Sequence {} { upvar 1 myparser myparser # + # (Prefix) $myparser si:value_symbol_start Sequence | | | | 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 | # proc sym_Sequence {} { upvar 1 myparser myparser # + # (Prefix) $myparser si:value_symbol_start Sequence poskleene_355 $myparser si:reduce_symbol_end Sequence return } proc poskleene_355 {} { upvar 1 myparser myparser # + # (Prefix) $myparser i_loc_push sym_Prefix $myparser si:kleene_abort while {1} { |
︙ | ︙ | |||
2095 2096 2097 2098 2099 2100 2101 | proc sym_SLASH {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_void_symbol_start SLASH | | | | 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 | proc sym_SLASH {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_void_symbol_start SLASH sequence_360 $myparser si:void_clear_symbol_end SLASH return } proc sequence_360 {} { upvar 1 myparser myparser # x # '/' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char / $myparser si:voidvoid_part |
︙ | ︙ | |||
2123 2124 2125 2126 2127 2128 2129 | proc sym_SPACE {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_symbol_start SPACE | | | | 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 | proc sym_SPACE {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_symbol_start SPACE sequence_365 $myparser si:void_leaf_symbol_end SPACE return } proc sequence_365 {} { upvar 1 myparser myparser # x # "<space>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <space> $myparser si:voidvoid_part |
︙ | ︙ | |||
2151 2152 2153 2154 2155 2156 2157 | proc sym_STAR {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_symbol_start STAR | | | | 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 | proc sym_STAR {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_symbol_start STAR sequence_370 $myparser si:void_leaf_symbol_end STAR return } proc sequence_370 {} { upvar 1 myparser myparser # x # '*' # (WHITESPACE) $myparser si:void_state_push $myparser si:next_char * $myparser si:voidvoid_part |
︙ | ︙ | |||
2180 2181 2182 2183 2184 2185 2186 | proc sym_StartExpr {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:value_symbol_start StartExpr | | | | | | | | | 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 | proc sym_StartExpr {} { upvar 1 myparser myparser # x # (OPEN) # (Expression) # (CLOSE) $myparser si:value_symbol_start StartExpr sequence_317 $myparser si:reduce_symbol_end StartExpr return } # # value Symbol 'Suffix' # proc sym_Suffix {} { upvar 1 myparser myparser # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_symbol_start Suffix sequence_386 $myparser si:reduce_symbol_end Suffix return } proc sequence_386 {} { upvar 1 myparser myparser # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_state_push sym_Primary $myparser si:valuevalue_part optional_384 $myparser si:value_state_merge return } proc optional_384 {} { upvar 1 myparser myparser # ? # / # (QUESTION) # (STAR) # (PLUS) $myparser si:void2_state_push choice_382 $myparser si:void_state_merge_ok return } proc choice_382 {} { upvar 1 myparser myparser # / # (QUESTION) # (STAR) # (PLUS) $myparser si:value_state_push sym_QUESTION |
︙ | ︙ | |||
2273 2274 2275 2276 2277 2278 2279 | proc sym_UPPER {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_symbol_start UPPER | | | | 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 | proc sym_UPPER {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_symbol_start UPPER sequence_393 $myparser si:void_leaf_symbol_end UPPER return } proc sequence_393 {} { upvar 1 myparser myparser # x # "<upper>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <upper> $myparser si:voidvoid_part |
︙ | ︙ | |||
2301 2302 2303 2304 2305 2306 2307 | proc sym_VOID {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_symbol_start VOID | | | | 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 | proc sym_VOID {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_symbol_start VOID sequence_398 $myparser si:void_leaf_symbol_end VOID return } proc sequence_398 {} { upvar 1 myparser myparser # x # "void" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str void $myparser si:voidvoid_part |
︙ | ︙ | |||
2330 2331 2332 2333 2334 2335 2336 | proc sym_WHITESPACE {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) $myparser si:void_void_symbol_start WHITESPACE | | | | | | 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 | proc sym_WHITESPACE {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) $myparser si:void_void_symbol_start WHITESPACE kleene_405 $myparser si:void_clear_symbol_end WHITESPACE return } proc kleene_405 {} { upvar 1 myparser myparser # * # / # <space> # (COMMENT) while {1} { $myparser si:void2_state_push choice_403 $myparser si:kleene_close } return } proc choice_403 {} { upvar 1 myparser myparser # / # <space> # (COMMENT) $myparser si:void_state_push $myparser si:next_space $myparser si:voidvoid_branch |
︙ | ︙ | |||
2372 2373 2374 2375 2376 2377 2378 | proc sym_WORDCHAR {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_symbol_start WORDCHAR | | | | 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 | proc sym_WORDCHAR {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_symbol_start WORDCHAR sequence_410 $myparser si:void_leaf_symbol_end WORDCHAR return } proc sequence_410 {} { upvar 1 myparser myparser # x # "<wordchar>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <wordchar> $myparser si:voidvoid_part |
︙ | ︙ | |||
2400 2401 2402 2403 2404 2405 2406 | proc sym_XDIGIT {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_symbol_start XDIGIT | | | | 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 | proc sym_XDIGIT {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_symbol_start XDIGIT sequence_415 $myparser si:void_leaf_symbol_end XDIGIT return } proc sequence_415 {} { upvar 1 myparser myparser # x # "<xdigit>" # (WHITESPACE) $myparser si:void_state_push $myparser si:next_str <xdigit> $myparser si:voidvoid_part |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_tclparam-tcloo/3_peg_itself.
︙ | ︙ | |||
932 933 934 935 936 937 938 | my si:next_char . my si:voidvoid_part my sym_WHITESPACE my si:void_state_merge return } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | my si:next_char . my si:voidvoid_part my sym_WHITESPACE my si:void_state_merge return } # # void Symbol 'EOF' # method sym_EOF {} { # ! # <dot> my si:void_void_symbol_start EOF my notahead_157 my si:void_clear_symbol_end EOF return } method notahead_157 {} { # ! # <dot> my i_loc_push my i_input_next dot my si:void_notahead_exit return |
︙ | ︙ | |||
1010 1011 1012 1013 1014 1015 1016 | # (Sequence) # * # x # (SLASH) # (Sequence) my si:value_symbol_start Expression | | | | | | | | > | | | > > > | | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | # (Sequence) # * # x # (SLASH) # (Sequence) my si:value_symbol_start Expression my sequence_169 my si:reduce_symbol_end Expression return } method sequence_169 {} { # x # (Sequence) # * # x # (SLASH) # (Sequence) my si:value_state_push my sym_Sequence my si:valuevalue_part my kleene_167 my si:value_state_merge return } method kleene_167 {} { # * # x # (SLASH) # (Sequence) while {1} { my si:void2_state_push my sequence_165 my si:kleene_close } return } method sequence_165 {} { # x # (SLASH) # (Sequence) my si:void_state_push my sym_SLASH my si:voidvalue_part my sym_Sequence my si:value_state_merge return } # # void Symbol 'Final' # method sym_Final {} { # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) my si:void_void_symbol_start Final my sequence_176 my si:void_clear_symbol_end Final return } method sequence_176 {} { # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) my si:void_state_push my si:next_str END my si:voidvoid_part my sym_WHITESPACE my si:voidvoid_part my sym_SEMICOLON my si:voidvoid_part my sym_WHITESPACE my si:void_state_merge return } |
︙ | ︙ | |||
1104 1105 1106 1107 1108 1109 1110 | # (Header) # * # (Definition) # (Final) # (EOF) my si:value_symbol_start Grammar | | | | | | 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | # (Header) # * # (Definition) # (Final) # (EOF) my si:value_symbol_start Grammar my sequence_186 my si:reduce_symbol_end Grammar return } method sequence_186 {} { # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) my si:void_state_push my sym_WHITESPACE my si:voidvalue_part my sym_Header my si:valuevalue_part my kleene_182 my si:valuevalue_part my sym_Final my si:valuevalue_part my sym_EOF my si:value_state_merge return } method kleene_182 {} { # * # (Definition) while {1} { my si:void2_state_push my sym_Definition my si:kleene_close |
︙ | ︙ | |||
1154 1155 1156 1157 1158 1159 1160 | method sym_GRAPH {} { # x # "<graph>" # (WHITESPACE) my si:void_symbol_start GRAPH | | | | 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 | method sym_GRAPH {} { # x # "<graph>" # (WHITESPACE) my si:void_symbol_start GRAPH my sequence_191 my si:void_leaf_symbol_end GRAPH return } method sequence_191 {} { # x # "<graph>" # (WHITESPACE) my si:void_state_push my si:next_str <graph> my si:voidvoid_part |
︙ | ︙ | |||
1183 1184 1185 1186 1187 1188 1189 | method sym_Header {} { # x # (PEG) # (Identifier) # (StartExpr) my si:value_symbol_start Header | | | | 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 | method sym_Header {} { # x # (PEG) # (Identifier) # (StartExpr) my si:value_symbol_start Header my sequence_197 my si:reduce_symbol_end Header return } method sequence_197 {} { # x # (PEG) # (Identifier) # (StartExpr) my si:void_state_push my sym_PEG |
︙ | ︙ | |||
1219 1220 1221 1222 1223 1224 1225 | # <alpha> # * # / # [_:] # <alnum> my si:void_symbol_start Ident | | | | | | | | | | 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | # <alpha> # * # / # [_:] # <alnum> my si:void_symbol_start Ident my sequence_210 my si:void_leaf_symbol_end Ident return } method sequence_210 {} { # x # / # [_:] # <alpha> # * # / # [_:] # <alnum> my si:void_state_push my choice_202 my si:voidvoid_part my kleene_208 my si:void_state_merge return } method choice_202 {} { # / # [_:] # <alpha> my si:void_state_push my si:next_class _: my si:voidvoid_branch my si:next_alpha my si:void_state_merge return } method kleene_208 {} { # * # / # [_:] # <alnum> while {1} { my si:void2_state_push my choice_206 my si:kleene_close } return } method choice_206 {} { # / # [_:] # <alnum> my si:void_state_push my si:next_class _: my si:voidvoid_branch |
︙ | ︙ | |||
1292 1293 1294 1295 1296 1297 1298 | method sym_Identifier {} { # x # (Ident) # (WHITESPACE) my si:value_symbol_start Identifier | | | | 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | method sym_Identifier {} { # x # (Ident) # (WHITESPACE) my si:value_symbol_start Identifier my sequence_215 my si:reduce_symbol_end Identifier return } method sequence_215 {} { # x # (Ident) # (WHITESPACE) my si:value_state_push my sym_Ident my si:valuevalue_part |
︙ | ︙ | |||
1320 1321 1322 1323 1324 1325 1326 | method sym_IS {} { # x # "<-" # (WHITESPACE) my si:void_void_symbol_start IS | | | | 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 | method sym_IS {} { # x # "<-" # (WHITESPACE) my si:void_void_symbol_start IS my sequence_220 my si:void_clear_symbol_end IS return } method sequence_220 {} { # x # "<-" # (WHITESPACE) my si:void_state_push my si:next_str <- my si:voidvoid_part |
︙ | ︙ | |||
1348 1349 1350 1351 1352 1353 1354 | method sym_LEAF {} { # x # "leaf" # (WHITESPACE) my si:void_symbol_start LEAF | | | | 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 | method sym_LEAF {} { # x # "leaf" # (WHITESPACE) my si:void_symbol_start LEAF my sequence_225 my si:void_leaf_symbol_end LEAF return } method sequence_225 {} { # x # "leaf" # (WHITESPACE) my si:void_state_push my si:next_str leaf my si:voidvoid_part |
︙ | ︙ | |||
1392 1393 1394 1395 1396 1397 1398 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) my si:value_symbol_start Literal | | | | 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) my si:value_symbol_start Literal my choice_254 my si:reduce_symbol_end Literal return } method choice_254 {} { # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
1419 1420 1421 1422 1423 1424 1425 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) my si:value_state_push | | | | | | | | | | | | | | | | | | | | 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) my si:value_state_push my sequence_239 my si:valuevalue_branch my sequence_252 my si:value_state_merge return } method sequence_239 {} { # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) my si:void_state_push my sym_APOSTROPH my si:voidvalue_part my kleene_235 my si:valuevalue_part my sym_APOSTROPH my si:valuevalue_part my sym_WHITESPACE my si:value_state_merge return } method kleene_235 {} { # * # x # ! # (APOSTROPH) # (Char) while {1} { my si:void2_state_push my sequence_233 my si:kleene_close } return } method sequence_233 {} { # x # ! # (APOSTROPH) # (Char) my si:void_state_push my notahead_230 my si:voidvalue_part my sym_Char my si:value_state_merge return } method notahead_230 {} { # ! # (APOSTROPH) my i_loc_push my sym_APOSTROPH my si:void_notahead_exit return } method sequence_252 {} { # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) my si:void_state_push my sym_DAPOSTROPH my si:voidvalue_part my kleene_248 my si:valuevalue_part my sym_DAPOSTROPH my si:valuevalue_part my sym_WHITESPACE my si:value_state_merge return } method kleene_248 {} { # * # x # ! # (DAPOSTROPH) # (Char) while {1} { my si:void2_state_push my sequence_246 my si:kleene_close } return } method sequence_246 {} { # x # ! # (DAPOSTROPH) # (Char) my si:void_state_push my notahead_243 my si:voidvalue_part my sym_Char my si:value_state_merge return } method notahead_243 {} { # ! # (DAPOSTROPH) my i_loc_push my sym_DAPOSTROPH my si:void_notahead_exit return } # # leaf Symbol 'LOWER' # method sym_LOWER {} { # x # "<lower>" # (WHITESPACE) my si:void_symbol_start LOWER my sequence_259 my si:void_leaf_symbol_end LOWER return } method sequence_259 {} { # x # "<lower>" # (WHITESPACE) my si:void_state_push my si:next_str <lower> my si:voidvoid_part |
︙ | ︙ | |||
1588 1589 1590 1591 1592 1593 1594 | method sym_NOT {} { # x # '!' # (WHITESPACE) my si:void_symbol_start NOT | | | | 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 | method sym_NOT {} { # x # '!' # (WHITESPACE) my si:void_symbol_start NOT my sequence_264 my si:void_leaf_symbol_end NOT return } method sequence_264 {} { # x # '!' # (WHITESPACE) my si:void_state_push my si:next_char ! my si:voidvoid_part |
︙ | ︙ | |||
1616 1617 1618 1619 1620 1621 1622 | method sym_OPEN {} { # x # '\(' # (WHITESPACE) my si:void_void_symbol_start OPEN | | | | 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 | method sym_OPEN {} { # x # '\(' # (WHITESPACE) my si:void_void_symbol_start OPEN my sequence_269 my si:void_clear_symbol_end OPEN return } method sequence_269 {} { # x # '\(' # (WHITESPACE) my si:void_state_push my si:next_char \50 my si:voidvoid_part |
︙ | ︙ | |||
1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 | # # void Symbol 'PEG' # method sym_PEG {} { # x # "PEG" # (WHITESPACE) my si:void_void_symbol_start PEG | > > > > | | > > > > > > > > > > > > > > > > > > | | | 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | # # void Symbol 'PEG' # method sym_PEG {} { # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) my si:void_void_symbol_start PEG my sequence_281 my si:void_clear_symbol_end PEG return } method sequence_281 {} { # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) my si:void_state_push my si:next_str PEG my si:voidvoid_part my notahead_278 my si:voidvoid_part my sym_WHITESPACE my si:void_state_merge return } method notahead_278 {} { # ! # / # [_:] # <alnum> my i_loc_push my choice_206 my si:void_notahead_exit return } # # leaf Symbol 'PLUS' # method sym_PLUS {} { # x # '+' # (WHITESPACE) my si:void_symbol_start PLUS my sequence_286 my si:void_leaf_symbol_end PLUS return } method sequence_286 {} { # x # '+' # (WHITESPACE) my si:void_state_push my si:next_char + my si:voidvoid_part |
︙ | ︙ | |||
1716 1717 1718 1719 1720 1721 1722 | # ? # / # (AND) # (NOT) # (Suffix) my si:value_symbol_start Prefix | | | | | | | | 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | # ? # / # (AND) # (NOT) # (Suffix) my si:value_symbol_start Prefix my sequence_296 my si:reduce_symbol_end Prefix return } method sequence_296 {} { # x # ? # / # (AND) # (NOT) # (Suffix) my si:value_state_push my optional_293 my si:valuevalue_part my sym_Suffix my si:value_state_merge return } method optional_293 {} { # ? # / # (AND) # (NOT) my si:void2_state_push my choice_291 my si:void_state_merge_ok return } method choice_291 {} { # / # (AND) # (NOT) my si:value_state_push my sym_AND my si:valuevalue_branch |
︙ | ︙ | |||
1792 1793 1794 1795 1796 1797 1798 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) my si:value_symbol_start Primary | | | | 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) my si:value_symbol_start Primary my choice_322 my si:reduce_symbol_end Primary return } method choice_322 {} { # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
1853 1854 1855 1856 1857 1858 1859 | my si:valuevalue_branch my sym_WORDCHAR my si:valuevalue_branch my sym_XDIGIT my si:valuevalue_branch my sym_Identifier my si:valuevalue_branch | | | | 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 | my si:valuevalue_branch my sym_WORDCHAR my si:valuevalue_branch my sym_XDIGIT my si:valuevalue_branch my sym_Identifier my si:valuevalue_branch my sequence_317 my si:valuevalue_branch my sym_Literal my si:valuevalue_branch my sym_Class my si:valuevalue_branch my sym_DOT my si:value_state_merge return } method sequence_317 {} { # x # (OPEN) # (Expression) # (CLOSE) my si:void_state_push my sym_OPEN |
︙ | ︙ | |||
1890 1891 1892 1893 1894 1895 1896 | method sym_PRINTABLE {} { # x # "<print>" # (WHITESPACE) my si:void_symbol_start PRINTABLE | | | | 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 | method sym_PRINTABLE {} { # x # "<print>" # (WHITESPACE) my si:void_symbol_start PRINTABLE my sequence_327 my si:void_leaf_symbol_end PRINTABLE return } method sequence_327 {} { # x # "<print>" # (WHITESPACE) my si:void_state_push my si:next_str <print> my si:voidvoid_part |
︙ | ︙ | |||
1918 1919 1920 1921 1922 1923 1924 | method sym_PUNCT {} { # x # "<punct>" # (WHITESPACE) my si:void_symbol_start PUNCT | | | | 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 | method sym_PUNCT {} { # x # "<punct>" # (WHITESPACE) my si:void_symbol_start PUNCT my sequence_332 my si:void_leaf_symbol_end PUNCT return } method sequence_332 {} { # x # "<punct>" # (WHITESPACE) my si:void_state_push my si:next_str <punct> my si:voidvoid_part |
︙ | ︙ | |||
1946 1947 1948 1949 1950 1951 1952 | method sym_QUESTION {} { # x # '?' # (WHITESPACE) my si:void_symbol_start QUESTION | | | | 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 | method sym_QUESTION {} { # x # '?' # (WHITESPACE) my si:void_symbol_start QUESTION my sequence_337 my si:void_leaf_symbol_end QUESTION return } method sequence_337 {} { # x # '?' # (WHITESPACE) my si:void_state_push my si:next_char ? my si:voidvoid_part |
︙ | ︙ | |||
1977 1978 1979 1980 1981 1982 1983 | # x # (Char) # (TO) # (Char) # (Char) my si:value_symbol_start Range | | | | | | 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 | # x # (Char) # (TO) # (Char) # (Char) my si:value_symbol_start Range my choice_346 my si:reduce_symbol_end Range return } method choice_346 {} { # / # x # (Char) # (TO) # (Char) # (Char) my si:value_state_push my sequence_343 my si:valuevalue_branch my sym_Char my si:value_state_merge return } method sequence_343 {} { # x # (Char) # (TO) # (Char) my si:value_state_push my sym_Char |
︙ | ︙ | |||
2024 2025 2026 2027 2028 2029 2030 | method sym_SEMICOLON {} { # x # ';' # (WHITESPACE) my si:void_void_symbol_start SEMICOLON | | | | 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 | method sym_SEMICOLON {} { # x # ';' # (WHITESPACE) my si:void_void_symbol_start SEMICOLON my sequence_351 my si:void_clear_symbol_end SEMICOLON return } method sequence_351 {} { # x # ';' # (WHITESPACE) my si:void_state_push my si:next_char \73 my si:voidvoid_part |
︙ | ︙ | |||
2051 2052 2053 2054 2055 2056 2057 | # method sym_Sequence {} { # + # (Prefix) my si:value_symbol_start Sequence | | | | 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 | # method sym_Sequence {} { # + # (Prefix) my si:value_symbol_start Sequence my poskleene_355 my si:reduce_symbol_end Sequence return } method poskleene_355 {} { # + # (Prefix) my i_loc_push my sym_Prefix my si:kleene_abort while {1} { |
︙ | ︙ | |||
2081 2082 2083 2084 2085 2086 2087 | method sym_SLASH {} { # x # '/' # (WHITESPACE) my si:void_void_symbol_start SLASH | | | | 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 | method sym_SLASH {} { # x # '/' # (WHITESPACE) my si:void_void_symbol_start SLASH my sequence_360 my si:void_clear_symbol_end SLASH return } method sequence_360 {} { # x # '/' # (WHITESPACE) my si:void_state_push my si:next_char / my si:voidvoid_part |
︙ | ︙ | |||
2109 2110 2111 2112 2113 2114 2115 | method sym_SPACE {} { # x # "<space>" # (WHITESPACE) my si:void_symbol_start SPACE | | | | 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 | method sym_SPACE {} { # x # "<space>" # (WHITESPACE) my si:void_symbol_start SPACE my sequence_365 my si:void_leaf_symbol_end SPACE return } method sequence_365 {} { # x # "<space>" # (WHITESPACE) my si:void_state_push my si:next_str <space> my si:voidvoid_part |
︙ | ︙ | |||
2137 2138 2139 2140 2141 2142 2143 | method sym_STAR {} { # x # '*' # (WHITESPACE) my si:void_symbol_start STAR | | | | 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 | method sym_STAR {} { # x # '*' # (WHITESPACE) my si:void_symbol_start STAR my sequence_370 my si:void_leaf_symbol_end STAR return } method sequence_370 {} { # x # '*' # (WHITESPACE) my si:void_state_push my si:next_char * my si:voidvoid_part |
︙ | ︙ | |||
2166 2167 2168 2169 2170 2171 2172 | method sym_StartExpr {} { # x # (OPEN) # (Expression) # (CLOSE) my si:value_symbol_start StartExpr | | | | | | | | | 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 | method sym_StartExpr {} { # x # (OPEN) # (Expression) # (CLOSE) my si:value_symbol_start StartExpr my sequence_317 my si:reduce_symbol_end StartExpr return } # # value Symbol 'Suffix' # method sym_Suffix {} { # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) my si:value_symbol_start Suffix my sequence_386 my si:reduce_symbol_end Suffix return } method sequence_386 {} { # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) my si:value_state_push my sym_Primary my si:valuevalue_part my optional_384 my si:value_state_merge return } method optional_384 {} { # ? # / # (QUESTION) # (STAR) # (PLUS) my si:void2_state_push my choice_382 my si:void_state_merge_ok return } method choice_382 {} { # / # (QUESTION) # (STAR) # (PLUS) my si:value_state_push my sym_QUESTION |
︙ | ︙ | |||
2259 2260 2261 2262 2263 2264 2265 | method sym_UPPER {} { # x # "<upper>" # (WHITESPACE) my si:void_symbol_start UPPER | | | | 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 | method sym_UPPER {} { # x # "<upper>" # (WHITESPACE) my si:void_symbol_start UPPER my sequence_393 my si:void_leaf_symbol_end UPPER return } method sequence_393 {} { # x # "<upper>" # (WHITESPACE) my si:void_state_push my si:next_str <upper> my si:voidvoid_part |
︙ | ︙ | |||
2287 2288 2289 2290 2291 2292 2293 | method sym_VOID {} { # x # "void" # (WHITESPACE) my si:void_symbol_start VOID | | | | 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 | method sym_VOID {} { # x # "void" # (WHITESPACE) my si:void_symbol_start VOID my sequence_398 my si:void_leaf_symbol_end VOID return } method sequence_398 {} { # x # "void" # (WHITESPACE) my si:void_state_push my si:next_str void my si:voidvoid_part |
︙ | ︙ | |||
2316 2317 2318 2319 2320 2321 2322 | method sym_WHITESPACE {} { # * # / # <space> # (COMMENT) my si:void_void_symbol_start WHITESPACE | | | | | | 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 | method sym_WHITESPACE {} { # * # / # <space> # (COMMENT) my si:void_void_symbol_start WHITESPACE my kleene_405 my si:void_clear_symbol_end WHITESPACE return } method kleene_405 {} { # * # / # <space> # (COMMENT) while {1} { my si:void2_state_push my choice_403 my si:kleene_close } return } method choice_403 {} { # / # <space> # (COMMENT) my si:void_state_push my si:next_space my si:voidvoid_branch |
︙ | ︙ | |||
2358 2359 2360 2361 2362 2363 2364 | method sym_WORDCHAR {} { # x # "<wordchar>" # (WHITESPACE) my si:void_symbol_start WORDCHAR | | | | 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 | method sym_WORDCHAR {} { # x # "<wordchar>" # (WHITESPACE) my si:void_symbol_start WORDCHAR my sequence_410 my si:void_leaf_symbol_end WORDCHAR return } method sequence_410 {} { # x # "<wordchar>" # (WHITESPACE) my si:void_state_push my si:next_str <wordchar> my si:voidvoid_part |
︙ | ︙ | |||
2386 2387 2388 2389 2390 2391 2392 | method sym_XDIGIT {} { # x # "<xdigit>" # (WHITESPACE) my si:void_symbol_start XDIGIT | | | | 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 | method sym_XDIGIT {} { # x # "<xdigit>" # (WHITESPACE) my si:void_symbol_start XDIGIT my sequence_415 my si:void_leaf_symbol_end XDIGIT return } method sequence_415 {} { # x # "<xdigit>" # (WHITESPACE) my si:void_state_push my si:next_str <xdigit> my si:voidvoid_part |
︙ | ︙ |
Changes to modules/pt/tests/data/ok/peg_tclparam/3_peg_itself.
︙ | ︙ | |||
889 890 891 892 893 894 895 | <<runtime>> si:next_char . <<runtime>> si:voidvoid_part <<self>> sym_WHITESPACE <<runtime>> si:void_state_merge return } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | <<runtime>> si:next_char . <<runtime>> si:voidvoid_part <<self>> sym_WHITESPACE <<runtime>> si:void_state_merge return } # # void Symbol 'EOF' # <<def>> <<ns>>sym_EOF {} { # ! # <dot> <<runtime>> si:void_void_symbol_start EOF <<self>> notahead_157 <<runtime>> si:void_clear_symbol_end EOF return } <<def>> <<ns>>notahead_157 {} { # ! # <dot> <<runtime>> i_loc_push <<runtime>> i_input_next dot <<runtime>> si:void_notahead_exit return |
︙ | ︙ | |||
967 968 969 970 971 972 973 | # (Sequence) # * # x # (SLASH) # (Sequence) <<runtime>> si:value_symbol_start Expression | | | | | | | | > | | | > > > | | 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | # (Sequence) # * # x # (SLASH) # (Sequence) <<runtime>> si:value_symbol_start Expression <<self>> sequence_169 <<runtime>> si:reduce_symbol_end Expression return } <<def>> <<ns>>sequence_169 {} { # x # (Sequence) # * # x # (SLASH) # (Sequence) <<runtime>> si:value_state_push <<self>> sym_Sequence <<runtime>> si:valuevalue_part <<self>> kleene_167 <<runtime>> si:value_state_merge return } <<def>> <<ns>>kleene_167 {} { # * # x # (SLASH) # (Sequence) while {1} { <<runtime>> si:void2_state_push <<self>> sequence_165 <<runtime>> si:kleene_close } return } <<def>> <<ns>>sequence_165 {} { # x # (SLASH) # (Sequence) <<runtime>> si:void_state_push <<self>> sym_SLASH <<runtime>> si:voidvalue_part <<self>> sym_Sequence <<runtime>> si:value_state_merge return } # # void Symbol 'Final' # <<def>> <<ns>>sym_Final {} { # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) <<runtime>> si:void_void_symbol_start Final <<self>> sequence_176 <<runtime>> si:void_clear_symbol_end Final return } <<def>> <<ns>>sequence_176 {} { # x # "END" # (WHITESPACE) # (SEMICOLON) # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str END <<runtime>> si:voidvoid_part <<self>> sym_WHITESPACE <<runtime>> si:voidvoid_part <<self>> sym_SEMICOLON <<runtime>> si:voidvoid_part <<self>> sym_WHITESPACE <<runtime>> si:void_state_merge return } |
︙ | ︙ | |||
1061 1062 1063 1064 1065 1066 1067 | # (Header) # * # (Definition) # (Final) # (EOF) <<runtime>> si:value_symbol_start Grammar | | | | | | 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | # (Header) # * # (Definition) # (Final) # (EOF) <<runtime>> si:value_symbol_start Grammar <<self>> sequence_186 <<runtime>> si:reduce_symbol_end Grammar return } <<def>> <<ns>>sequence_186 {} { # x # (WHITESPACE) # (Header) # * # (Definition) # (Final) # (EOF) <<runtime>> si:void_state_push <<self>> sym_WHITESPACE <<runtime>> si:voidvalue_part <<self>> sym_Header <<runtime>> si:valuevalue_part <<self>> kleene_182 <<runtime>> si:valuevalue_part <<self>> sym_Final <<runtime>> si:valuevalue_part <<self>> sym_EOF <<runtime>> si:value_state_merge return } <<def>> <<ns>>kleene_182 {} { # * # (Definition) while {1} { <<runtime>> si:void2_state_push <<self>> sym_Definition <<runtime>> si:kleene_close |
︙ | ︙ | |||
1111 1112 1113 1114 1115 1116 1117 | <<def>> <<ns>>sym_GRAPH {} { # x # "<graph>" # (WHITESPACE) <<runtime>> si:void_symbol_start GRAPH | | | | 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | <<def>> <<ns>>sym_GRAPH {} { # x # "<graph>" # (WHITESPACE) <<runtime>> si:void_symbol_start GRAPH <<self>> sequence_191 <<runtime>> si:void_leaf_symbol_end GRAPH return } <<def>> <<ns>>sequence_191 {} { # x # "<graph>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <graph> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1140 1141 1142 1143 1144 1145 1146 | <<def>> <<ns>>sym_Header {} { # x # (PEG) # (Identifier) # (StartExpr) <<runtime>> si:value_symbol_start Header | | | | 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 | <<def>> <<ns>>sym_Header {} { # x # (PEG) # (Identifier) # (StartExpr) <<runtime>> si:value_symbol_start Header <<self>> sequence_197 <<runtime>> si:reduce_symbol_end Header return } <<def>> <<ns>>sequence_197 {} { # x # (PEG) # (Identifier) # (StartExpr) <<runtime>> si:void_state_push <<self>> sym_PEG |
︙ | ︙ | |||
1176 1177 1178 1179 1180 1181 1182 | # <alpha> # * # / # [_:] # <alnum> <<runtime>> si:void_symbol_start Ident | | | | | | | | | | 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 | # <alpha> # * # / # [_:] # <alnum> <<runtime>> si:void_symbol_start Ident <<self>> sequence_210 <<runtime>> si:void_leaf_symbol_end Ident return } <<def>> <<ns>>sequence_210 {} { # x # / # [_:] # <alpha> # * # / # [_:] # <alnum> <<runtime>> si:void_state_push <<self>> choice_202 <<runtime>> si:voidvoid_part <<self>> kleene_208 <<runtime>> si:void_state_merge return } <<def>> <<ns>>choice_202 {} { # / # [_:] # <alpha> <<runtime>> si:void_state_push <<runtime>> si:next_class _: <<runtime>> si:voidvoid_branch <<runtime>> si:next_alpha <<runtime>> si:void_state_merge return } <<def>> <<ns>>kleene_208 {} { # * # / # [_:] # <alnum> while {1} { <<runtime>> si:void2_state_push <<self>> choice_206 <<runtime>> si:kleene_close } return } <<def>> <<ns>>choice_206 {} { # / # [_:] # <alnum> <<runtime>> si:void_state_push <<runtime>> si:next_class _: <<runtime>> si:voidvoid_branch |
︙ | ︙ | |||
1249 1250 1251 1252 1253 1254 1255 | <<def>> <<ns>>sym_Identifier {} { # x # (Ident) # (WHITESPACE) <<runtime>> si:value_symbol_start Identifier | | | | 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 | <<def>> <<ns>>sym_Identifier {} { # x # (Ident) # (WHITESPACE) <<runtime>> si:value_symbol_start Identifier <<self>> sequence_215 <<runtime>> si:reduce_symbol_end Identifier return } <<def>> <<ns>>sequence_215 {} { # x # (Ident) # (WHITESPACE) <<runtime>> si:value_state_push <<self>> sym_Ident <<runtime>> si:valuevalue_part |
︙ | ︙ | |||
1277 1278 1279 1280 1281 1282 1283 | <<def>> <<ns>>sym_IS {} { # x # "<-" # (WHITESPACE) <<runtime>> si:void_void_symbol_start IS | | | | 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 | <<def>> <<ns>>sym_IS {} { # x # "<-" # (WHITESPACE) <<runtime>> si:void_void_symbol_start IS <<self>> sequence_220 <<runtime>> si:void_clear_symbol_end IS return } <<def>> <<ns>>sequence_220 {} { # x # "<-" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <- <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1305 1306 1307 1308 1309 1310 1311 | <<def>> <<ns>>sym_LEAF {} { # x # "leaf" # (WHITESPACE) <<runtime>> si:void_symbol_start LEAF | | | | 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 | <<def>> <<ns>>sym_LEAF {} { # x # "leaf" # (WHITESPACE) <<runtime>> si:void_symbol_start LEAF <<self>> sequence_225 <<runtime>> si:void_leaf_symbol_end LEAF return } <<def>> <<ns>>sequence_225 {} { # x # "leaf" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str leaf <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1349 1350 1351 1352 1353 1354 1355 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) <<runtime>> si:value_symbol_start Literal | | | | 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) <<runtime>> si:value_symbol_start Literal <<self>> choice_254 <<runtime>> si:reduce_symbol_end Literal return } <<def>> <<ns>>choice_254 {} { # / # x # (APOSTROPH) # * # x # ! # (APOSTROPH) |
︙ | ︙ | |||
1376 1377 1378 1379 1380 1381 1382 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) <<runtime>> si:value_state_push | | | | | | | | | | | | | | | | | | | | 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 | # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) <<runtime>> si:value_state_push <<self>> sequence_239 <<runtime>> si:valuevalue_branch <<self>> sequence_252 <<runtime>> si:value_state_merge return } <<def>> <<ns>>sequence_239 {} { # x # (APOSTROPH) # * # x # ! # (APOSTROPH) # (Char) # (APOSTROPH) # (WHITESPACE) <<runtime>> si:void_state_push <<self>> sym_APOSTROPH <<runtime>> si:voidvalue_part <<self>> kleene_235 <<runtime>> si:valuevalue_part <<self>> sym_APOSTROPH <<runtime>> si:valuevalue_part <<self>> sym_WHITESPACE <<runtime>> si:value_state_merge return } <<def>> <<ns>>kleene_235 {} { # * # x # ! # (APOSTROPH) # (Char) while {1} { <<runtime>> si:void2_state_push <<self>> sequence_233 <<runtime>> si:kleene_close } return } <<def>> <<ns>>sequence_233 {} { # x # ! # (APOSTROPH) # (Char) <<runtime>> si:void_state_push <<self>> notahead_230 <<runtime>> si:voidvalue_part <<self>> sym_Char <<runtime>> si:value_state_merge return } <<def>> <<ns>>notahead_230 {} { # ! # (APOSTROPH) <<runtime>> i_loc_push <<self>> sym_APOSTROPH <<runtime>> si:void_notahead_exit return } <<def>> <<ns>>sequence_252 {} { # x # (DAPOSTROPH) # * # x # ! # (DAPOSTROPH) # (Char) # (DAPOSTROPH) # (WHITESPACE) <<runtime>> si:void_state_push <<self>> sym_DAPOSTROPH <<runtime>> si:voidvalue_part <<self>> kleene_248 <<runtime>> si:valuevalue_part <<self>> sym_DAPOSTROPH <<runtime>> si:valuevalue_part <<self>> sym_WHITESPACE <<runtime>> si:value_state_merge return } <<def>> <<ns>>kleene_248 {} { # * # x # ! # (DAPOSTROPH) # (Char) while {1} { <<runtime>> si:void2_state_push <<self>> sequence_246 <<runtime>> si:kleene_close } return } <<def>> <<ns>>sequence_246 {} { # x # ! # (DAPOSTROPH) # (Char) <<runtime>> si:void_state_push <<self>> notahead_243 <<runtime>> si:voidvalue_part <<self>> sym_Char <<runtime>> si:value_state_merge return } <<def>> <<ns>>notahead_243 {} { # ! # (DAPOSTROPH) <<runtime>> i_loc_push <<self>> sym_DAPOSTROPH <<runtime>> si:void_notahead_exit return } # # leaf Symbol 'LOWER' # <<def>> <<ns>>sym_LOWER {} { # x # "<lower>" # (WHITESPACE) <<runtime>> si:void_symbol_start LOWER <<self>> sequence_259 <<runtime>> si:void_leaf_symbol_end LOWER return } <<def>> <<ns>>sequence_259 {} { # x # "<lower>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <lower> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1545 1546 1547 1548 1549 1550 1551 | <<def>> <<ns>>sym_NOT {} { # x # '!' # (WHITESPACE) <<runtime>> si:void_symbol_start NOT | | | | 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 | <<def>> <<ns>>sym_NOT {} { # x # '!' # (WHITESPACE) <<runtime>> si:void_symbol_start NOT <<self>> sequence_264 <<runtime>> si:void_leaf_symbol_end NOT return } <<def>> <<ns>>sequence_264 {} { # x # '!' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char ! <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1573 1574 1575 1576 1577 1578 1579 | <<def>> <<ns>>sym_OPEN {} { # x # '\(' # (WHITESPACE) <<runtime>> si:void_void_symbol_start OPEN | | | | 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 | <<def>> <<ns>>sym_OPEN {} { # x # '\(' # (WHITESPACE) <<runtime>> si:void_void_symbol_start OPEN <<self>> sequence_269 <<runtime>> si:void_clear_symbol_end OPEN return } <<def>> <<ns>>sequence_269 {} { # x # '\(' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char \50 <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 | # # void Symbol 'PEG' # <<def>> <<ns>>sym_PEG {} { # x # "PEG" # (WHITESPACE) <<runtime>> si:void_void_symbol_start PEG | > > > > | | > > > > > > > > > > > > > > > > > > | | | 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 | # # void Symbol 'PEG' # <<def>> <<ns>>sym_PEG {} { # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) <<runtime>> si:void_void_symbol_start PEG <<self>> sequence_281 <<runtime>> si:void_clear_symbol_end PEG return } <<def>> <<ns>>sequence_281 {} { # x # "PEG" # ! # / # [_:] # <alnum> # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str PEG <<runtime>> si:voidvoid_part <<self>> notahead_278 <<runtime>> si:voidvoid_part <<self>> sym_WHITESPACE <<runtime>> si:void_state_merge return } <<def>> <<ns>>notahead_278 {} { # ! # / # [_:] # <alnum> <<runtime>> i_loc_push <<self>> choice_206 <<runtime>> si:void_notahead_exit return } # # leaf Symbol 'PLUS' # <<def>> <<ns>>sym_PLUS {} { # x # '+' # (WHITESPACE) <<runtime>> si:void_symbol_start PLUS <<self>> sequence_286 <<runtime>> si:void_leaf_symbol_end PLUS return } <<def>> <<ns>>sequence_286 {} { # x # '+' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char + <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1673 1674 1675 1676 1677 1678 1679 | # ? # / # (AND) # (NOT) # (Suffix) <<runtime>> si:value_symbol_start Prefix | | | | | | | | 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 | # ? # / # (AND) # (NOT) # (Suffix) <<runtime>> si:value_symbol_start Prefix <<self>> sequence_296 <<runtime>> si:reduce_symbol_end Prefix return } <<def>> <<ns>>sequence_296 {} { # x # ? # / # (AND) # (NOT) # (Suffix) <<runtime>> si:value_state_push <<self>> optional_293 <<runtime>> si:valuevalue_part <<self>> sym_Suffix <<runtime>> si:value_state_merge return } <<def>> <<ns>>optional_293 {} { # ? # / # (AND) # (NOT) <<runtime>> si:void2_state_push <<self>> choice_291 <<runtime>> si:void_state_merge_ok return } <<def>> <<ns>>choice_291 {} { # / # (AND) # (NOT) <<runtime>> si:value_state_push <<self>> sym_AND <<runtime>> si:valuevalue_branch |
︙ | ︙ | |||
1749 1750 1751 1752 1753 1754 1755 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) <<runtime>> si:value_symbol_start Primary | | | | 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 | # (Expression) # (CLOSE) # (Literal) # (Class) # (DOT) <<runtime>> si:value_symbol_start Primary <<self>> choice_322 <<runtime>> si:reduce_symbol_end Primary return } <<def>> <<ns>>choice_322 {} { # / # (ALNUM) # (ALPHA) # (ASCII) # (CONTROL) # (DDIGIT) # (DIGIT) |
︙ | ︙ | |||
1810 1811 1812 1813 1814 1815 1816 | <<runtime>> si:valuevalue_branch <<self>> sym_WORDCHAR <<runtime>> si:valuevalue_branch <<self>> sym_XDIGIT <<runtime>> si:valuevalue_branch <<self>> sym_Identifier <<runtime>> si:valuevalue_branch | | | | 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 | <<runtime>> si:valuevalue_branch <<self>> sym_WORDCHAR <<runtime>> si:valuevalue_branch <<self>> sym_XDIGIT <<runtime>> si:valuevalue_branch <<self>> sym_Identifier <<runtime>> si:valuevalue_branch <<self>> sequence_317 <<runtime>> si:valuevalue_branch <<self>> sym_Literal <<runtime>> si:valuevalue_branch <<self>> sym_Class <<runtime>> si:valuevalue_branch <<self>> sym_DOT <<runtime>> si:value_state_merge return } <<def>> <<ns>>sequence_317 {} { # x # (OPEN) # (Expression) # (CLOSE) <<runtime>> si:void_state_push <<self>> sym_OPEN |
︙ | ︙ | |||
1847 1848 1849 1850 1851 1852 1853 | <<def>> <<ns>>sym_PRINTABLE {} { # x # "<print>" # (WHITESPACE) <<runtime>> si:void_symbol_start PRINTABLE | | | | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 | <<def>> <<ns>>sym_PRINTABLE {} { # x # "<print>" # (WHITESPACE) <<runtime>> si:void_symbol_start PRINTABLE <<self>> sequence_327 <<runtime>> si:void_leaf_symbol_end PRINTABLE return } <<def>> <<ns>>sequence_327 {} { # x # "<print>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <print> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1875 1876 1877 1878 1879 1880 1881 | <<def>> <<ns>>sym_PUNCT {} { # x # "<punct>" # (WHITESPACE) <<runtime>> si:void_symbol_start PUNCT | | | | 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 | <<def>> <<ns>>sym_PUNCT {} { # x # "<punct>" # (WHITESPACE) <<runtime>> si:void_symbol_start PUNCT <<self>> sequence_332 <<runtime>> si:void_leaf_symbol_end PUNCT return } <<def>> <<ns>>sequence_332 {} { # x # "<punct>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <punct> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1903 1904 1905 1906 1907 1908 1909 | <<def>> <<ns>>sym_QUESTION {} { # x # '?' # (WHITESPACE) <<runtime>> si:void_symbol_start QUESTION | | | | 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 | <<def>> <<ns>>sym_QUESTION {} { # x # '?' # (WHITESPACE) <<runtime>> si:void_symbol_start QUESTION <<self>> sequence_337 <<runtime>> si:void_leaf_symbol_end QUESTION return } <<def>> <<ns>>sequence_337 {} { # x # '?' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char ? <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
1934 1935 1936 1937 1938 1939 1940 | # x # (Char) # (TO) # (Char) # (Char) <<runtime>> si:value_symbol_start Range | | | | | | 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 | # x # (Char) # (TO) # (Char) # (Char) <<runtime>> si:value_symbol_start Range <<self>> choice_346 <<runtime>> si:reduce_symbol_end Range return } <<def>> <<ns>>choice_346 {} { # / # x # (Char) # (TO) # (Char) # (Char) <<runtime>> si:value_state_push <<self>> sequence_343 <<runtime>> si:valuevalue_branch <<self>> sym_Char <<runtime>> si:value_state_merge return } <<def>> <<ns>>sequence_343 {} { # x # (Char) # (TO) # (Char) <<runtime>> si:value_state_push <<self>> sym_Char |
︙ | ︙ | |||
1981 1982 1983 1984 1985 1986 1987 | <<def>> <<ns>>sym_SEMICOLON {} { # x # ';' # (WHITESPACE) <<runtime>> si:void_void_symbol_start SEMICOLON | | | | 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 | <<def>> <<ns>>sym_SEMICOLON {} { # x # ';' # (WHITESPACE) <<runtime>> si:void_void_symbol_start SEMICOLON <<self>> sequence_351 <<runtime>> si:void_clear_symbol_end SEMICOLON return } <<def>> <<ns>>sequence_351 {} { # x # ';' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char \73 <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2008 2009 2010 2011 2012 2013 2014 | # <<def>> <<ns>>sym_Sequence {} { # + # (Prefix) <<runtime>> si:value_symbol_start Sequence | | | | 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | # <<def>> <<ns>>sym_Sequence {} { # + # (Prefix) <<runtime>> si:value_symbol_start Sequence <<self>> poskleene_355 <<runtime>> si:reduce_symbol_end Sequence return } <<def>> <<ns>>poskleene_355 {} { # + # (Prefix) <<runtime>> i_loc_push <<self>> sym_Prefix <<runtime>> si:kleene_abort while {1} { |
︙ | ︙ | |||
2038 2039 2040 2041 2042 2043 2044 | <<def>> <<ns>>sym_SLASH {} { # x # '/' # (WHITESPACE) <<runtime>> si:void_void_symbol_start SLASH | | | | 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 | <<def>> <<ns>>sym_SLASH {} { # x # '/' # (WHITESPACE) <<runtime>> si:void_void_symbol_start SLASH <<self>> sequence_360 <<runtime>> si:void_clear_symbol_end SLASH return } <<def>> <<ns>>sequence_360 {} { # x # '/' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char / <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2066 2067 2068 2069 2070 2071 2072 | <<def>> <<ns>>sym_SPACE {} { # x # "<space>" # (WHITESPACE) <<runtime>> si:void_symbol_start SPACE | | | | 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 | <<def>> <<ns>>sym_SPACE {} { # x # "<space>" # (WHITESPACE) <<runtime>> si:void_symbol_start SPACE <<self>> sequence_365 <<runtime>> si:void_leaf_symbol_end SPACE return } <<def>> <<ns>>sequence_365 {} { # x # "<space>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <space> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2094 2095 2096 2097 2098 2099 2100 | <<def>> <<ns>>sym_STAR {} { # x # '*' # (WHITESPACE) <<runtime>> si:void_symbol_start STAR | | | | 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 | <<def>> <<ns>>sym_STAR {} { # x # '*' # (WHITESPACE) <<runtime>> si:void_symbol_start STAR <<self>> sequence_370 <<runtime>> si:void_leaf_symbol_end STAR return } <<def>> <<ns>>sequence_370 {} { # x # '*' # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_char * <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2123 2124 2125 2126 2127 2128 2129 | <<def>> <<ns>>sym_StartExpr {} { # x # (OPEN) # (Expression) # (CLOSE) <<runtime>> si:value_symbol_start StartExpr | | | | | | | | | 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 | <<def>> <<ns>>sym_StartExpr {} { # x # (OPEN) # (Expression) # (CLOSE) <<runtime>> si:value_symbol_start StartExpr <<self>> sequence_317 <<runtime>> si:reduce_symbol_end StartExpr return } # # value Symbol 'Suffix' # <<def>> <<ns>>sym_Suffix {} { # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) <<runtime>> si:value_symbol_start Suffix <<self>> sequence_386 <<runtime>> si:reduce_symbol_end Suffix return } <<def>> <<ns>>sequence_386 {} { # x # (Primary) # ? # / # (QUESTION) # (STAR) # (PLUS) <<runtime>> si:value_state_push <<self>> sym_Primary <<runtime>> si:valuevalue_part <<self>> optional_384 <<runtime>> si:value_state_merge return } <<def>> <<ns>>optional_384 {} { # ? # / # (QUESTION) # (STAR) # (PLUS) <<runtime>> si:void2_state_push <<self>> choice_382 <<runtime>> si:void_state_merge_ok return } <<def>> <<ns>>choice_382 {} { # / # (QUESTION) # (STAR) # (PLUS) <<runtime>> si:value_state_push <<self>> sym_QUESTION |
︙ | ︙ | |||
2216 2217 2218 2219 2220 2221 2222 | <<def>> <<ns>>sym_UPPER {} { # x # "<upper>" # (WHITESPACE) <<runtime>> si:void_symbol_start UPPER | | | | 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 | <<def>> <<ns>>sym_UPPER {} { # x # "<upper>" # (WHITESPACE) <<runtime>> si:void_symbol_start UPPER <<self>> sequence_393 <<runtime>> si:void_leaf_symbol_end UPPER return } <<def>> <<ns>>sequence_393 {} { # x # "<upper>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <upper> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2244 2245 2246 2247 2248 2249 2250 | <<def>> <<ns>>sym_VOID {} { # x # "void" # (WHITESPACE) <<runtime>> si:void_symbol_start VOID | | | | 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 | <<def>> <<ns>>sym_VOID {} { # x # "void" # (WHITESPACE) <<runtime>> si:void_symbol_start VOID <<self>> sequence_398 <<runtime>> si:void_leaf_symbol_end VOID return } <<def>> <<ns>>sequence_398 {} { # x # "void" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str void <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2273 2274 2275 2276 2277 2278 2279 | <<def>> <<ns>>sym_WHITESPACE {} { # * # / # <space> # (COMMENT) <<runtime>> si:void_void_symbol_start WHITESPACE | | | | | | 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 | <<def>> <<ns>>sym_WHITESPACE {} { # * # / # <space> # (COMMENT) <<runtime>> si:void_void_symbol_start WHITESPACE <<self>> kleene_405 <<runtime>> si:void_clear_symbol_end WHITESPACE return } <<def>> <<ns>>kleene_405 {} { # * # / # <space> # (COMMENT) while {1} { <<runtime>> si:void2_state_push <<self>> choice_403 <<runtime>> si:kleene_close } return } <<def>> <<ns>>choice_403 {} { # / # <space> # (COMMENT) <<runtime>> si:void_state_push <<runtime>> si:next_space <<runtime>> si:voidvoid_branch |
︙ | ︙ | |||
2315 2316 2317 2318 2319 2320 2321 | <<def>> <<ns>>sym_WORDCHAR {} { # x # "<wordchar>" # (WHITESPACE) <<runtime>> si:void_symbol_start WORDCHAR | | | | 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 | <<def>> <<ns>>sym_WORDCHAR {} { # x # "<wordchar>" # (WHITESPACE) <<runtime>> si:void_symbol_start WORDCHAR <<self>> sequence_410 <<runtime>> si:void_leaf_symbol_end WORDCHAR return } <<def>> <<ns>>sequence_410 {} { # x # "<wordchar>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <wordchar> <<runtime>> si:voidvoid_part |
︙ | ︙ | |||
2343 2344 2345 2346 2347 2348 2349 | <<def>> <<ns>>sym_XDIGIT {} { # x # "<xdigit>" # (WHITESPACE) <<runtime>> si:void_symbol_start XDIGIT | | | | 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 | <<def>> <<ns>>sym_XDIGIT {} { # x # "<xdigit>" # (WHITESPACE) <<runtime>> si:void_symbol_start XDIGIT <<self>> sequence_415 <<runtime>> si:void_leaf_symbol_end XDIGIT return } <<def>> <<ns>>sequence_415 {} { # x # "<xdigit>" # (WHITESPACE) <<runtime>> si:void_state_push <<runtime>> si:next_str <xdigit> <<runtime>> si:voidvoid_part |
︙ | ︙ |
Changes to modules/pt/tests/pt_cparam_config_critcl.tests.
1 2 3 4 5 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-cparam-config-critcl-1.0 {convert, wrong#args} -body { pt::cparam::configuration::critcl def | | | | | > > > > | | | | | 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 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-cparam-config-critcl-1.0 {convert, wrong#args} -body { pt::cparam::configuration::critcl def } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::critcl def class pkg version cmd"} test pt-cparam-config-critcl-1.1 {convert, wrong#args} -body { pt::cparam::configuration::critcl def C } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::critcl def class pkg version cmd"} test pt-cparam-config-critcl-1.2 {convert, wrong#args} -body { pt::cparam::configuration::critcl def C P } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::critcl def class pkg version cmd"} test pt-cparam-config-critcl-1.3 {convert, wrong#args} -body { pt::cparam::configuration::critcl def C P V } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::critcl def class pkg version cmd"} test pt-cparam-config-critcl-2.0 {reset, wrong#args} -body { pt::cparam::configuration::critcl def C P V C XXX } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::critcl def class pkg version cmd"} # ------------------------------------------------------------------------- # TODO :: Tests missing for: configure/cget, reset # ------------------------------------------------------------------------- # Testing the generation of c/param output configured for critcl. TestFilesProcess $mytestdir ok peg_serial-canonical peg_cparam-critcl -> n label input data expected { test pt-cparam-config-critcl-3.$n "pt::cparam::configuration::critcl, $label, ok :- $input" -setup { pt::peg::to::cparam reset pt::peg::to::cparam configure -name TEMPLATE pt::peg::to::cparam configure -file TEST pt::cparam::configuration::critcl def \ PARSER PACKAGE 1 \ {pt::peg::to::cparam configure} } -body { pt::peg::to::cparam convert $data } -cleanup { pt::peg::to::cparam reset } -result $expected |
︙ | ︙ |
Added modules/pt/tests/pt_cparam_config_tea.tests.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-cparam-config-tea-1.0 {convert, wrong#args} -body { pt::cparam::configuration::tea def } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"} test pt-cparam-config-tea-1.1 {convert, wrong#args} -body { pt::cparam::configuration::tea def C } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"} test pt-cparam-config-tea-1.2 {convert, wrong#args} -body { pt::cparam::configuration::tea def C P } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"} test pt-cparam-config-tea-1.3 {convert, wrong#args} -body { pt::cparam::configuration::tea def C P V } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"} test pt-cparam-config-tea-2.0 {reset, wrong#args} -body { pt::cparam::configuration::tea def C P V C XXX } -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"} # ------------------------------------------------------------------------- # TODO :: Tests missing for: configure/cget, reset # ------------------------------------------------------------------------- # Testing the generation of c/param output configured for tea. TestFilesProcess $mytestdir ok peg_serial-canonical peg_cparam-tea -> n label input data expected { test pt-cparam-config-tea-3.$n "pt::cparam::configuration::tea, $label, ok :- $input" -setup { pt::peg::to::cparam reset pt::peg::to::cparam configure -name TEMPLATE pt::peg::to::cparam configure -file TEST pt::cparam::configuration::tea def \ PARSER PACKAGE 1 \ {pt::peg::to::cparam configure} } -body { pt::peg::to::cparam convert $data } -cleanup { pt::peg::to::cparam reset } -result $expected } #---------------------------------------------------------------------- unset n label input data expected |
Added modules/pt/tests/pt_pgen.tests.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | # -*- tcl -*- # Testsuite for pt::pgen. # Called by the ../pt_pgen.test driver file. #---------------------------------------------------------------------- ## I. Testing the generator operation itself # TODO testing of the pt::pgen command API (#args, options, outputs) ... #---------------------------------------------------------------------- ## II. Using generated parsers to test behaviour on good and bad ## input, i.e. the error handling implemented in our PEG parsers. ## See data/gr/README.txt for the documentation of the directory ## structure used to organize the test-cases used here. foreach {format notes} { container {grammar interpreter - reference} snit {snit::type Tcl parser} oo {TclOO class Tcl parser} critcl {PARAM based C class parser} } { # Ignore critcl-based parsers if the environment does not support # their generation (no critcl package). if {$format eq "critcl" && ![tcltest::testConstraint critcl]} continue TestFilesProcessIn $mytestdir gr def -> n glabel grfile grdata { # Make parser instance. Shared across tests. Amortize the time # spent on dynamically making it. set p [make-parser $format $glabel $grdata] # Test parser on good inputs for the grammar. TestFilesProcess $mytestdir gr ok-${glabel} ok-${glabel}-res -> k label infile text expected { test pt-pgen-parse:${parseimpl}-rde:${rdeimpl}-stack:${stackimpl}-f:${format}-g:${glabel}-t:${label}-1.$n.$k \ "$format parser $glabel, good input - $label" -setup { } -body { $p parset $text } -result $expected } # Test parser on bad inputs for the grammar. ## # Note how the expected output depends not only on grammar, # but the parser format as well. Different optimizations and # such leading to different instructions implementing matches. # Example: "next_str" vs. "sequence of next_char". TestFilesProcess $mytestdir gr fail-${glabel} fail-${glabel}-${format}-res -> k label infile text expected { test pt-pgen-parse:${parseimpl}-rde:${rdeimpl}-stack:${stackimpl}-f:${format}-g:${glabel}-t:${label}-2.$n.$k \ "$format parser $glabel, bad input - $label" -setup { } -body { set code [catch { $p parset $text } msg] # msg = list ("pt::rde" location list(msg)) # Sort the messages for a canonical result. # NOTE: The data out of the RDE/critcl is sorted # by msg id, that is not necessarily # lexicographical, nor matching the Tcl results. lassign $msg tag loc mlist set msg [list $tag $loc [lsort -dict $mlist]] # TODO: Convert message to readable. list $code $msg } -result $expected } yes ;# Allow missing testsets, for two reasons: # # (a) Easier during testsuite development, allowing incremental buildup # # (b) Some grammar construction *cannot* fail (Ex: x*), thus we cannot provide # # failure cases either. # Kill shared parser instance. $p destroy } # Testing the handling of generated parsers for single # characters, for characters special to Tcl, C, and # PEGs. I.e. ensure that the various forms of quoting are done # correctly. foreach {n peg input message hmsg} $chars { set glabel "T_$hmsg" set grdata [string map [list @ $peg] $gtemplate] set edata [string map [list @ $hmsg] $etemplate] # Make parser instance. Shared across tests. # Amortize the time spent on dynamically making it. set p [make-parser $format $glabel $grdata] test pt-pgen-parse:${parseimpl}-rde:${rdeimpl}-stack:${stackimpl}-f:${format}-g:${glabel}-3.$n \ "$format parser $glabel, good input" -setup { } -body { $p parset $input } -result {} test pt-pgen-parse:${parseimpl}-rde:${rdeimpl}-stack:${stackimpl}-f:${format}-g:${glabel}-4.$n \ "$format parser $glabel, bad input, tcl error" -setup { } -body { set code [catch { $p parset X } msg] lassign $msg tag loc mlist list $tag $loc [lsort -dict $mlist] } -result [list pt::rde 0 [list $message]] test pt-pgen-parse:${parseimpl}-rde:${rdeimpl}-stack:${stackimpl}-f:${format}-g:${glabel}-5.$n \ "$format parser $glabel, bad input, readable error" -setup { } -body { set code [catch { $p parset X } msg] lassign $msg tag loc mlist pt::util::error2readable [list $tag $loc [lsort -dict $mlist]] X } -result $edata # Kill shared parser instance. $p destroy } } #---------------------------------------------------------------------- |
Changes to modules/pt/tests/pt_rdengine.tests.
︙ | ︙ | |||
22 23 24 25 26 27 28 | myrde foo } -cleanup { myrde destroy } -returnCodes error \ -match glob \ -result [take \ {unknown subcommand "foo": namespace ::pt::rde_tcl::Snit_inst* does not export any commands} \ | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | myrde foo } -cleanup { myrde destroy } -returnCodes error \ -match glob \ -result [take \ {unknown subcommand "foo": namespace ::pt::rde_tcl::Snit_inst* does not export any commands} \ {bad option "foo": must be amarked, ast, asts, chan, complete, current, data, destroy, emarked, error, lmarked, location, ok, reset, scached, symbols, tokens, value, i:fail_continue, i:fail_return, i:ok_continue, i:ok_return, i_status_fail, i_status_negate, i_status_ok, i_error_clear, i_error_nonterminal, i_error_pop_merge, i_error_push, i:fail_loc_pop_rewind, i_loc_pop_discard, i_loc_pop_rewind/discard, i_loc_pop_rewind, i_loc_push, i:fail_ast_pop_rewind, i_ast_pop_discard, i_ast_pop_discard/rewind, i_ast_pop_rewind/discard, i_ast_pop_rewind, i_ast_push, i:ok_ast_value_push, i_symbol_restore, i_symbol_save, i_value_clear/leaf, i_value_clear, i_value_clear/reduce, i_input_next, i_test_alnum, i_test_alpha, i_test_ascii, i_test_char, i_test_control, i_test_ddigit, i_test_digit, i_test_graph, i_test_lower, i_test_print, i_test_punct, i_test_range, i_test_space, i_test_upper, i_test_wordchar, i_test_xdigit, i:ok_ast_pop_discard, i_ast_rewind, i:ok_loc_pop_discard, i_loc_rewind, i_error_clear_push, si:void_state_push, si:value_state_push, si:void_state_merge, si:value_state_merge, si:voidvoid_branch, si:voidvalue_branch, si:valuevoid_branch, si:valuevalue_branch, si:voidvoid_part, si:voidvalue_part, si:valuevalue_part, si:next_char, si:next_range, si:next_alnum, si:next_alpha, si:next_ascii, si:next_control, si:next_ddigit, si:next_digit, si:next_graph, si:next_lower, si:next_print, si:next_punct, si:next_space, si:next_upper, si:next_wordchar, si:next_xdigit, si:void2_state_push, si:void_state_merge_ok, si:value_notahead_start, si:void_notahead_exit, si:value_notahead_exit, si:kleene_abort, si:kleene_close, si:value_symbol_start, si:value_void_symbol_start, si:void_symbol_start, si:void_void_symbol_start, si:reduce_symbol_end, si:void_leaf_symbol_end, si:value_leaf_symbol_end, si:value_clear_symbol_end, si:void_clear_symbol_end, si:next_str, or si:next_class}] test pt-rdengine-rde:${rdeimpl}-stack:${stkimpl}-0.3 {rde errors} -body { pt::rde set } -returnCodes error -result {command "::set" already exists} #---------------------------------------------------------------------- |
︙ | ︙ | |||
659 660 661 662 663 664 665 | } -result { IN {} CC H CL -1 LS -1 ST fail SV {} | | | 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | } -result { IN {} CC H CL -1 LS -1 ST fail SV {} ER {0 {{t Y}}} ES {} TC HE NC {} AR {} AS {}} #---------------------------------------------------------------------- |
︙ | ︙ |
Changes to modules/pt/tests/pt_runtime.tests.
︙ | ︙ | |||
15 16 17 18 19 20 21 | # Generate a snit parser for G, then make an instance to # handle the actual parsing of the input. pt::peg::to::tclparam reset pt::peg::to::tclparam configure -name TEMPLATE$suffix pt::peg::to::tclparam configure -file TEST$suffix pt::tclparam::configuration::snit def \ | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Generate a snit parser for G, then make an instance to # handle the actual parsing of the input. pt::peg::to::tclparam reset pt::peg::to::tclparam configure -name TEMPLATE$suffix pt::peg::to::tclparam configure -file TEST$suffix pt::tclparam::configuration::snit def \ PARSER$suffix SNIT_PACKAGE$suffix 1 \ {pt::peg::to::tclparam configure} set c [pt::peg::to::tclparam convert [$g serialize]] # The catch is required because the generated code ends in # 'return' (ending the code in the file). This command must not # stop us from setting this up in memory. |
︙ | ︙ |
Changes to modules/pt/tests/pt_tclparam_config_snit.tests.
1 2 3 4 5 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-tclparam-config-snit-1.0 {convert, wrong#args} -body { pt::tclparam::configuration::snit def | | | | > > > > | | | | 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 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-tclparam-config-snit-1.0 {convert, wrong#args} -body { pt::tclparam::configuration::snit def } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"} test pt-tclparam-config-snit-1.1 {convert, wrong#args} -body { pt::tclparam::configuration::snit def C } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"} test pt-tclparam-config-snit-1.2 {convert, wrong#args} -body { pt::tclparam::configuration::snit def C P } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"} test pt-tclparam-config-snit-1.3 {convert, wrong#args} -body { pt::tclparam::configuration::snit def C P V } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"} test pt-tclparam-config-snit-2.0 {reset, wrong#args} -body { pt::tclparam::configuration::snit def C P V C XXX } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"} # ------------------------------------------------------------------------- # TODO :: Tests missing for: configure/cget, reset # ------------------------------------------------------------------------- # Testing the generation of tcl/param output configured for snit. TestFilesProcess $mytestdir ok peg_serial-canonical peg_tclparam-snit -> n label input data expected { test pt-tclparam-config-snit-3.$n "pt::tclparam::configuration::snit, $label, ok :- $input" -setup { pt::peg::to::tclparam reset pt::peg::to::tclparam configure -name TEMPLATE pt::peg::to::tclparam configure -file TEST pt::tclparam::configuration::snit def \ PARSER SNIT_PACKAGE 1 \ {pt::peg::to::tclparam configure} } -body { pt::peg::to::tclparam convert $data } -cleanup { pt::peg::to::tclparam reset } -result $expected } #---------------------------------------------------------------------- unset n label input data expected |
Changes to modules/pt/tests/pt_tclparam_config_tcloo.tests.
1 2 3 4 5 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-tclparam-config-tcloo-1.0 {convert, wrong#args} -body { pt::tclparam::configuration::tcloo def | | | | > > > > | | | | 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 | # -*- tcl -*- # General set of error cases regarding the number of arguments. test pt-tclparam-config-tcloo-1.0 {convert, wrong#args} -body { pt::tclparam::configuration::tcloo def } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::tcloo def class pkg version cmd"} test pt-tclparam-config-tcloo-1.1 {convert, wrong#args} -body { pt::tclparam::configuration::tcloo def C } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::tcloo def class pkg version cmd"} test pt-tclparam-config-tcloo-1.2 {convert, wrong#args} -body { pt::tclparam::configuration::tcloo def C P } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::tcloo def class pkg version cmd"} test pt-tclparam-config-tcloo-1.3 {convert, wrong#args} -body { pt::tclparam::configuration::tcloo def C P V } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::tcloo def class pkg version cmd"} test pt-tclparam-config-tcloo-2.0 {reset, wrong#args} -body { pt::tclparam::configuration::tcloo def C P V C XXX } -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::tcloo def class pkg version cmd"} # ------------------------------------------------------------------------- # TODO :: Tests missing for: configure/cget, reset # ------------------------------------------------------------------------- # Testing the generation of tcl/param output configured for tcloo. TestFilesProcess $mytestdir ok peg_serial-canonical peg_tclparam-tcloo -> n label input data expected { test pt-tclparam-config-tcloo-3.$n "pt::tclparam::configuration::tcloo, $label, ok :- $input" -setup { pt::peg::to::tclparam reset pt::peg::to::tclparam configure -name TEMPLATE pt::peg::to::tclparam configure -file TEST pt::tclparam::configuration::tcloo def \ PARSER OO_PACKAGE 1 \ {pt::peg::to::tclparam configure} } -body { pt::peg::to::tclparam convert $data } -cleanup { pt::peg::to::tclparam reset } -result $expected } #---------------------------------------------------------------------- unset n label input data expected |
Changes to modules/pt/tools/bench-compare.tcl.
1 2 3 4 5 6 7 | package require Tcl 8.5 package require bench::in package require struct::matrix package require report proc main {} { | > > | 1 2 3 4 5 6 7 8 9 | #!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 package require bench::in package require struct::matrix package require report proc main {} { |
︙ | ︙ |
Changes to modules/pt/tools/regenerate_parsers.tcl.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 set self [file normalize [info script]] set selfdir [file dirname $self] set module [file dirname $selfdir] lappend auto_path [file dirname $module] | | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 set self [file normalize [info script]] set selfdir [file dirname $self] set module [file dirname $selfdir] lappend auto_path [file dirname $module] package require pt::pgen 1.0.3 package require pt::util package require fileutil package require try set specification [file join $module tests/data/ok/peg_peg/3_peg_itself] set new_parser_tcl [file join $module pt_parse_peg_tcl.tcl-NEW] set new_parser_critcl [file join $module pt_parse_peg_c.tcl-NEW] set me $tcl_platform(user) set name PEG set class pt::parse::peg |
︙ | ︙ | |||
37 38 39 40 41 42 43 | # of package pt::peg::from::peg and switch there from use of # pt::parse::peg to the interpreter/container combination. The code # for bootstrapping is still present, just commented out. puts "Reading spec..." set spec [fileutil::cat $specification] | | | > > > | < | | | | | | | | > | < | < | < | | | | | | | | > | > > > | > > > > > > | | 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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | # of package pt::peg::from::peg and switch there from use of # pt::parse::peg to the interpreter/container combination. The code # for bootstrapping is still present, just commented out. puts "Reading spec..." set spec [fileutil::cat $specification] set version 1.0.1 puts "Generating $version ..." try { # Generate snit-based Tcl parser for the PEG grammar. puts ...Tcl set tcl [pt::pgen \ peg $spec \ snit \ -name $name \ -user $me \ -file [file tail $specification] \ -class ${class}_tcl \ -package ${class}_tcl \ -version $version \ ] # Generate critcl-based C parser for the PEG grammar. puts ...Critcl set ctcl [pt::pgen \ peg $spec \ critcl \ -name $name \ -user $me \ -file [file tail $specification] \ -class $class \ -package [string map {:: _} $class]_c \ -version $version \ ] } trap {PT RDE SYNTAX} {e o} { puts [pt::util error2readable $e $spec] exit 1 } puts "Saving..." fileutil::writeFile $new_parser_tcl $tcl fileutil::writeFile $new_parser_critcl $ctcl puts OK exit 0 |
Changes to support/devel/sak/doc/kwic.txt.
︙ | ︙ | |||
425 426 427 428 429 430 431 432 433 434 435 436 437 438 | [key {context-free languages}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | [key {context-free languages}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
456 457 458 459 460 461 462 463 464 465 466 467 468 469 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key control] | > | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key control] |
︙ | ︙ | |||
855 856 857 858 859 860 861 862 863 864 865 866 867 868 | [manpage modules/valtype/isbn.man valtype::isbn] [key earley] [manpage modules/grammar_aycock/aycock.man grammar::aycock] [key EBNF] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | [manpage modules/valtype/isbn.man valtype::isbn] [key earley] [manpage modules/grammar_aycock/aycock.man grammar::aycock] [key EBNF] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
886 887 888 889 890 891 892 893 894 895 896 897 898 899 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key eccentricity] | > | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key eccentricity] |
︙ | ︙ | |||
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 | [key expression] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | [key expression] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {extended namespace}] | > | 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {extended namespace}] |
︙ | ︙ | |||
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 | [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_me/me_vm.man grammar::me_vm] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 | [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_me/me_vm.man grammar::me_vm] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key graph] | > | 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key graph] |
︙ | ︙ | |||
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 | [key LL(k)] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 | [key LL(k)] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {local searching}] | > | 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {local searching}] |
︙ | ︙ | |||
1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 | [manpage modules/valtype/cc_mastercard.man valtype::creditcard::mastercard] [key matching] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 | [manpage modules/valtype/cc_mastercard.man valtype::creditcard::mastercard] [key matching] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [manpage modules/struct/graphops.man struct::graph::op] | > | 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [manpage modules/struct/graphops.man struct::graph::op] |
︙ | ︙ | |||
2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 | [manpage modules/doctools2idx/idx_parse.man doctools::idx::parse] [manpage modules/doctools2base/tcl_parse.man doctools::tcl::parse] [manpage modules/doctools2toc/toc_parse.man doctools::toc::parse] [manpage modules/grammar_aycock/aycock.man grammar::aycock] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 | [manpage modules/doctools2idx/idx_parse.man doctools::idx::parse] [manpage modules/doctools2base/tcl_parse.man doctools::tcl::parse] [manpage modules/doctools2toc/toc_parse.man doctools::toc::parse] [manpage modules/grammar_aycock/aycock.man grammar::aycock] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [manpage modules/amazon-s3/xsxp.man xsxp] | > | 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [manpage modules/amazon-s3/xsxp.man xsxp] |
︙ | ︙ | |||
2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 | [manpage modules/yaml/yaml.man yaml] [key {parsing expression}] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 | [manpage modules/yaml/yaml.man yaml] [key {parsing expression}] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {parsing expression grammar}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage modules/page/page_util_peg.man page_util_peg] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > > | 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {parsing expression grammar}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage modules/page/page_util_peg.man page_util_peg] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {partial application}] | > | 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {partial application}] |
︙ | ︙ | |||
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 | [key PEG] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/page/page_util_norm_peg.man page_util_norm_peg] [manpage modules/page/page_util_peg.man page_util_peg] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 | [key PEG] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/page/page_util_norm_peg.man page_util_norm_peg] [manpage modules/page/page_util_peg.man page_util_peg] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key performance] | > | 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key performance] |
︙ | ︙ | |||
2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 | [key {push down automaton}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 | [key {push down automaton}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key queue] | > | 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key queue] |
︙ | ︙ | |||
2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 | [key {recursive descent}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 | [key {recursive descent}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key reduce] | > | 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key reduce] |
︙ | ︙ | |||
2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 | [manpage modules/grammar_fa/dexec.man grammar::fa::dexec] [manpage modules/grammar_fa/faop.man grammar::fa::op] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 | [manpage modules/grammar_fa/dexec.man grammar::fa::dexec] [manpage modules/grammar_fa/faop.man grammar::fa::op] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {state (de)serialization}] | > | 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {state (de)serialization}] |
︙ | ︙ | |||
3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [key TDPL] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [key TDPL] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {temp file}] | > | 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key {temp file}] |
︙ | ︙ | |||
3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 | [key {top-down parsing languages}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 | [key {top-down parsing languages}] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key torrent] | > | 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key torrent] |
︙ | ︙ | |||
3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 | [manpage modules/grammar_fa/faop.man grammar::fa::op] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] | > | 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 | [manpage modules/grammar_fa/faop.man grammar::fa::op] [manpage modules/grammar_me/me_intro.man grammar::me_intro] [manpage modules/grammar_peg/peg.man grammar::peg] [manpage modules/grammar_peg/peg_interp.man grammar::peg::interp] [manpage apps/pt.man pt] [manpage modules/pt/pt_astree.man pt::ast] [manpage modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl] [manpage modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea] [manpage modules/pt/pt_json_language.man pt::json_language] [manpage modules/pt/pt_param.man pt::param] [manpage modules/pt/pt_pexpression.man pt::pe] [manpage modules/pt/pt_pexpr_op.man pt::pe::op] [manpage modules/pt/pt_pegrammar.man pt::peg] [manpage modules/pt/pt_peg_container.man pt::peg::container] [manpage modules/pt/pt_peg_container_peg.man pt::peg::container::peg] |
︙ | ︙ | |||
3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key transfer] | > | 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 | [manpage modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam] [manpage modules/pt/pt_peg_language.man pt::peg_language] [manpage modules/pt/pt_peg_introduction.man pt::pegrammar] [manpage modules/pt/pt_pgen.man pt::pgen] [manpage modules/pt/pt_rdengine.man pt::rde] [manpage modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit] [manpage modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo] [manpage modules/pt/pt_util.man pt::util] [manpage modules/pt/pt_to_api.man pt_export_api] [manpage modules/pt/pt_from_api.man pt_import_api] [manpage modules/pt/pt_introduction.man pt_introduction] [manpage modules/pt/pt_parse_peg.man pt_parse_peg] [manpage modules/pt/pt_parser_api.man pt_parser_api] [manpage modules/pt/pt_peg_op.man pt_peg_op] [key transfer] |
︙ | ︙ |
Changes to support/devel/sak/doc/manpages.txt.
︙ | ︙ | |||
230 231 232 233 234 235 236 237 238 239 240 241 242 243 | modules/pop3/pop3.man modules/pop3d/pop3d.man modules/pop3d/pop3d_dbox.man modules/pop3d/pop3d_udb.man modules/profiler/profiler.man modules/pt/pt_astree.man modules/pt/pt_cparam_config_critcl.man modules/pt/pt_from_api.man modules/pt/pt_introduction.man modules/pt/pt_json_language.man modules/pt/pt_param.man modules/pt/pt_parse_peg.man modules/pt/pt_parser_api.man modules/pt/pt_peg_container.man | > | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | modules/pop3/pop3.man modules/pop3d/pop3d.man modules/pop3d/pop3d_dbox.man modules/pop3d/pop3d_udb.man modules/profiler/profiler.man modules/pt/pt_astree.man modules/pt/pt_cparam_config_critcl.man modules/pt/pt_cparam_config_tea.man modules/pt/pt_from_api.man modules/pt/pt_introduction.man modules/pt/pt_json_language.man modules/pt/pt_param.man modules/pt/pt_parse_peg.man modules/pt/pt_parser_api.man modules/pt/pt_peg_container.man |
︙ | ︙ | |||
267 268 269 270 271 272 273 274 275 276 277 278 279 280 | modules/pt/pt_pexpr_op.man modules/pt/pt_pexpression.man modules/pt/pt_pgen.man modules/pt/pt_rdengine.man modules/pt/pt_tclparam_config_snit.man modules/pt/pt_tclparam_config_tcloo.man modules/pt/pt_to_api.man modules/rc4/rc4.man modules/rcs/rcs.man modules/report/report.man modules/rest/rest.man modules/ripemd/ripemd128.man modules/ripemd/ripemd160.man modules/sasl/gtoken.man | > | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | modules/pt/pt_pexpr_op.man modules/pt/pt_pexpression.man modules/pt/pt_pgen.man modules/pt/pt_rdengine.man modules/pt/pt_tclparam_config_snit.man modules/pt/pt_tclparam_config_tcloo.man modules/pt/pt_to_api.man modules/pt/pt_util.man modules/rc4/rc4.man modules/rcs/rcs.man modules/report/report.man modules/rest/rest.man modules/ripemd/ripemd128.man modules/ripemd/ripemd160.man modules/sasl/gtoken.man |
︙ | ︙ |
Changes to support/devel/sak/doc/toc.txt.
︙ | ︙ | |||
268 269 270 271 272 273 274 275 276 277 278 279 280 281 | [item modules/page/page_util_peg.man page_util_peg {page PEG transformation utilities}] [item modules/page/page_util_quote.man page_util_quote {page character quoting utilities}] [division_end] [division_start {Parsing and Grammars}] [item apps/pt.man pt {Parser Tools Application}] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] | > | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | [item modules/page/page_util_peg.man page_util_peg {page PEG transformation utilities}] [item modules/page/page_util_quote.man page_util_quote {page character quoting utilities}] [division_end] [division_start {Parsing and Grammars}] [item apps/pt.man pt {Parser Tools Application}] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea {C/PARAM, Canned configuration, TEA}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] |
︙ | ︙ | |||
299 300 301 302 303 304 305 306 307 308 309 310 311 312 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] | > | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_util.man pt::util {General utilities}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] |
︙ | ︙ | |||
848 849 850 851 852 853 854 855 856 857 858 859 860 861 | [division_end] [division_start profiler] [item modules/profiler/profiler.man profiler {Tcl source code profiler}] [division_end] [division_start pt] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] | > | 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | [division_end] [division_start profiler] [item modules/profiler/profiler.man profiler {Tcl source code profiler}] [division_end] [division_start pt] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea {C/PARAM, Canned configuration, TEA}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] |
︙ | ︙ | |||
879 880 881 882 883 884 885 886 887 888 889 890 891 892 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] | > | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_util.man pt::util {General utilities}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] |
︙ | ︙ |
Changes to support/devel/sak/doc/toc_cats.txt.
︙ | ︙ | |||
268 269 270 271 272 273 274 275 276 277 278 279 280 281 | [item modules/page/page_util_peg.man page_util_peg {page PEG transformation utilities}] [item modules/page/page_util_quote.man page_util_quote {page character quoting utilities}] [division_end] [division_start {Parsing and Grammars}] [item apps/pt.man pt {Parser Tools Application}] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] | > | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | [item modules/page/page_util_peg.man page_util_peg {page PEG transformation utilities}] [item modules/page/page_util_quote.man page_util_quote {page character quoting utilities}] [division_end] [division_start {Parsing and Grammars}] [item apps/pt.man pt {Parser Tools Application}] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea {C/PARAM, Canned configuration, TEA}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] |
︙ | ︙ | |||
299 300 301 302 303 304 305 306 307 308 309 310 311 312 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] | > | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_util.man pt::util {General utilities}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] |
︙ | ︙ |
Changes to support/devel/sak/doc/toc_mods.txt.
︙ | ︙ | |||
378 379 380 381 382 383 384 385 386 387 388 389 390 391 | [division_end] [division_start profiler] [item modules/profiler/profiler.man profiler {Tcl source code profiler}] [division_end] [division_start pt] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] | > | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | [division_end] [division_start profiler] [item modules/profiler/profiler.man profiler {Tcl source code profiler}] [division_end] [division_start pt] [item modules/pt/pt_astree.man pt::ast {Abstract Syntax Tree Serialization}] [item modules/pt/pt_cparam_config_critcl.man pt::cparam::configuration::critcl {C/PARAM, Canned configuration, Critcl}] [item modules/pt/pt_cparam_config_tea.man pt::cparam::configuration::tea {C/PARAM, Canned configuration, TEA}] [item modules/pt/pt_json_language.man pt::json_language {The JSON Grammar Exchange Format}] [item modules/pt/pt_param.man pt::param {PackRat Machine Specification}] [item modules/pt/pt_pexpression.man pt::pe {Parsing Expression Serialization}] [item modules/pt/pt_pexpr_op.man pt::pe::op {Parsing Expression Utilities}] [item modules/pt/pt_pegrammar.man pt::peg {Parsing Expression Grammar Serialization}] [item modules/pt/pt_peg_container.man pt::peg::container {PEG Storage}] [item modules/pt/pt_peg_container_peg.man pt::peg::container::peg {PEG Storage. Canned PEG grammar specification}] |
︙ | ︙ | |||
409 410 411 412 413 414 415 416 417 418 419 420 421 422 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] | > | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | [item modules/pt/pt_peg_to_tclparam.man pt::peg::to::tclparam {PEG Conversion. Write TCLPARAM format}] [item modules/pt/pt_peg_language.man pt::peg_language {PEG Language Tutorial}] [item modules/pt/pt_peg_introduction.man pt::pegrammar {Introduction to Parsing Expression Grammars}] [item modules/pt/pt_pgen.man pt::pgen {Parser Generator}] [item modules/pt/pt_rdengine.man pt::rde {Parsing Runtime Support, PARAM based}] [item modules/pt/pt_tclparam_config_snit.man pt::tclparam::configuration::snit {Tcl/PARAM, Canned configuration, Snit}] [item modules/pt/pt_tclparam_config_tcloo.man pt::tclparam::configuration::tcloo {Tcl/PARAM, Canned configuration, Tcloo}] [item modules/pt/pt_util.man pt::util {General utilities}] [item modules/pt/pt_to_api.man pt_export_api {Parser Tools Export API}] [item modules/pt/pt_from_api.man pt_import_api {Parser Tools Import API}] [item modules/pt/pt_introduction.man pt_introduction {Introduction to Parser Tools}] [item modules/pt/pt_parse_peg.man pt_parse_peg {Parser Tools PEG Parser}] [item modules/pt/pt_parser_api.man pt_parser_api {Parser API}] [item modules/pt/pt_peg_op.man pt_peg_op {Parser Tools PE Grammar Utility Operations}] [division_end] |
︙ | ︙ |