Tcl Library Source Code

Check-in [8cd8a7435f]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

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

Overview
Comment:Kleene star and optionals are better deemed realizable by definition.
Timelines: family | ancestors | descendants | both | pt-container-ssoberni
Files: files | file ages | folders
SHA3-256:8cd8a7435ffcd61d51b5d8c4bf1ff6cad3dd5f2fd6e906f03665a16fa195d5dc
User & Date: ssoberni 2018-06-14 14:02:26
Context
2018-06-14
14:31
The drop operation should only be permissive on choices (reflecting the realizability condition on choice). New expressions should not be constructed for expressions other than choice. check-in: f70ef61b95 user: ssoberni tags: pt-container-ssoberni
14:02
Kleene star and optionals are better deemed realizable by definition. check-in: 8cd8a7435f user: ssoberni tags: pt-container-ssoberni
09:48
Fix typo in variable use check-in: b08e3a4fd7 user: ssoberni tags: pt-container-ssoberni
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/pt/pt_peg_op.tcl.

300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
	    # Choice is realizable if we have at least one realizable
	    # branch. This is also the place where we have to remove
	    # unrealizable children when we drop unrealizable symbols
	    # from a grammar.

	    return [tcl::mathfunc::max {*}$arguments]
	}
	x - * - + - ? - & - ! {
	    # All other operators are realizable if and only if all
	    # its children are realizable.

	    return [tcl::mathfunc::min {*}$arguments]
	}
	default {
	    # The terminals and special forms are realizable by
	    # definition.
	    return 1
	}
    }
}

proc ::pt::peg::op::drop::unrealizable {container} {








|






|
|







300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
	    # Choice is realizable if we have at least one realizable
	    # branch. This is also the place where we have to remove
	    # unrealizable children when we drop unrealizable symbols
	    # from a grammar.

	    return [tcl::mathfunc::max {*}$arguments]
	}
	x - + - & - ! {
	    # All other operators are realizable if and only if all
	    # its children are realizable.

	    return [tcl::mathfunc::min {*}$arguments]
	}
	default {
	    # Terminals, special forms, Kleene closure (*), and
	    # optionals (?) are realizable by definition.
	    return 1
	}
    }
}

proc ::pt::peg::op::drop::unrealizable {container} {