Ejemplo n.º 1
0
/* Parse the input string statement * */
void
parse_inputstring(void)
{
  TextNode *input_node = curr_node;
  char *name;
  InputItem *item;
  int size;
  char *default_value;

  gStringValueOk = 0;

  /* first get the name */
  input_node->type = token.type;
  get_expected_token(openaxiom_Lbrace_token);
  name = get_input_string();
  input_node->data.text = alloc_string(name);
  /* now get the width */
  get_expected_token(openaxiom_Lbrace_token);
  get_expected_token(openaxiom_Word_token);
  get_expected_token(openaxiom_Rbrace_token);
  size = atoi(token.id);
  if (size < 0) {
    fprintf(stderr, "Illegal size in Input string\n");
    longjmp(jmpbuf, 1);
  }

  /* get the default value */
  get_expected_token(openaxiom_Lbrace_token);
  default_value = get_input_string();

  /** now I need to malloc space for the input stuff **/
  item = (InputItem *) halloc(sizeof(InputItem), "InputItem");

  /* Now store all the string info */
  item->name = (char *)
    halloc((strlen(input_node->data.text) + 1) * (sizeof(char)),"parse_inputstring");
  strcpy(item->name, input_node->data.text);
  item->size = size;
  item->entered = 0;
  item->next = NULL;
  initialize_default(item, default_value);

  /** Now that I have all the structures made, lets make the window, and
    add the item to the list                                 ****/

  input_node->link = make_input_window(item);
  if (!make_input_file)
    item->win = input_node->link->win;      /* TTT */
  insert_item(item);
  gStringValueOk = 1;
  curr_node = input_node;
  return ;
}
http_script_engine::http_script_engine(QObject *parent)
	: QScriptEngine(parent)
	, _code_tool(new code_tool(this))
{
	initialize_default();
}