Changeset 530
- Timestamp:
- 02/25/08 00:02:02 (4 months ago)
- Files:
-
- cly/trunk/doc/developers-guide.rst (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/doc/developers-guide.rst
r529 r530 8 8 9 9 CLY provides a convenient means to easily build command-line interfaces. This 10 is achieved by defining a CLY grammar in either Python or XMLthen10 is achieved by defining a CLY grammar in either XML or Python then 11 11 constructing a CLY parser object from the grammar. The parser parses user 12 input against the grammar, executes callbacks, provides completion, and so on.12 input against the grammar, executes actions, provides completion, and so on. 13 13 14 14 A built-in terminal interface based on readline is provided. … … 381 381 <node name="echo"> 382 382 <variable name="text" pattern=".+"> 383 <action callback="echo( )"/>383 <action callback="echo(text)"/> 384 384 </variable> 385 385 </node> … … 444 444 </grammar> 445 445 446 This evaluation can also be forced by using the ``eval`` XML namespace: 447 448 .. code-block:: xml 449 450 <?xml version="1.0"?> 451 <grammar xmlns="http://swapoff.org/cly/xml" xmlns:eval="http://swapoff.org/cly/xml-eval"> 452 <node eval:help="'HELLO WORLD'.title()"/> 453 ... 454 </node> 455 </grammar> 456 446 Extra attribute conversions can be provided to the ``XMLGrammar`` by passing 447 a dictionary of attribute names to type conversion functions, as the 448 ``attr_type_map`` keyword argument. 457 449 458 450 Parsing
