Package Martel :: Module Generate
[show private | hide private]
[frames | no frames]

Module Martel.Generate

Classes
CheckAssert  
CheckAssertNot  
CheckGroupRef  
GeneratorState  
HandleRepeatCount  
print_debug Print debug information
print_info Print information after each expression match
SetGroupValue  
_call_call  
_call_calltag  

Function Summary
  check_assert(text, x, end, tag_words)
  check_assert_not(text, x, end, tagtable)
  check_at_beginning(text, x, end)
  generate(expression, debug_level)
expression -> Parser for the Expression tree
  generate_alt(expression, genstate)
  generate_any(expression, genstate)
  generate_assert(expression, genstate)
  generate_at_beginning(expression, genstate)
  generate_at_end(expression, genstate)
  generate_debug(expression, genstate)
  generate_dot(expression, genstate)
  generate_eol(expression, genstate)
  generate_group(expression, genstate)
  generate_groupref(expression, genstate)
  generate_literal(expression, genstate)
  generate_max_repeat(expression, genstate)
  generate_named_max_repeat(expression, genstate)
  generate_null_op(expression, genstate)
  generate_parser(expression, debug_level)
  generate_pass_through(expression, genstate)
  generate_seq(expression, genstate)
  generate_str(expression, genstate)
  track_position(text, x, end)
store the start position of the farthest successful match
  _find_wanted_groupref_names(expression)
expression -> dict of group names wanted by elements of the tree
  _generate(expression, genstate)

Function Details

generate(expression, debug_level=0)

expression -> Parser for the Expression tree

track_position(text, x, end)

store the start position of the farthest successful match

This value is more useful than mxTextTools' default, which only points out the last text region successfully tagged at the top level. This value is the last region successfully tagged anywhere.

Uses a global variable so this is SINGLE THREADED!

_find_wanted_groupref_names(expression)

expression -> dict of group names wanted by elements of the tree

The dict is used to during tagtable generation to specify which groups need to save their match text. There's match-time overhead for doing that, and the code isn't thread safe, so the intent is to save only those groups that are needed.

The dict value is 1 if the group name is needed, else there is no entry in the dict.

XXX need to make this a method!

Generated by Epydoc 2.1 on Mon Aug 27 16:43:41 2007 http://epydoc.sf.net