Hello Andrew,

the following (obviously syntactically broken) model does not lead to correct syntax error handling:

Reading model section from error.mod...
Assertion failed: avl_get_node_type(node) == A_INDEX
Error detected in file glpmpl01.c at line 1890

set P := {0};
param p{p in P};
end;

In functions

   * parameter_statement
   * set_statement
   * variable_statement
   * constraint_statement
   * objective_statement

please, change the sequence of commands to first add the parameter name to the symbolic table and then parse the indexing expression.

      /* include the parameter name in the symbolic names table */
      {  AVLNODE *node;
         node = avl_insert_node(mpl->tree, par->name);
         avl_set_node_type(node, A_PARAMETER);
         avl_set_node_link(node, (void *)par);
      }
      /* parse optional indexing expression */
      if (mpl->token == T_LBRACE)
      {  par->domain = indexing_expression(mpl);
         par->dim = domain_arity(mpl, par->domain);
      }

This results in the following error output for above model:

Reading model section from /home/zfsdt/temp/error.mod...
/tmp/error.mod:2: syntax error in literal set
Context:                              set P := { 0 } ; param p { p in

Best regards

Xypron

_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to