parse.cc

来自「2007年机器人足球世界杯3D仿真组亚军」· CC 代码 · 共 31 行

CC
31
字号
#include "parser.ih"rPredicate Parser::parse(std::string const &_msg){  Token tok;  rPredicate pred = new Predicate(Predicate::type_list);  tok.type = Token::none;  // Initialize the lexer.  initLex(_msg);  while (true) {    // lex the next token.    tok = lex();    // LPARENT | END_OF_LINE    if (tok.type == Token::lparent) {      lexPushBack(tok);      pred->push(parsePred());    } else if (tok.type == Token::end_of_line) {      break;    } else      throw parser_error("parser error, expected '(' or END_OF_LINE");  }  return pred;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?