File:Some types of control flow graphs.svg

頁面內容唔支援其他語言。
出自維基百科,自由嘅百科全書

原本檔案(SVG檔案,表面大細: 270 × 491 像素,檔案大細:9 KB)

摘要

描述
English: Some examples of control flow graphs (CFG):

(a) the CFG of a if-then-else (b) a while loop (c) a natural loop with two exits, e.g. while with an if...break in the middle; non-structured by reducible (d) an irreducible CFG: a loop with to entry points, e.g. goto into a while loop

Source code in DOT, svg generated with graphviz:

digraph CFG_examples {
  node [shape=circle width=0.3 height=0.3 label="" fixedsize=true]
  edge [arrowsize=0.5]
  if -> { then; else } -> fi
  while -> body [weight=3]
  body -> while:w
  while -> end
  body -> end [style="invis" weight=3]
  fi -> exit1 [style="invis"]
  exit1 -> exit2
  exit2 -> body2 [weight=4]
  body2 -> exit1:w
  exit1 -> out:e
  exit2 -> out
  body2 -> out [style="invis" weight=4]
  end -> top [style="invis"]
  top -> entry1 [weight=2]
  entry1 -> out2
  top -> entry2:w 
  entry1 -> entry2 [weight=4]
  entry2 -> entry1:w
  entry2 -> out2 [style="invis" weight=4]
  if [xlabel = "(a)"]
  while [xlabel = "(b)"]
  exit1 [xlabel = "(c)"]
  top [xlabel = "(d)"]
} /*end digraph*/
日期
來源 自己作品
作者 JMP EAX

協議

我,呢份作品嘅作者,決定用以下許可發佈呢件作品:
w:en:Creative Commons
署名 相同方式分享
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
你可以:
  • 去分享 – 複製、發佈同傳播呢個作品
  • 再改 – 創作演繹作品
要遵照下面嘅條件:
  • 署名 – 你一定要畀合適嘅表彰、畀返指向呢個授權條款嘅連結,同埋寫明有無改過嚟。你可以用任何合理方式去做,但唔可以用任何方式暗示授權人認可咗你或者你嘅使用方式。
  • 相同方式分享 – 如果你用任何方式改過呢個作品,你必須要用返原本或者相似嘅條款發佈。

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

圖中顯示嘅係

27 7 2014

檔案歷史

撳個日期/時間去睇響嗰個時間出現過嘅檔案。

日期/時間縮圖尺寸用戶註解
現時2014年7月27號 (日) 06:57響2014年7月27號 (日) 06:57嘅縮圖版本270 × 491(9 KB)JMP EAXUser created page with UploadWizard

以下嘅2版用到呢個檔:

全域檔案使用情況

下面嘅維基都用緊呢個檔案:

Metadata