Beispiel #1
0
fnc_unconditional_branching::fnc_unconditional_branching(interpreter_t *interpreter, ub_operation op)
{
  _op = op;

  switch (op)
  {
  case ub_goto:  
    set_namedesc("goto", "branches to an already defined label");
    set_minmaxargs(1, 1);
    break;
  case ub_gotoline:  
    set_namedesc("gotoline", "branches to source code line");
    set_minmaxargs(1, 1);
    break;
  case ub_end:
    set_namedesc("end", "Ends the execution of the program");
    set_minmaxargs(0, 0);
    break;
  case ub_label:
    set_namedesc(s_cmd_label, "Creates a label at the given line");
    set_minmaxargs(1, 2);
    break;
  }

  set_interpreter(interpreter);
}
Beispiel #2
0
fnc_binary_comparison::fnc_binary_comparison(interpreter_t *interpreter, binary_comparison bc)
{
  // save comparison operator
  _op = bc;

  switch (bc)
  {
  case bc_gt:
    set_namedesc(s_cmd_if_gt, "greater than: branches to an already defined label");
    break;
  case bc_gte:
    set_namedesc(s_cmd_if_gte, "greater than or equal: branches to an already defined label");
    break;
  case bc_lte:
    set_namedesc(s_cmd_if_lte, "less than or equal: branches to an already defined label");
    break;
  case bc_lt:
    set_namedesc(s_cmd_if_lt, "less than: branches to an already defined label");
    break;
  case bc_eq:
    set_namedesc(s_cmd_if_eq, "inequality: branches to an already defined label");
    break;
  case bc_neq:
    set_namedesc(s_cmd_if_neq, "equality: branches to an already defined label");
    break;
  }

  set_minmaxargs(3, 0);
  set_interpreter(interpreter);
}
Beispiel #3
0
fnc_binary_arith::fnc_binary_arith(interpreter_t *interpreter, binary_arith op)
{
  // save the operation code
  _op = op;

  set_interpreter(interpreter);
  switch (op)
  {
  case ba_sub:
    set_namedesc(s_cmd_sub, s_str_arith_help);
    break;
  case ba_mul:
    set_namedesc(s_cmd_mul, s_str_arith_help);
    break;
  case ba_div:
    set_namedesc(s_cmd_div, s_str_arith_help);
    break;
  case ba_add:
    set_namedesc(s_cmd_add, s_str_arith_help);
    break;
  case ba_expr:
    set_namedesc(s_cmd_expr, s_str_expr_help);
    set_minmaxargs(2, 0);
    return;
  }
  set_minmaxargs(2, 2);
}
Beispiel #4
0
bash_ast::walker_pointer bash_ast::create_walker(interpreter& walker,
                                                 antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct>& nodes)
{
    set_interpreter(&walker);
    walker.push_current_ast(this);

    auto deleter = [&](plibbashWalker tree_parser)
    {
      tree_parser->free(tree_parser);
      walker.pop_current_ast();
    };

    return walker_pointer(libbashWalkerNew(nodes.get()), deleter);
}
Beispiel #5
0
//***********************************************
Options::Options( QWidget *parent, const char *name)
    : Q3TabDialog( parent, name)
{

  setCaption("Settings");

  set_general();
  set_directories();
  set_logedit();
  set_interpreter();

  connect( this, SIGNAL( applyButtonPressed() ), SLOT( apply() ) );
  setDefaultButton();
  connect( this, SIGNAL( defaultButtonPressed() ), SLOT( defaults() ) );
  setCancelButton();
  set_settings();

}
Beispiel #6
0
fnc_com::fnc_com(interpreter_t *interpreter, op_e op)
{
  _op = op;
  switch (_op)
  {
  case sc_create:
    set_namedesc(s_cmd_create, "<- $com_obj $prog_id [clsctx]");
    set_minmaxargs(2, 3);
    break;
  case sc_free:
    set_namedesc(s_cmd_free, "<- $com_obj");
    set_minmaxargs(1, 1);
    break;
  case sc_invoke:
    set_namedesc(s_cmd_invoke, "<- $com_obj MethodName");
    set_minmaxargs(2, 2);
    break;
  }
  set_interpreter(interpreter);
}