<commit_before>//=======================================================================
// Copyright <NAME> 2011-2016.
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifndef MTAC_OPERATOR_H
#define MTAC_OPERATOR_H

#include "ast/Operator.hpp"

namespace eddic {

namespace mtac {

enum class Operator : unsigned int {
    /* Assignment operators  */
    ASSIGN,
    FASSIGN,
    PASSIGN,

    /* Integer operators */
    ADD,
    SUB,
    MUL,
    DIV,
    MOD,

    /* Float operators  */
    FADD,
    FSUB,
    FMUL,
    FDIV,

    /* relational operators for expressions */
    EQUALS,
    NOT_EQUALS,
    GREATER,
    GREATER_EQUALS,
    LESS,
    LESS_EQUALS,
    
    /* Operators for If */

    IF_UNARY,

    /* relational operators */
    IF_EQUALS,
    IF_NOT_EQUALS,
    IF_GREATER,
    IF_GREATER_EQUALS,
    IF_LESS,
    IF_LESS_EQUALS,
    
    /* float relational operators */
    IF_FE,
    IF_FNE,
    IF_FG,
    IF_FGE,
    IF_FLE,
    IF_FL,

    /* Operators for IfFalse */
    
    IF_FALSE_UNARY,

    /* relational operators */
    IF_FALSE_EQUALS,
    IF_FALSE_NOT_EQUALS,
    IF_FALSE_GREATER,
    IF_FALSE_GREATER_EQUALS,
    IF_FALSE_LESS,
    IF_FALSE_LESS_EQUALS,
    
    /* float relational operators */
    IF_FALSE_FE,
    IF_FALSE_FNE,
    IF_FALSE_FG,
    IF_FALSE_FGE,
    IF_FALSE_FLE,
    IF_FALSE_FL,

    /* boolean operators */
    NOT,
    AND,
    
    /* float relational operators */
    FE,
    FNE,
    FG,
    FGE,
    FLE,
    FL,

    MINUS,          //result = -arg1
    FMINUS,         //result = -arg1

    I2F,            //result = (float) arg1
    F2I,            //result = (int) arg1
    
    DOT,            //result = (arg1)+arg2
    FDOT,           //result = (arg1)+arg2
    PDOT,           //result = address of arg1 + arg2
    
    DOT_ASSIGN,     //result+arg1=arg2
    DOT_FASSIGN,    //result+arg1=arg2
    DOT_PASSIGN,    //result+arg1=arg2
    
    GOTO,           //jump to a basic block (label in arg1)

    RETURN,         //return from a function

    NOP,            //for optimization purpose

    PARAM,          //for parameter passing
    PPARAM,         //for parameter passing by address
    
    CALL,           //call functions

    LABEL           //label in arg1
};

mtac::Operator toOperator(ast::Operator op);
mtac::Operator toFloatOperator(ast::Operator op);

mtac::Operator toRelationalOperator(ast::Operator op);
mtac::Operator toFloatRelationalOperator(ast::Operator op);
<commit_msg>Some doc<commit_after>//=======================================================================
// Copyright <NAME> 2011-2016.
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifndef MTAC_OPERATOR_H
#define MTAC_OPERATOR_H

#include "ast/Operator.hpp"

namespace eddic {

namespace mtac {

/*!
 * \brief Type of operator in MTAC
 */
enum class Operator : unsigned int {
  ASSIGN,  ///< Assign
  FASSIGN, ///< Float assign
  PASSIGN, ///< Pointer assign

  /* Integer operators */
  ADD,
  SUB,
  MUL,
  DIV,
  MOD,

  /* Float operators  */
  FADD,
  FSUB,
  FMUL,
  FDIV,

  /* relational operators for expressions */
  EQUALS,
  NOT_EQUALS,
  GREATER,
  GREATER_EQUALS,
  LESS,
  LESS_EQUALS,

  /* Operators for If */

  IF_UNARY,

  /* relational operators */
  IF_EQUALS,
  IF_NOT_EQUALS,
  IF_GREATER,
  IF_GREATER_EQUALS,
  IF_LESS,
  IF_LESS_EQUALS,

  /* float relational operators */
  IF_FE,
  IF_FNE,
  IF_FG,
  IF_FGE,
  IF_FLE,
  IF_FL,

  /* Operators for IfFalse */

  IF_FALSE_UNARY,

  /* relational operators */
  IF_FALSE_EQUALS,
  IF_FALSE_NOT_EQUALS,
  IF_FALSE_GREATER,
  IF_FALSE_GREATER_EQUALS,
  IF_FALSE_LESS,
  IF_FALSE_LESS_EQUALS,

  /* float relational operators */
  IF_FALSE_FE,
  IF_FALSE_FNE,
  IF_FALSE_FG,
  IF_FALSE_FGE,
  IF_FALSE_FLE,
  IF_FALSE_FL,

  /* boolean operators */
  NOT,
  AND,

  /* float relational operators */
  FE,
  FNE,
  FG,
  FGE,
  FLE,
  FL,

  MINUS, // result = -arg1
  FMINUS, // result = -arg1

  I2F, // result = (float) arg1
  F2I, // result = (int) arg1

  DOT, // result = (arg1)+arg2
  FDOT, // result = (arg1)+arg2
  PDOT, // result = address of arg1 + arg2

  DOT_ASSIGN, // result+arg1=arg2
  DOT_FASSIGN, // result+arg1=arg2
  DOT_PASSIGN, // result+arg1=arg2

  GOTO, // jump to a basic block (label in arg1)

  RETURN, // return from a function

  NOP, // for optimization purpose

  PARAM, // for parameter passing
  PPARAM, // for parameter passing by address

  CALL, // call functions

  LABEL // label in arg1
};

mtac::Operator toOperator(ast::Operator op);
mtac::Operator toFloatOperator(ast::Operator op);

mtac::Operator toRelationalOperator(ast::Operator op);
mtac::Operator toFloatRelationalOperator(ast::Operator op);

{'fraction_non_alphanumeric': 0.15904532691536302, 'fraction_numerical': 0.011231448054552748, 'mean_word_length': 2.531869688385269, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1042391', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1719, 'n_words': 398}