public class DefiniteAssignmentAnalysis extends Object
Responsible for checking that all variables are defined before they are used. The algorithm for checking this involves a depth-first search through the control-flow graph of the method. Throughout this, a list of the defined variables is maintained. For example:
function f() -> int:
int z
return z + 1
In the above example, variable z is used in the return statement before it has been defined any value. This is considered a syntax error in whiley.
| Constructor and Description |
|---|
DefiniteAssignmentAnalysis(WhileyFile file) |
public DefiniteAssignmentAnalysis(WhileyFile file)
Copyright © 2017. All rights reserved.