-
Notifications
You must be signed in to change notification settings - Fork 1
C, Java Language
dyhe83 edited this page Jun 5, 2019
·
3 revisions
if C
, Java
function doesn't contain while loop
and for loop
match the following pattern.
number = [0-9]+
variable = [_a-zA-Z]+
op = [+ | - | * | / | << | >>]
cp = [= | > | >= | < | <=]
// O(Loop Iteration * LoopBody)
for(LoopCounter = a1; LoopCounter < an; LoopCounter = LoopCounter op d) {
Statement;
}
where a1
, an
, d
can be:
a1 -> Int
an -> Int
d -> Int
Int -> (Int) | number | variable | Expr
Expr -> Int op Int
// O(Condition + Max(True Statement, False Statement))
if (Condition) {
Statement;
} else {
Statement;
}
where Condition
can be:
Condition -> (Comparator) | Comparator | FunctionCall
Comparator -> Int cp Int