public function compile(array $ast)
    {
        $transformations = array();

        foreach ($ast as $section => $rules) {
            foreach ($rules as $rule) {
                $transformations[$section][] = $this->compileRule($rule);
            }
        }

        return $transformations;
    }
public function compile(array $ast)
    {
        $transformations = array();

        foreach ($ast as $section => $rules) {
            foreach ($rules as $rule) {
                $transformations[$section][] = $this->compileRule($rule);
            }
        }

        return $transformations;
    }
public function compile ( array $ ast ) { $ transformations = array ( ) ; foreach ( $ ast as $ section => $ rules ) { foreach ( $ rules as $ rule ) { $ transformations [ $ section ] [ ] = $ this -> compileRule ( $ rule ) ; } } return $ transformations ; }
Compile AST into a set of regular expressions.

The returned array contains a set of regular expressions and their
replacement callbacks. The regular expressions can then be applied to
strings to executed the transformations.

@param array $ast

@return array
Compile AST into a set of regular expressions .