Ejemplo n.º 1
0
 public function compile(ExpressionInterface $expression)
 {
     $rewritten_expression = $expression;
     $result_rewriter = null;
     if ($this->rewriter->canRewrite($expression) === true) {
         $rewritten = $this->rewriter->rewriteExpression($expression);
         $rewritten_expression = $rewritten->getExpression();
         $result_rewriter = $rewritten->getResultRewriter();
     }
     $parser = $this->compiler->compile($rewritten_expression);
     if ($result_rewriter === null) {
         return $parser;
     }
     return new RewriterParser($parser, $result_rewriter);
 }
 public function compile(ExpressionInterface $expression)
 {
     return new StringToBacktrackingStreamingParserAdapter($this->string_parser_compiler->compile($expression));
 }
Ejemplo n.º 3
0
 public function compile(ExpressionInterface $expression)
 {
     $this->asserter->assertExpression($expression);
     return $this->inner_compiler->compile($expression);
 }