Menu

#836 various attributes not parsed

devel
open
nobody
4
2011-03-21
2011-02-24
No

Icarus does not allow (i.e. will not compile) code with attributes on procedural statements, but they are allowed in the standard.

Discussion

  • Jared Casper

    Jared Casper - 2011-02-24
    • priority: 5 --> 4
     
  • Cary R.

    Cary R. - 2011-02-25
    • assigned_to: nobody --> caryr
     
  • Cary R.

    Cary R. - 2011-02-25

    I have started looking at this. It would be nice to know exactly which statements are causing you problems. So far I have added a bunch of module item attributes, but the attributes handling that already exists for @ needs to be reworked in conjunction with the statements to avoid shift/reduce conflicts in bison.

     
  • Jared Casper

    Jared Casper - 2011-02-25

    I came across this bug because of an attribute on the case statement but have long since patched that file. I just filed this as informative to help improve things. :) (i.e. none are causing me problems now).

    I also took a quick look (I was going to just submit a patch for this and the multi-attribute thing and had some of it working, but didn't have time to finish it up). I believe all of the rules for "statement" in parse.y should allow an attribute, including the null statement. I was therefore thinking of trying to just add a recursive rule to statement or statement_or_null that added "attribute_instance statement" to be a statement. Where attribute_instance is similar to attribute_list_opt but without the null option. This could also fix the multiple attribute list bug as well I think. The right recursion wouldn't be ideal, but I don't see it causing stack problems.

    I got far enough to notice the attribute handling in the @ rules but not far enough to figure out how to rework them.

    The relevant section of the grammar is A.6.4.

     
  • Cary R.

    Cary R. - 2011-02-25

    It's a bit more complicated than you think. There are some shift/reduce issues related to multiple optional items that both can have an attribute. When an attribute is found the parser doesn't know who should get it. I need some time when I can think on this clearly, because the solutions for these kind of problems are tricky and are best not tackled late at night.

     
  • Cary R.

    Cary R. - 2011-03-09

    I'm giving this up for now since I need to stay focused on either quick bug fixes or the vlog95 converter. I have a patch that adds attribute support for a few more statements and I can pass it on to anyone who is interested in looking at this. It has had no testing. I'll likely come back to this once the vlog95 converter is finished.

     
  • Cary R.

    Cary R. - 2011-03-09
    • assigned_to: caryr --> nobody
     
  • Jared Casper

    Jared Casper - 2011-03-21

    Attributes attached a generate region (i.e. with an explicit generate keyword), while not explicitly allowed in 1364-2005 or 1800-200{5,9}, are allowed in 1364-2001, so should also be allowed in Icarus, at least for -g2001.

     
  • Jared Casper

    Jared Casper - 2011-03-21
    • summary: procedural statement attributes not parsed --> various attributes not parsed
     

Log in to post a comment.