Does Python compete with Java?

Daniel Yoo dyoo at hkn.eecs.berkeley.edu
Wed Apr 14 21:42:24 EDT 2004


Jakub Fast <kfast at poczta.onet.pl> wrote:

: On quite another note, is it possible to define your own operators in 

: learning them actually might turn out useful for whatever they want to 
: do in the future -- more useful than, say, prolog) and nothing can beat 
: the intuitive appeal of

: S ==> (NP and VP) or VP

: over CFGProduction(S, NP, VP), CFGProduction(S, VP) for specifying your 
: simple cfg, dcg or ebnf rules if you're completely new to programming 
: and have just been given a programming assignment :)

Hi Jakub,

You may then want to give your students a prewritten parser that takes
a string like "(NP and VP) or VP" and reproduces the kind of data
structure that you want.  John Aycock's SPARK toolkit is a really nice
tool for building such a tool:

    http://pages.cpsc.ucalgary.ca/~aycock/spark/


As an example, you may find:

    http://hkn.eecs.berkeley.edu/~dyoo/python/propositions/

interesting --- I wrote it a LONG LONG time ago, but it may be useful
for you.  It is not production code by a long shot, but may still
serve as a beginning.


Good luck!



More information about the Python-list mailing list