Replies: 8 comments
-
First, I think all this should trigger a "Sorry: not supported" message and error out by default, but I am okay if there is a flag to make this just print the message and omit the properties, etc. This probably should be added to all the "not supported" messages. I have a real problem just silently ignoring language constructs. Especially by default! Yes, this looks correct. You may want to update the comment to refer to the correct section in the latest standard. Are you sure |
Beta Was this translation helpful? Give feedback.
-
Never mind the |
Beta Was this translation helpful? Give feedback.
-
Thanks Cary for the feedback. I agree on the danger of silent digestion of unsupported syntax. Will keep this in mind if I get to add any keywords in near future :-) Now the other part of this seemingly simple "pure" keyword addition.
Given my limited experience with YACC/Bison, I am looking for how to handle this. Any references will help. If you believe it is too much to "teach", kindly ignore, will wait for one of you to implement this "tiny feature". Thanks |
Beta Was this translation helpful? Give feedback.
-
I believe I now have a code that works. Briefly it is below, will submit a PR for your review. pure_virtual_method_decl /* IEEE1800-2012: A.1.9 */
: K_pure K_virtual K_task IDENTIFIER ';'
| K_pure K_virtual K_task IDENTIFIER '(' tf_port_list_opt ')' ';'
| K_pure K_virtual K_function data_type_or_implicit_or_void IDENTIFIER ';'
| K_pure K_virtual K_function data_type_or_implicit_or_void IDENTIFIER '(' tf_port_list_opt ')' ';'
;
|
Beta Was this translation helpful? Give feedback.
-
Taking clue from @caryr on silent parsing, I am considering the following message for pure virtual methods:
Any inputs please? |
Beta Was this translation helpful? Give feedback.
-
Maybe:
When "<some_flag>" is set (say "allow_parse_and_ignore" or maybe more specifically "allow_oop_parse_and_ignore") is given the message is not shown and it is not marked as a parse error. The flag name should be some thing that supports all the stuff you want to allow as parse only until we get it actually implemented. |
Beta Was this translation helpful? Give feedback.
-
I agree with Cary here. If you are going to add parsing support for this, it needs to "sorry" out. |
Beta Was this translation helpful? Give feedback.
-
Opened a related issue: #1061 |
Beta Was this translation helpful? Give feedback.
-
I was looking for "pure virtual function" parse-only support (To get a structured code compiling).
Few sample SV lines that I am targeting:
I see parse.y has:
method_qualifier /* IEEE1800-2005: A.1.8 */ : K_virtual | class_item_qualifier ;
If I extend the above as shown below it seems to work - am I in the right direction?
method_qualifier /* IEEE1800-2005: A.1.8 */ : K_virtual | K_pure K_virtual | class_item_qualifier ;
I do have a follow-up question, will ask once I get this one through.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions