Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

%initial-action

If you need to initialize something when your parser starts up, you can use %initial-action { some-code } to tell bison to copy some-code near the beginning of yyparse. The place where the code is copied comes after the standard initialization code, so you cannot usefully put variable declarations in the code. (They’ll be accepted, but they won’t be accessible in your actions.) If you need to define your own parse-time variables, you have to either use static globals or pass them as arguments via %parse-param.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint