Knowledge

Interpreter pattern

Source đź“ť

376: 25: 205:
For example, when many different or complex search expressions must be specified. Implementing (hard-wiring) them directly into a class is inflexible because it commits the class to particular expressions and makes it impossible to specify new expressions or change existing ones independently from
292: 175:
that describe how to solve recurring design problems to design flexible and reusable object-oriented software, that is, objects that are easier to implement, change, test, and reuse.
346:
object sends an interpret request to the abstract syntax tree. The request is forwarded to (performed on) all objects downwards the tree structure.
2086: 251:
The Interpreter pattern doesn't describe how to build an abstract syntax tree. This can be done either manually by a client or automatically by a
2200: 89: 61: 68: 42: 2725: 2833: 2750: 2070: 2037: 130: 108: 75: 2698: 2523: 2322: 57: 2416: 46: 2546: 2506: 2193: 198:
When a problem occurs very often, it could be considered to represent it as a sentence in a simple language (
2516: 2511: 2791: 2629: 2154: 2406: 1983: 2614: 2609: 2436: 300: 146: 2654: 2619: 2586: 2236: 2186: 1995: 199: 134: 2556: 2528: 2466: 2451: 2431: 2367: 2209: 2000: 82: 35: 2533: 2461: 2411: 2246: 241:
The expression objects are composed recursively into a composite/tree structure that is called
2062: 2055: 2812: 2715: 2561: 2541: 2486: 2624: 2581: 2576: 2566: 2476: 1978: 291: 277:
Most general-purpose computer languages actually incorporate several specialized languages.
150: 122: 8: 2664: 2649: 2644: 2501: 2386: 2150: 2052: 2786: 2765: 2674: 2571: 2421: 2314: 2266: 2228: 2080: 274:
Specialized computer languages that are often used to describe communication protocols.
142: 2168: 2018: 2456: 2299: 2289: 2284: 2256: 2251: 2066: 2033: 246: 158: 154: 133:
that specifies how to evaluate sentences in a language. The basic idea is to have a
2755: 2496: 2441: 2362: 2352: 2342: 2337: 188: 2745: 2691: 2669: 2446: 2401: 2372: 2347: 2327: 2274: 2241: 2217: 2027: 1989: 226:
Represent a sentence in the language by an abstract syntax tree (AST) made up of
171: 138: 375: 2730: 2591: 2294: 2279: 2159: 2124: 2100: 209: 2827: 2551: 2396: 2357: 2304: 386:
This C++11 implementation is based on the pre C++98 sample code in the book.
303: 202:) so that an interpreter can solve the problem by interpreting the sentence. 2173: 2807: 2770: 2659: 2634: 2426: 2178: 2023: 178: 2760: 2735: 2720: 2639: 2471: 2019: 295:
A sample UML class and object diagram for the Interpreter design pattern.
157:
and is used to evaluate (interpret) the sentence for a client. See also
2101:"The Interpreter design pattern - Problem, Solution, and Applicability" 342:
The object collaboration diagram shows the run-time interactions: The
169:
The Interpreter design pattern is one of the twenty-three well-known
2740: 2174:
Interpreter pattern description from the Portland Pattern Repository
24: 2053:
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (1994).
252: 2125:"The Interpreter design pattern - Structure and Collaboration" 2057:
Design Patterns: Elements of Reusable Object-Oriented Software
2029:
Design Patterns: Elements of Reusable Object-Oriented Software
2163: 324:
class has no children and interprets an expression directly.
210:
What solution does the Interpreter design pattern describe?
268: 179:
What problems can the Interpreter design pattern solve?
215:
Define a grammar for a simple language by defining an
194:
so that sentences in the language can be interpreted.
153:
of a sentence in the language is an instance of the
49:. Unsourced material may be challenged and removed. 2054: 356:) forward the request to their child expressions. 330:class maintains a container of child expressions ( 258:See also the UML class and object diagram below. 2825: 286: 2194: 267:Specialized database query languages such as 2208: 2085:: CS1 maint: multiple names: authors list ( 334:) and forwards interpret requests to these 2201: 2187: 2026:; Johnson, Ralph; Vlissides, John (1994). 314:interface for interpreting an expression 109:Learn how and when to remove this message 290: 366:) perform the interpretation directly. 191:for a simple language should be defined 2826: 206:(without having to change) the class. 2182: 369: 219:class hierarchy and implementing an 47:adding citations to reliable sources 18: 2046: 13: 2012: 14: 2845: 2144: 374: 233:Interpret a sentence by calling 23: 16:Approach in computer programming 2699:Enterprise Integration Patterns 34:needs additional citations for 2117: 2093: 1984:Combinatory logic in computing 1: 2006: 147:specialized computer language 287:UML class and object diagram 281: 7: 2792:Portland Pattern Repository 2061:. Addison Wesley. pp.  1972: 310:class refers to the common 164: 10: 2850: 2160:Interpreter implementation 2151:Interpreter implementation 381: 2800: 2779: 2708: 2683: 2600: 2485: 2385: 2313: 2265: 2227: 2216: 200:Domain Specific Languages 2834:Software design patterns 2417:Event-based asynchronous 2210:Software design patterns 1996:Domain-specific language 1961: 388: 2323:Chain of responsibility 2001:Interpreter (computing) 1959:The program output is: 261: 2462:Scheduled-task pattern 2412:Double-checked locking 296: 2813:Architectural pattern 2716:Christopher Alexander 2169:SourceMaking tutorial 364:tExpr1,tExpr2,… 350:NonTerminalExpression 328:NonTerminalExpression 294: 58:"Interpreter pattern" 2625:Dependency injection 2582:Inversion of control 2577:Data transfer object 2477:Thread-local storage 243:abstract syntax tree 123:computer programming 43:improve this article 2630:Intercepting filter 172:GoF design patterns 127:interpreter pattern 2787:The Hillside Group 2572:Data access object 2422:Guarded suspension 2407:Binding properties 2032:. Addison-Wesley. 360:TerminalExpression 322:TerminalExpression 316:interpret(context) 312:AbstractExpression 297: 2821: 2820: 2615:Business delegate 2547:Publish–subscribe 2381: 2380: 370:UML class diagram 247:Composite pattern 159:Composite pattern 155:composite pattern 137:for each symbol ( 119: 118: 111: 93: 2841: 2620:Composite entity 2497:Front controller 2237:Abstract factory 2225: 2224: 2203: 2196: 2189: 2180: 2179: 2139: 2138: 2136: 2135: 2121: 2115: 2114: 2112: 2111: 2097: 2091: 2090: 2084: 2076: 2060: 2050: 2044: 2043: 2016: 1979:Backus–Naur form 1968: 1965: 1955: 1952: 1949: 1946: 1943: 1940: 1937: 1934: 1931: 1928: 1925: 1922: 1919: 1916: 1913: 1910: 1907: 1904: 1901: 1898: 1895: 1892: 1889: 1886: 1883: 1880: 1877: 1874: 1871: 1868: 1865: 1862: 1859: 1856: 1853: 1850: 1847: 1844: 1841: 1838: 1835: 1832: 1829: 1826: 1823: 1820: 1817: 1814: 1811: 1808: 1805: 1802: 1799: 1796: 1793: 1790: 1787: 1784: 1781: 1778: 1775: 1772: 1769: 1766: 1763: 1760: 1757: 1754: 1751: 1748: 1745: 1742: 1739: 1736: 1733: 1730: 1727: 1724: 1721: 1718: 1715: 1712: 1709: 1706: 1703: 1700: 1697: 1694: 1691: 1688: 1685: 1682: 1679: 1676: 1673: 1670: 1667: 1664: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1631: 1628: 1625: 1622: 1619: 1616: 1613: 1610: 1607: 1604: 1601: 1598: 1595: 1592: 1589: 1586: 1583: 1580: 1577: 1574: 1573:// rule of three 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1547: 1544: 1541: 1538: 1535: 1532: 1529: 1526: 1523: 1520: 1517: 1514: 1511: 1508: 1505: 1502: 1499: 1496: 1493: 1490: 1487: 1484: 1481: 1478: 1475: 1472: 1469: 1466: 1463: 1460: 1457: 1454: 1451: 1448: 1445: 1442: 1439: 1436: 1433: 1430: 1427: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1319: 1316: 1313: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1265: 1262: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1154: 1151: 1148: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1111:// rule of three 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 812: 809: 806: 803: 800: 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 394:<iostream> 392: 378: 365: 361: 355: 351: 345: 337: 333: 329: 323: 317: 313: 309: 236: 229: 222: 218: 114: 107: 103: 100: 94: 92: 51: 27: 19: 2849: 2848: 2844: 2843: 2842: 2840: 2839: 2838: 2824: 2823: 2822: 2817: 2796: 2775: 2766:Douglas Schmidt 2746:Ward Cunningham 2704: 2692:Design Patterns 2679: 2670:Method chaining 2602: 2596: 2557:Service locator 2488: 2481: 2452:Read–write lock 2388: 2377: 2368:Template method 2309: 2261: 2219: 2212: 2207: 2147: 2142: 2133: 2131: 2123: 2122: 2118: 2109: 2107: 2099: 2098: 2094: 2078: 2077: 2073: 2051: 2047: 2040: 2017: 2013: 2009: 1990:Design Patterns 1975: 1970: 1969: 1966: 1963: 1957: 1956: 1953: 1950: 1947: 1944: 1941: 1938: 1935: 1932: 1929: 1926: 1923: 1920: 1917: 1914: 1911: 1908: 1905: 1902: 1899: 1896: 1893: 1890: 1887: 1884: 1881: 1878: 1875: 1872: 1869: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1830: 1827: 1824: 1821: 1818: 1815: 1812: 1809: 1806: 1803: 1800: 1797: 1794: 1791: 1788: 1785: 1782: 1779: 1776: 1773: 1770: 1767: 1764: 1761: 1758: 1755: 1752: 1749: 1746: 1743: 1740: 1737: 1734: 1731: 1728: 1725: 1722: 1719: 1716: 1713: 1710: 1707: 1704: 1701: 1698: 1695: 1692: 1689: 1686: 1683: 1680: 1677: 1674: 1671: 1668: 1665: 1662: 1659: 1656: 1653: 1650: 1647: 1644: 1641: 1638: 1635: 1632: 1629: 1626: 1623: 1620: 1617: 1614: 1611: 1608: 1605: 1602: 1599: 1596: 1593: 1590: 1587: 1584: 1581: 1578: 1575: 1572: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1530: 1527: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1494: 1491: 1488: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1428: 1425: 1422: 1419: 1416: 1413: 1410: 1407: 1404: 1401: 1398: 1395: 1392: 1389: 1386: 1383: 1380: 1377: 1374: 1371: 1368: 1365: 1362: 1359: 1356: 1353: 1350: 1347: 1344: 1341: 1338: 1335: 1332: 1329: 1326: 1323: 1320: 1317: 1314: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1263: 1260: 1257: 1254: 1251: 1248: 1245: 1242: 1239: 1236: 1233: 1230: 1227: 1224: 1221: 1218: 1215: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1161: 1158: 1155: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1056: 1053: 1050: 1047: 1044: 1041: 1038: 1035: 1032: 1029: 1026: 1023: 1020: 1017: 1014: 1011: 1008: 1005: 1002: 999: 996: 993: 990: 987: 984: 981: 978: 975: 972: 969: 966: 963: 960: 957: 954: 951: 948: 945: 942: 939: 936: 933: 930: 927: 924: 921: 918: 915: 912: 909: 906: 903: 900: 897: 894: 891: 888: 885: 882: 879: 876: 873: 870: 867: 864: 861: 858: 855: 852: 849: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 816: 813: 810: 807: 804: 801: 798: 795: 792: 789: 786: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 693: 690: 687: 684: 681: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 411: 408: 406:<cstring> 405: 402: 399: 396: 393: 390: 384: 372: 363: 359: 357: 354:ntExpr1,ntExpr2 353: 349: 347: 343: 339: 335: 331: 327: 325: 321: 319: 315: 311: 307: 289: 284: 264: 250: 234: 227: 220: 216: 212: 181: 167: 115: 104: 98: 95: 52: 50: 40: 28: 17: 12: 11: 5: 2847: 2837: 2836: 2819: 2818: 2816: 2815: 2810: 2804: 2802: 2798: 2797: 2795: 2794: 2789: 2783: 2781: 2777: 2776: 2774: 2773: 2768: 2763: 2758: 2753: 2748: 2743: 2738: 2733: 2731:John Vlissides 2728: 2723: 2718: 2712: 2710: 2706: 2705: 2703: 2702: 2695: 2687: 2685: 2681: 2680: 2678: 2677: 2672: 2667: 2662: 2657: 2652: 2647: 2642: 2637: 2632: 2627: 2622: 2617: 2612: 2606: 2604: 2598: 2597: 2595: 2594: 2589: 2584: 2579: 2574: 2569: 2564: 2559: 2554: 2549: 2544: 2539: 2531: 2526: 2521: 2520: 2519: 2514: 2504: 2499: 2493: 2491: 2483: 2482: 2480: 2479: 2474: 2469: 2464: 2459: 2454: 2449: 2444: 2439: 2434: 2429: 2424: 2419: 2414: 2409: 2404: 2399: 2393: 2391: 2383: 2382: 2379: 2378: 2376: 2375: 2370: 2365: 2360: 2355: 2350: 2345: 2340: 2335: 2330: 2325: 2319: 2317: 2311: 2310: 2308: 2307: 2302: 2297: 2292: 2287: 2282: 2277: 2271: 2269: 2263: 2262: 2260: 2259: 2254: 2249: 2247:Factory method 2244: 2239: 2233: 2231: 2222: 2214: 2213: 2206: 2205: 2198: 2191: 2183: 2177: 2176: 2171: 2166: 2157: 2146: 2145:External links 2143: 2141: 2140: 2116: 2092: 2071: 2045: 2038: 2010: 2008: 2005: 2004: 2003: 1998: 1993: 1986: 1981: 1974: 1971: 1962: 389: 383: 380: 371: 368: 288: 285: 283: 280: 279: 278: 275: 272: 263: 260: 239: 238: 231: 224: 211: 208: 196: 195: 192: 180: 177: 166: 163: 131:design pattern 117: 116: 31: 29: 22: 15: 9: 6: 4: 3: 2: 2846: 2835: 2832: 2831: 2829: 2814: 2811: 2809: 2806: 2805: 2803: 2799: 2793: 2790: 2788: 2785: 2784: 2782: 2778: 2772: 2769: 2767: 2764: 2762: 2759: 2757: 2756:Robert Martin 2754: 2752: 2751:Martin Fowler 2749: 2747: 2744: 2742: 2739: 2737: 2734: 2732: 2729: 2727: 2726:Ralph Johnson 2724: 2722: 2719: 2717: 2714: 2713: 2711: 2707: 2701: 2700: 2696: 2694: 2693: 2689: 2688: 2686: 2682: 2676: 2673: 2671: 2668: 2666: 2663: 2661: 2658: 2656: 2653: 2651: 2648: 2646: 2643: 2641: 2638: 2636: 2633: 2631: 2628: 2626: 2623: 2621: 2618: 2616: 2613: 2611: 2608: 2607: 2605: 2599: 2593: 2590: 2588: 2585: 2583: 2580: 2578: 2575: 2573: 2570: 2568: 2565: 2563: 2562:Active record 2560: 2558: 2555: 2553: 2552:Naked objects 2550: 2548: 2545: 2543: 2542:Specification 2540: 2538: 2536: 2532: 2530: 2527: 2525: 2522: 2518: 2515: 2513: 2510: 2509: 2508: 2505: 2503: 2500: 2498: 2495: 2494: 2492: 2490: 2487:Architectural 2484: 2478: 2475: 2473: 2470: 2468: 2465: 2463: 2460: 2458: 2455: 2453: 2450: 2448: 2445: 2443: 2440: 2438: 2435: 2433: 2430: 2428: 2425: 2423: 2420: 2418: 2415: 2413: 2410: 2408: 2405: 2403: 2400: 2398: 2397:Active object 2395: 2394: 2392: 2390: 2384: 2374: 2371: 2369: 2366: 2364: 2361: 2359: 2356: 2354: 2351: 2349: 2346: 2344: 2341: 2339: 2336: 2334: 2331: 2329: 2326: 2324: 2321: 2320: 2318: 2316: 2312: 2306: 2303: 2301: 2298: 2296: 2293: 2291: 2288: 2286: 2283: 2281: 2278: 2276: 2273: 2272: 2270: 2268: 2264: 2258: 2255: 2253: 2250: 2248: 2245: 2243: 2240: 2238: 2235: 2234: 2232: 2230: 2226: 2223: 2221: 2215: 2211: 2204: 2199: 2197: 2192: 2190: 2185: 2184: 2181: 2175: 2172: 2170: 2167: 2165: 2161: 2158: 2156: 2152: 2149: 2148: 2130: 2129:w3sDesign.com 2126: 2120: 2106: 2105:w3sDesign.com 2102: 2096: 2088: 2082: 2074: 2072:0-201-63361-2 2068: 2064: 2059: 2058: 2049: 2041: 2039:0-201-63361-2 2035: 2031: 2030: 2025: 2024:Helm, Richard 2021: 2015: 2011: 2002: 1999: 1997: 1994: 1992: 1991: 1987: 1985: 1982: 1980: 1977: 1976: 1960: 1726:"Y" 1699:"X" 387: 379: 377: 367: 340: 305: 304:class diagram 302: 299:In the above 293: 276: 273: 270: 266: 265: 259: 256: 254: 248: 244: 232: 225: 214: 213: 207: 203: 201: 193: 190: 186: 185: 184: 176: 174: 173: 162: 160: 156: 152: 148: 144: 140: 136: 132: 128: 124: 113: 110: 102: 99:November 2008 91: 88: 84: 81: 77: 74: 70: 67: 63: 60: â€“  59: 55: 54:Find sources: 48: 44: 38: 37: 32:This article 30: 26: 21: 20: 2808:Anti-pattern 2771:Linda Rising 2697: 2690: 2635:Lazy loading 2567:Identity map 2534: 2332: 2218:Gang of Four 2132:. Retrieved 2128: 2119: 2108:. Retrieved 2104: 2095: 2056: 2048: 2028: 2020:Gamma, Erich 2014: 1988: 1958: 1948:'\n' 1852:'\n' 385: 373: 341: 298: 257: 242: 240: 204: 197: 182: 170: 168: 126: 120: 105: 96: 86: 79: 72: 65: 53: 41:Please help 36:verification 33: 2780:Communities 2761:Jim Coplien 2736:Grady Booch 2721:Erich Gamma 2665:Type tunnel 2650:Object pool 2645:Null object 2640:Mock object 2502:Interceptor 2472:Thread pool 2387:Concurrency 2333:Interpreter 1720:VariableExp 1705:VariableExp 1693:VariableExp 1678:VariableExp 1132:VariableExp 1114:VariableExp 1093:VariableExp 1084:VariableExp 1069:VariableExp 1024:VariableExp 850:VariableExp 784:VariableExp 763:VariableExp 736:VariableExp 676:VariableExp 628:VariableExp 577:VariableExp 400:<map> 336:expressions 332:expressions 237:on the AST. 235:interpret() 221:interpret() 151:syntax tree 143:nonterminal 2675:Delegation 2610:Blackboard 2315:Behavioral 2267:Structural 2229:Creational 2134:2017-08-12 2110:2017-08-12 2007:References 1912:expression 1816:expression 1732:expression 1663:expression 1657:BooleanExp 1630:BooleanExp 1618:BooleanExp 1489:BooleanExp 1405:BooleanExp 1378:BooleanExp 1351:&& 1213:BooleanExp 1201:BooleanExp 1183:BooleanExp 1045:BooleanExp 946:BooleanExp 919:BooleanExp 772:BooleanExp 547:BooleanExp 526:BooleanExp 502:BooleanExp 454:BooleanExp 433:BooleanExp 421:BooleanExp 230:instances. 228:Expression 223:operation. 217:Expression 69:newspapers 2741:Kent Beck 2467:Semaphore 2457:Scheduler 2300:Flyweight 2290:Decorator 2285:Composite 2257:Singleton 2252:Prototype 2081:cite book 362:objects ( 352:objects ( 282:Structure 2828:Category 2801:See also 2603:patterns 2489:patterns 2442:Proactor 2389:patterns 2363:Strategy 2353:Observer 2343:Mediator 2338:Iterator 2220:patterns 1973:See also 1945:<< 1939:<< 1918:evaluate 1849:<< 1843:<< 1822:evaluate 1636:operand2 1624:operand1 1582:operator 1531:operand2 1519:operand1 1456:operand2 1432:operand1 1366:aContext 1360:evaluate 1354:operand2 1345:aContext 1339:evaluate 1333:operand1 1321:aContext 1309:evaluate 1267:operand2 1255:operand1 1240:operand2 1228:operand1 1120:operator 895:aContext 883:aContext 871:evaluate 475:evaluate 403:#include 397:#include 391:#include 183:Source: 165:Overview 139:terminal 2655:Servant 2587:Model 2 2447:Reactor 2437:Monitor 2402:Balking 2373:Visitor 2348:Memento 2328:Command 2275:Adapter 2242:Builder 1924:context 1882:context 1858:context 1828:context 1783:context 1759:context 1672:context 1669:Context 1612:private 1486:virtual 1462:replace 1438:replace 1384:replace 1375:virtual 1315:Context 1303:virtual 1297:default 1282:virtual 1246:nullptr 1234:nullptr 1150:private 1042:virtual 925:replace 916:virtual 877:Context 865:virtual 859:default 844:virtual 814:nullptr 715:private 598:Context 586:Context 544:virtual 508:replace 499:virtual 481:Context 469:virtual 463:default 448:virtual 442:default 412:Context 382:Example 189:grammar 145:) in a 83:scholar 2709:People 2592:Broker 2295:Facade 2280:Bridge 2069:  2036:  1942:result 1906:result 1888:assign 1864:assign 1846:result 1810:result 1789:assign 1765:assign 1741:AndExp 1606:delete 1594:AndExp 1576:AndExp 1567:delete 1555:AndExp 1546:AndExp 1513:AndExp 1507:return 1426:AndExp 1420:return 1330:return 1288:AndExp 1195:AndExp 1189:public 1180:public 1174:AndExp 1144:delete 1105:delete 1063:return 1018:return 994:return 973:strcmp 901:lookup 892:return 829:strdup 778:public 769:public 670:assign 643:return 619:lookup 592:public 427:public 344:Client 308:Client 306:, the 253:parser 149:. The 125:, the 85:  78:  71:  64:  56:  2684:Books 2601:Other 2537:-tier 2358:State 2305:Proxy 2063:243ff 1915:-> 1819:-> 1777:false 1597:& 1591:const 1579:& 1558:& 1552:const 1534:-> 1522:-> 1501:const 1468:name_ 1459:-> 1444:name_ 1435:-> 1408:& 1399:name_ 1390:const 1357:-> 1336:-> 1318:& 1171:class 1135:& 1129:const 1117:& 1096:& 1090:const 1057:const 979:name_ 949:& 940:name_ 931:const 880:& 835:name_ 799:name_ 790:const 760:class 733:const 706:value 691:value 625:const 583:class 574:class 559:const 529:& 514:const 484:& 418:class 409:class 245:(see 135:class 129:is a 90:JSTOR 76:books 2660:Twin 2517:MVVM 2432:Lock 2427:Join 2155:Ruby 2087:link 2067:ISBN 2034:ISBN 1936:cout 1900:true 1876:true 1840:cout 1807:bool 1801:true 1648:main 1540:()); 1537:copy 1525:copy 1495:copy 1393:char 1306:bool 1162:name 1156:char 1075:name 1051:copy 1030:name 1012:else 1003:copy 985:name 934:char 907:this 868:bool 823:name 808:name 793:char 748:> 745:bool 730:< 688:bool 667:void 616:bool 553:copy 517:char 472:bool 358:The 348:The 326:The 320:The 262:Uses 62:news 2529:ECS 2524:ADR 2512:MVP 2507:MVC 2164:C++ 2162:in 2153:in 1930:std 1834:std 1738:new 1717:new 1690:new 1645:int 1528:(), 1510:new 1474:exp 1450:exp 1423:new 1411:exp 1273:op2 1261:op1 1219:op2 1207:op1 1066:new 1021:new 1006:(); 997:exp 952:exp 727:map 721:std 682:key 658:key 634:key 301:UML 269:SQL 249:). 141:or 121:In 45:by 2830:: 2127:. 2103:. 2083:}} 2079:{{ 2065:. 2022:; 1933::: 1927:); 1903:); 1879:); 1837::: 1831:); 1804:); 1780:); 1756:); 1729:); 1702:); 1651:() 1642:}; 1498:() 1480:); 1453:), 1369:); 1291:() 1237:), 1168:}; 1078:); 1054:() 1033:); 988:)) 970:== 961:if 910:); 853:() 838:); 757:}; 724::: 661:); 652:at 613:{} 610:() 601:() 571:}; 556:() 457:() 436:() 338:. 318:. 255:. 187:A 161:. 2535:n 2202:e 2195:t 2188:v 2137:. 2113:. 2089:) 2075:. 2042:. 1967:1 1964:0 1954:} 1951:; 1921:( 1909:= 1897:, 1894:y 1891:( 1885:. 1873:, 1870:x 1867:( 1861:. 1855:; 1825:( 1813:= 1798:, 1795:y 1792:( 1786:. 1774:, 1771:x 1768:( 1762:. 1753:y 1750:, 1747:x 1744:( 1735:= 1723:( 1714:= 1711:y 1708:* 1696:( 1687:= 1684:x 1681:* 1675:; 1666:; 1660:* 1654:{ 1639:; 1633:* 1627:; 1621:* 1615:: 1609:; 1603:= 1600:) 1588:( 1585:= 1570:; 1564:= 1561:) 1549:( 1543:} 1516:( 1504:{ 1492:* 1483:} 1477:) 1471:, 1465:( 1447:, 1441:( 1429:( 1417:{ 1414:) 1402:, 1396:* 1387:( 1381:* 1372:} 1363:( 1348:) 1342:( 1327:{ 1324:) 1312:( 1300:; 1294:= 1285:~ 1279:} 1276:; 1270:= 1264:; 1258:= 1252:{ 1249:) 1243:( 1231:( 1225:: 1222:) 1216:* 1210:, 1204:* 1198:( 1192:: 1186:{ 1177:: 1165:; 1159:* 1153:: 1147:; 1141:= 1138:) 1126:( 1123:= 1108:; 1102:= 1099:) 1087:( 1081:} 1072:( 1060:{ 1048:* 1039:} 1036:} 1027:( 1015:{ 1009:} 1000:. 991:{ 982:, 976:( 967:0 964:( 958:{ 955:) 943:, 937:* 928:( 922:* 913:} 904:( 898:. 889:{ 886:) 874:( 862:; 856:= 847:~ 841:} 832:( 826:= 820:{ 817:) 811:( 805:: 802:) 796:* 787:( 781:: 775:{ 766:: 754:; 751:m 742:, 739:* 718:: 712:} 709:; 703:= 700:m 697:{ 694:) 685:, 679:* 673:( 664:} 655:( 649:. 646:m 640:{ 637:) 631:* 622:( 607:m 604:: 595:: 589:{ 580:; 568:; 565:0 562:= 550:* 541:; 538:0 535:= 532:) 523:, 520:* 511:( 505:* 496:; 493:0 490:= 487:) 478:( 466:; 460:= 451:~ 445:; 439:= 430:: 424:{ 415:; 271:. 112:) 106:( 101:) 97:( 87:· 80:· 73:· 66:· 39:.

Index


verification
improve this article
adding citations to reliable sources
"Interpreter pattern"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
computer programming
design pattern
class
terminal
nonterminal
specialized computer language
syntax tree
composite pattern
Composite pattern
GoF design patterns
grammar
Domain Specific Languages
Composite pattern
parser
SQL

UML
class diagram

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑