anchor.diff:                  self.writeln("args = []")
                   self.writeln("kargs = {}")
   			}
  -		( element )+
  +		( predicate )+
  +		( INTO ( production )+ )?
   			{
                   self.writeln("return result")
                   self.deindent()
  
positive.code: 		{ ret = "[%s]" % l }
  	| #( APPL c=stringify_term_cons a=stringify_term_list )
  		{ ret = "%s(%s)" % (c, a) }
  	| #( TRNSF . )
  		{ ret = "_" }
  	;
  
  stringify_term_cons returns [ret]
  
negative.code: 	  )
  	;
  
  predicate
  	: ( ACTION ) => action
  	| p:SEMPRED 
  	        {
                  self.writeln("if not (%s):" % p)
                  self.indent()
                  self.writeln("raise TransformationFailureException")
                  self.deindent()
  	        }
  	| pattern=t:stringify_term
  	        {
                  self.writeln("if not self.factory.match(%r, target, args, kargs):" % pattern)
                  self.indent()
                  self.writeln("raise TransformationFailureException")
                  self.deindent()
                  if not self.is_static_term(#t):
                      self.argn = 0
                      self.post_match_term(#t)
                      self.writeln("result = self.factory.make(%r, *args, **kargs)" % pattern)
  	        }
  	;
  
  production
  	: ( ACTION ) => action
  	| flag=t:is_static_term
  		{
              if flag:
                  pattern = self.stringify_term(#t)
                  self.writeln("result = self.factory.make(%r, *args, **kargs)" % pattern)
              else:
                  pattern = self.build_term(#t)
                  self.writeln("result = %s.make(*args, **kargs)" % pattern)
          }
  	;
  
  is_static_term returns [ret]
  