Popular recipes tagged "language" but not "trac"http://code.activestate.com/recipes/tags/language-trac/2016-12-11T16:28:50-08:00ActiveState Code RecipesSimulate C's switch statement (Python)
2016-12-11T16:28:50-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580730-simulate-cs-switch-statement/
<p style="color: grey">
Python
recipe 580730
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/features/">features</a>, <a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/switch/">switch</a>).
</p>
<p>This recipe shows a Python construct that can behave somewhat like C's switch statement. It is not a perfect one-to-one simulation. But it does have some of the features of the C switch. One feature not supported is the fall-through feature in C's switch.</p>
small stack language (Python)
2013-07-22T23:53:44-07:00Andrew Wayne Teesdale Jr.http://code.activestate.com/recipes/users/4187305/http://code.activestate.com/recipes/578617-small-stack-language/
<p style="color: grey">
Python
recipe 578617
by <a href="/recipes/users/4187305/">Andrew Wayne Teesdale Jr.</a>
(<a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/stack/">stack</a>).
</p>
<p>a small language in python</p>
Useful Unrestricted Grammar (Python)
2012-03-27T19:30:47-07:00Shea Kauffmanhttp://code.activestate.com/recipes/users/4168682/http://code.activestate.com/recipes/578087-useful-unrestricted-grammar/
<p style="color: grey">
Python
recipe 578087
by <a href="/recipes/users/4168682/">Shea Kauffman</a>
(<a href="/recipes/tags/dict/">dict</a>, <a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/grammar/">grammar</a>, <a href="/recipes/tags/grammer/">grammer</a>, <a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/thue/">thue</a>, <a href="/recipes/tags/turing_machine/">turing_machine</a>, <a href="/recipes/tags/unrestricted/">unrestricted</a>).
</p>
<p>This is an implementation of an easy to use unrestricted grammar. It could be used for quickly prototyping a DSL, testing a post-formal system, or parsing test in a way that requires context. It would however be extremely slow for simple substitutions.</p>
Unrestricted Grammar used like a dictionary (Python)
2009-01-04T19:10:28-08:00Shea Kauffmanhttp://code.activestate.com/recipes/users/4168682/http://code.activestate.com/recipes/576606-unrestricted-grammar-used-like-a-dictionary/
<p style="color: grey">
Python
recipe 576606
by <a href="/recipes/users/4168682/">Shea Kauffman</a>
(<a href="/recipes/tags/dict/">dict</a>, <a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/grammar/">grammar</a>, <a href="/recipes/tags/grammer/">grammer</a>, <a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/thue/">thue</a>, <a href="/recipes/tags/turing_machine/">turing_machine</a>).
</p>
<p>Programs can be written as substitutions. This allows a set of substitution rules to be defined and then strings are transformed using these rules in a left recursive manner.</p>