Ruby flow charts
Help » Languages » Ruby
Visustin generates flow charts from Ruby code. Ruby support is current as of Ruby 1.8.7 and 1.9.3. Earlier versions should also be compatible.
Visustin supports standardized Ruby, which intends to be compatible with several alternative Ruby implementations. Support largely conforms to IPA Ruby final draft of 2010, which was accepted as Ruby standards JIS X 3017 and ISO/IEC 30170:2012.
Supported statements
Visustin supports the following Ruby statements.
Statement type | Statement |
Conditional statements | if..elsif..else, unless |
Multiway decision | case..when..else |
Iteration | for, xxx do..end |
Looping | while, until, loop |
Loop exit and continue | break, next, redo |
Return | return |
End program | exit, exit!, abort |
Error handling | begin..rescue..else..ensure, retry |
Error throwing | fail, raise, throw |
Special statements | exec, yield |
Statement modifiers | if, unless, while, until, rescue |
Methods | def |
Modules, classes | module, class |
Comments | #Comment, =begin..=end |
Most other statements are handled as regular statements. Notes:
- Special symbols, rather than Visustin standard loop symbols, are used for loops in the form "xxx do..end".
- The exit statement raises an exception (SystemExit) even when this is a normal program exit. This is how it works in Ruby.
Limitations
eRuby and RHTML are not supported. Write us if you require support.
The following syntax is unsupported or only limited support is provided. The chart may display a normal statement, not a branch or a jump.
- Method calls are not linked to the call target.
- Flowcharting is done at the statement level. Expressions such as and, or, && and || are not split to "sub-statements".
- Most structures (such as if, case, while) are supported only as statement versions, that is, they must start the statement. Expression versions (structure appears in the middle of another statement) are not supported.
- retry outside rescue is not supported. Syntax outdated since Ruby 1.9.
- Multiline %-style strings such as %{…} are not supported. Single-line %-style strings are supported. Others such as %q{…} and %Q{…} are supported as both single-line and multiline strings.
- Multiline regular expressions starting with / are not supported.
- Parser glitch may appear where 2 slashes appear on the same line /…/.
- Parser glitch may appear between the percent sign % and end-of-line.
- Parser glitch may appear after question mark operator such as ?[ .
- << here documents are not supported. If a << here document causes problems with the flow chart please remove it or enclose in =begin ... =end.
- callcc {|cont| ...} blocks: cont.call is not supported.
- rescue..else..ensure is supported in begin..end and def..end, but not directly in a class or module statement.
©Aivosto Oy – Visustin Help