public function PathExpression($expectedTypes)
{
$token = $this->_lexer->lookahead;
$identVariable = $this->IdentificationVariable();
$field = null;
if ($this->_lexer->isNextToken(Lexer::T_DOT)) {
$this->match(Lexer::T_DOT);
$this->match(Lexer::T_IDENTIFIER);
$field = $this->_lexer->token['value'];
}
// Creating AST node
$pathExpr = new AST\PathExpression($expectedTypes, $identVariable, $field);
// Defer PathExpression validation if requested to be defered
$this->_deferredPathExpressions[] = array(
'expression' => $pathExpr,
'nestingLevel' => $this->_nestingLevel,
'token' => $this->_lexer->token,
);
return $pathExpr;
}