public function compile(ExpressCompiler $compiler, $flags = 0)
	{
		try
		{
			if($flags & self::FLAG_RAW)
			{
				$compiler->write($this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp'));
			}
			else
			{
				$compiler->write("\t\ttry {\n");
				
				if($this->stringify)
				{
					if($this->expression->hasPipedFilter('raw'))
					{
						$contents = '$out->write(' . $this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp') . ');';
					}
					else
					{
						$contents = '$out->writeEscaped(' . $this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp') . ');';
					}
				}
				else
				{
					$contents = 'return ' . $this->expression->compile($compiler->getExpressionContextFactory(), false, $this->exp) . ';';
				}
				
				$compiler->write("\t\t" . $contents . "\n");
				$compiler->write("\t\t} catch(ExpressViewException \$ex) {\n");
				$compiler->write("\t\t\tthrow \$ex;\n");
				$compiler->write("\t\t} catch(\Exception \$ex) {\n");
				$compiler->write("\t\t\tthrow new ExpressViewException(");
				$compiler->write(var_export('Error during evaluation of expression "' . $this->expression . '"', true));
				$compiler->write(", \$this->getResource(), {$this->line}, \$ex);\n");
				$compiler->write("\t\t}\n");
			}
		}
		catch(ExpressViewException $e)
		{
			throw $e;
		}
		catch(\Exception $e)
		{
			throw new ExpressViewException(sprintf('Unable to compile expression "%s"', $this->expression), $compiler->getResource(), $this->line, $e);
		}
	}
public function compile(ExpressCompiler $compiler, $flags = 0)
	{
		try
		{
			if($flags & self::FLAG_RAW)
			{
				$compiler->write($this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp'));
			}
			else
			{
				$compiler->write("\t\ttry {\n");
				
				if($this->stringify)
				{
					if($this->expression->hasPipedFilter('raw'))
					{
						$contents = '$out->write(' . $this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp') . ');';
					}
					else
					{
						$contents = '$out->writeEscaped(' . $this->expression->compile($compiler->getExpressionContextFactory(), false, '$this->exp') . ');';
					}
				}
				else
				{
					$contents = 'return ' . $this->expression->compile($compiler->getExpressionContextFactory(), false, $this->exp) . ';';
				}
				
				$compiler->write("\t\t" . $contents . "\n");
				$compiler->write("\t\t} catch(ExpressViewException \$ex) {\n");
				$compiler->write("\t\t\tthrow \$ex;\n");
				$compiler->write("\t\t} catch(\Exception \$ex) {\n");
				$compiler->write("\t\t\tthrow new ExpressViewException(");
				$compiler->write(var_export('Error during evaluation of expression "' . $this->expression . '"', true));
				$compiler->write(", \$this->getResource(), {$this->line}, \$ex);\n");
				$compiler->write("\t\t}\n");
			}
		}
		catch(ExpressViewException $e)
		{
			throw $e;
		}
		catch(\Exception $e)
		{
			throw new ExpressViewException(sprintf('Unable to compile expression "%s"', $this->expression), $compiler->getResource(), $this->line, $e);
		}
	}
public function compile ( ExpressCompiler $ compiler , $ flags = 0 ) { try { if ( $ flags & self :: FLAG_RAW ) { $ compiler -> write ( $ this -> expression -> compile ( $ compiler -> getExpressionContextFactory ( ) , false , '$this->exp' ) ) ; } else { $ compiler -> write ( "\t\ttry {\n" ) ; if ( $ this -> stringify ) { if ( $ this -> expression -> hasPipedFilter ( 'raw' ) ) { $ contents = '$out->write(' . $ this -> expression -> compile ( $ compiler -> getExpressionContextFactory ( ) , false , '$this->exp' ) . ');' ; } else { $ contents = '$out->writeEscaped(' . $ this -> expression -> compile ( $ compiler -> getExpressionContextFactory ( ) , false , '$this->exp' ) . ');' ; } } else { $ contents = 'return ' . $ this -> expression -> compile ( $ compiler -> getExpressionContextFactory ( ) , false , $ this -> exp ) . ';' ; } $ compiler -> write ( "\t\t" . $ contents . "\n" ) ; $ compiler -> write ( "\t\t} catch(ExpressViewException \$ex) {\n" ) ; $ compiler -> write ( "\t\t\tthrow \$ex;\n" ) ; $ compiler -> write ( "\t\t} catch(\Exception \$ex) {\n" ) ; $ compiler -> write ( "\t\t\tthrow new ExpressViewException(" ) ; $ compiler -> write ( var_export ( 'Error during evaluation of expression "' . $ this -> expression . '"' , true ) ) ; $ compiler -> write ( ", \$this->getResource(), {$this->line}, \$ex);\n" ) ; $ compiler -> write ( "\t\t}\n" ) ; } } catch ( ExpressViewException $ e ) { throw $ e ; } catch ( \ Exception $ e ) { throw new ExpressViewException ( sprintf ( 'Unable to compile expression "%s"' , $ this -> expression ) , $ compiler -> getResource ( ) , $ this -> line , $ e ) ; } }
Compiles an expression into PHP code.

@param ExpressCompiler $compiler
@param integer $flags Raw mode is active when an element is morphed from a TagBuilder.
Compiles an expression into PHP code .