Content deleted Content added
Stevebroshar (talk | contribs) Use 'function' consistently throughout (except for quotes) |
Stevebroshar (talk | contribs) →top: remove uncited and arguable claim Tags: Mobile edit Mobile app edit Android app edit App section source |
||
Line 2:
{{Refimprove|date=February 2009}}
[[File:Control table.png|thumb|220px|Control table that directs program flow according to the value of a single input value. Each entry holds a possible input value and a reference to an associated function.]]
A '''control table''' is a table [[data structure]] (i.e. [[Array (data structure)|array]] of [[Record (computer science)|record]]s) used to direct the [[control flow]] of a [[computer program]]. [[Software]] that uses a control table is said to be ''table-driven''.<ref>''Programs from decision tables'', Humby, E., 2007,Macdonald, 1973 ... Biggerstaff, Ted J. Englewood Cliffs, NJ : Prentice-Hall {{ISBN|0-444-19569-6}}</ref><ref>{{Cite web |url=http://www.dkl.com/wp-content/uploads/2016/05/DataKinetics-Table-Driven-Design.pdf |title=Archived copy |access-date=17 May 2016 |archive-date=10 June 2016 |archive-url=https://web.archive.org/web/20160610160908/http://www.dkl.com/wp-content/uploads/2016/05/DataKinetics-Table-Driven-Design.pdf |url-status=dead }}</ref> A control table encodes both the [[Parameter (computer programming)|parameters]] to a [[conditional (programming)|conditional expression]] and a [[Function (computer programming)|function]] [[reference (computer science)|reference]]. An [[interpreter (computing)|interpreter]] processes a table by evaluating the conditional expression for input data and invoking the selected function. Using a control table can reduce the need for repetitive code that implements the same logic
In general, the mapping of input parameters can be via any data structure. A common data structure is the [[lookup table |lookup]] which provides relatively high performance but at a relatively high memory footprint. An [[associative array]] can minimize memory use at the cost of more lookup time.
|