Menu

#9 Linebreak in expressions

open
nobody
None
5
2010-09-08
2010-09-08
Marv
No

It would be nice if you could break lines in expressions.
Long generated expressions are hard to read now.

Discussion

  • Christopher Pohl

    any suggestions on where to add linebreaks? Must be something very simple, otherwise I'd suggest to put this functionality into a beautifier...
    out of pure curiosity: what are u using vMAGIC for?

     
  • Marv

    Marv - 2010-09-09

    With an old version of vmagic i had an expression LineBreak extending Primary with nested Expression, calling writer.newLine() after the expression. It worked, but since a linebreak is no VHDL-expression it was just a hack.

    You could add a method like breakLineAfterThis() to Expression and call a method with writer.newLine() in the Visitor if breakLine is set for the Expression. Its simple, but maybe you don't like it in the structure of your API. ;)

    I'm connecting IP-Cores with the Wishbone-Bus. You say like "connect 10 instances of this cpu with 20 instances of this memory" and my program generates the bus and connects the cores. In this example my bus arbiter would have huge expressions.

     
  • Ralf Fuest

    Ralf Fuest - 2010-09-09

    I think this is a useful feature. I'll add it when I finish the new output system.