static void HandleDefinition() {
    if (shared_ptr<ExprAST> E = ParseDefinition()) {
        E->codegen();
        //cout<<"Parsed a function definition.\n";
    } else {
        getNextToken();
    }
}
Exemple #2
0
static void HandleDefinition() {
  if (ParseDefinition()) {
    fprintf(stderr, "Parsed a function definition.\n");
  } else {
    // Skip token for error recovery.
    getNextToken();
  }
}
Exemple #3
0
void
HandleDefinition()
{
    if ( ParseDefinition() )
        std::cout << "...parsed a function definition.\n";
    else
        getNextToken();
}
Exemple #4
0
static void HandleDefinition()
{
    if (ParseDefinition()) {
        fprintf(stderr, "Parsed a function definition.\n");
    }

    else {
        getNextToken();
    }
}
Exemple #5
0
void UDFParser::ParseUDF(codegen::CodeGen &cg, codegen::FunctionBuilder &fb,
                         std::string func_body, std::string func_name,
                         std::vector<arg_type> args_type) {
  func_name_ = func_name;
  func_body_string_ = func_body;
  args_type_ = args_type;
  func_body_iterator_ = func_body_string_.begin();
  last_char_ = ' ';

  if (auto func = ParseDefinition()) {
    if (auto *func_ptr = func->Codegen(cg, fb)) {
      auto &code_context = cg.GetCodeContext();
      // Required for referencing from Peloton code
      code_context.SetUDF(func_ptr);

      // To check correctness of the codegened UDF
      func_ptr->dump();
    }
  }
}