コード例 #1
0
ファイル: MetaModel.php プロジェクト: mnapoli/metamodel
 /**
  * Run a MetaModel expression
  * @param string $expression
  * @throws ParsingException
  * @return mixed
  */
 public function run($expression)
 {
     // Parses the expression
     try {
         $ast = $this->parser->parse($expression);
     } catch (SyntaxErrorException $e) {
         throw new ParsingException($e->getMessage(), 0, $e);
     }
     return $ast->execute($this);
 }
コード例 #2
0
ファイル: ParserTest.php プロジェクト: mnapoli/metamodel
 /**
  * @test
  * @expectedException \JMS\Parser\SyntaxErrorException
  */
 public function selectorShouldNotBeNested()
 {
     $parser = Parser::create();
     $parser->parse('Article(1).Article(2)');
 }