• Home
  • Raw
  • Download

Lines Matching refs:ParseNode

107 scoped_ptr<ParseNode> Parser::Parse(const std::vector<Token>& tokens,  in Parse()
110 return p.ParseFile().PassAs<ParseNode>(); in Parse()
114 scoped_ptr<ParseNode> Parser::ParseExpression(const std::vector<Token>& tokens, in ParseExpression()
120 bool Parser::IsAssignment(const ParseNode* node) const { in IsAssignment()
188 scoped_ptr<ParseNode> Parser::ParseExpression() { in ParseExpression()
192 scoped_ptr<ParseNode> Parser::ParseExpression(int precedence) { in ParseExpression()
194 return scoped_ptr<ParseNode>(); in ParseExpression()
203 return scoped_ptr<ParseNode>(); in ParseExpression()
206 scoped_ptr<ParseNode> left = (this->*prefix)(token); in ParseExpression()
218 return scoped_ptr<ParseNode>(); in ParseExpression()
222 return scoped_ptr<ParseNode>(); in ParseExpression()
228 scoped_ptr<ParseNode> Parser::Literal(Token token) { in Literal()
229 return scoped_ptr<ParseNode>(new LiteralNode(token)).Pass(); in Literal()
232 scoped_ptr<ParseNode> Parser::Name(Token token) { in Name()
233 return IdentifierOrCall(scoped_ptr<ParseNode>(), token).Pass(); in Name()
236 scoped_ptr<ParseNode> Parser::BlockComment(Token token) { in BlockComment()
239 return comment.PassAs<ParseNode>(); in BlockComment()
242 scoped_ptr<ParseNode> Parser::Group(Token token) { in Group()
243 scoped_ptr<ParseNode> expr = ParseExpression(); in Group()
245 return scoped_ptr<ParseNode>(); in Group()
250 scoped_ptr<ParseNode> Parser::Not(Token token) { in Not()
251 scoped_ptr<ParseNode> expr = ParseExpression(PRECEDENCE_PREFIX + 1); in Not()
253 return scoped_ptr<ParseNode>(); in Not()
257 return unary_op.PassAs<ParseNode>(); in Not()
260 scoped_ptr<ParseNode> Parser::List(Token node) { in List()
261 scoped_ptr<ParseNode> list(ParseList(node, Token::RIGHT_BRACKET, true)); in List()
267 scoped_ptr<ParseNode> Parser::BinaryOperator(scoped_ptr<ParseNode> left, in BinaryOperator()
269 scoped_ptr<ParseNode> right = in BinaryOperator()
275 return scoped_ptr<ParseNode>(); in BinaryOperator()
281 return binary_op.PassAs<ParseNode>(); in BinaryOperator()
284 scoped_ptr<ParseNode> Parser::IdentifierOrCall(scoped_ptr<ParseNode> left, in IdentifierOrCall()
300 return scoped_ptr<ParseNode>(); in IdentifierOrCall()
307 return scoped_ptr<ParseNode>(); in IdentifierOrCall()
313 return scoped_ptr<ParseNode>(new IdentifierNode(token)).Pass(); in IdentifierOrCall()
320 return func_call.PassAs<ParseNode>(); in IdentifierOrCall()
323 scoped_ptr<ParseNode> Parser::Assignment(scoped_ptr<ParseNode> left, in Assignment()
327 return scoped_ptr<ParseNode>(); in Assignment()
329 scoped_ptr<ParseNode> value = ParseExpression(PRECEDENCE_ASSIGNMENT); in Assignment()
334 return assign.PassAs<ParseNode>(); in Assignment()
337 scoped_ptr<ParseNode> Parser::Subscript(scoped_ptr<ParseNode> left, in Subscript()
346 return scoped_ptr<ParseNode>(); in Subscript()
348 scoped_ptr<ParseNode> value = ParseExpression(); in Subscript()
353 return accessor.PassAs<ParseNode>(); in Subscript()
356 scoped_ptr<ParseNode> Parser::DotOperator(scoped_ptr<ParseNode> left, in DotOperator()
363 return scoped_ptr<ParseNode>(); in DotOperator()
366 scoped_ptr<ParseNode> right = ParseExpression(PRECEDENCE_DOT); in DotOperator()
370 return scoped_ptr<ParseNode>(); in DotOperator()
377 return accessor.PassAs<ParseNode>(); in DotOperator()
425 scoped_ptr<ParseNode> Parser::ParseFile() { in ParseFile()
430 scoped_ptr<ParseNode> statement = ParseStatement(); in ParseFile()
438 return scoped_ptr<ParseNode>(); in ParseFile()
446 return file.PassAs<ParseNode>(); in ParseFile()
449 scoped_ptr<ParseNode> Parser::ParseStatement() { in ParseStatement()
451 return ParseBlock().PassAs<ParseNode>(); in ParseStatement()
459 scoped_ptr<ParseNode> stmt = ParseExpression(); in ParseStatement()
468 return scoped_ptr<ParseNode>(); in ParseStatement()
486 scoped_ptr<ParseNode> statement = ParseStatement(); in ParseBlock()
494 scoped_ptr<ParseNode> Parser::ParseCondition() { in ParseCondition()
506 return scoped_ptr<ParseNode>(); in ParseCondition()
507 return condition.PassAs<ParseNode>(); in ParseCondition()
510 void Parser::TraverseOrder(const ParseNode* root, in TraverseOrder()
511 std::vector<const ParseNode*>* pre, in TraverseOrder()
512 std::vector<const ParseNode*>* post) { in TraverseOrder()
523 const std::vector<ParseNode*>& statements = block->statements(); in TraverseOrder()
524 for (std::vector<ParseNode*>::const_iterator i(statements.begin()); in TraverseOrder()
539 const std::vector<const ParseNode*>& contents = list->contents(); in TraverseOrder()
540 for (std::vector<const ParseNode*>::const_iterator i(contents.begin()); in TraverseOrder()
559 void Parser::AssignComments(ParseNode* file) { in AssignComments()
562 std::vector<const ParseNode*> pre; in AssignComments()
563 std::vector<const ParseNode*> post; in AssignComments()
568 for (std::vector<const ParseNode*>::const_iterator i = pre.begin(); in AssignComments()
574 const_cast<ParseNode*>(*i)->comments_mutable()->append_before( in AssignComments()
590 for (std::vector<const ParseNode*>::const_reverse_iterator i = post.rbegin(); in AssignComments()
613 const_cast<ParseNode*>(*i)->comments_mutable()->append_suffix( in AssignComments()
623 const_cast<ParseNode*>(*i)->comments_mutable()->ReverseSuffix(); in AssignComments()