Class: R2CRewriter

Class | R2CRewriter
In: | lib/rewriter.rb
Parent: | SexpProcessor

R2CRewriter (should probably move this out to its own file) does rewritings that are language specific to C.

### Methods

process_call

### Constants

REWRITES | = | { [Type.str, :+, Type.str] => proc { |l,n,r| t(:call, nil, :strcat, r.unshift(r.shift, l), Type.str) |  | REWRITES maps a function signature to a proc responsible for generating the appropriate sexp for that rewriting.

### Public Instance methods

process_call(exp)

Rewrites function calls by looking them up in the REWRITES map. If a match exists, it invokes the block passing in the lhs, rhs, and function name. If one does not exist, it simply repacks the sexp and sends it along.

[Validate]