PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, June 29, 2022

[FIXED] How can we add comments in flex/bison source code?

 June 29, 2022     bison, comments, flex-lexer     No comments   

Issue

Like in other languages, we can add comments using either //, /---/, #, % etc. So similarly if I want to add comments in flex/bison source code for better understanding of code. Can I do the same? If yes then how? Whenever I tried to search about same on the internet, answers usually come for defining comment in flex/bison and not about how to add comments in flex/bison source code.


Solution

(F)lex: Indent the comment, and use a comment style appropriate to the generated code. (/*...*/ is recommended.) You must indent every line of the comment. Indented text is copied verbatim to the generated file, but a comment is a comment.

Yacc/Bison: Use /* ... */ anywhere in the grammar. In bison, but possibly not other yacc derivatives, you can also use // comments.



Answered By - rici
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing