Module bison
[show private | hide private]
[frames | no frames]

Module bison

Wrapper module for interfacing with Bison (yacc)

Written April 2004 by David McNab <david@freenet.org.nz> Copyright (c) 2004 by David McNab, all rights reserved.

Released under the GNU General Public License, a copy of which should appear in this distribution in the file called 'COPYING'. If this file is missing, then you can obtain a copy of the GPL license document from the GNU website at http://www.gnu.org.

This software is released with no warranty whatsoever. Use it at your own risk.

If you wish to use this software in a commercial application, and wish to depart from the GPL licensing requirements, please contact the author and apply for a commercial license.
Classes
BisonError Flags an error to yyparse()
BisonNode Generic class for wrapping parse targets.
BisonParser Base parser class

Exceptions
ParserSyntaxError  

Function Summary
  bisonToPython(bisonfileName, lexfileName, pyfileName, generateClasses)
Rips the rules, tokens and precedences from a bison file, and the verbatim text from a lex file and generates a boilerplate python file containing a Parser class with handler methods and grammar attributes

Variable Summary
SRE_Pattern reSpaces = \s+

Function Details

bisonToPython(bisonfileName, lexfileName, pyfileName, generateClasses=0)

Rips the rules, tokens and precedences from a bison file, and the verbatim text from a lex file and generates a boilerplate python file containing a Parser class with handler methods and grammar attributes

Arguments:
  • bisonfileName - name of input bison script
  • lexfileName - name of input flex script
  • pyfileName - name of output python file
  • generateClasses - flag - default 0 - if 1, causes a unique class to be defined for each parse target, and for the corresponding target handler method in the main Parser class to use this class when creating the node.

Variable Details

reSpaces

Type:
SRE_Pattern
Value:
\s+                                                                    

Generated by Epydoc 2.0 on Sun Jun 27 12:36:56 2004 http://epydoc.sf.net