How do I access data lists created by yyparse ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajmitra
    New Member
    • Aug 2011
    • 1

    How do I access data lists created by yyparse ??

    Hello all,
    In my foo.y description I call yyparse() in main.
    ----------------------------------------
    int main(int argc, char **argv)
    {

    ...
    yyparse();
    ...

    /*Do something with a link list created by yyparse(); */
    /* Then free the list*/

    }
    --------------------------------------------

    As the comments in main show -
    How do I manipulate and then subsequently free a linked list created by yyparse() ???

    Thanks,

    Raj
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Generally, you can't. Everything cretaed by yyparse is destroyed when yyparse completes. You could use global variables but that is poor programming practice.

    yyparse needs arguments.

    Comment

    Working...