Package org.sonarsource.slang.api
Interface IfTree
- All Superinterfaces:
HasTextRange,Tree
- All Known Implementing Classes:
IfTreeImpl
The interface used to define conditional expressions.
In order to be compatible with most of the languages, the 'IfTree' is not defined
as a statement and should be considered as an expression.
A 'IfTree' always has:
- a keyword ('if', '?', 'unless', ...)
- a condition
- a 'then' branch
Additionally, it's possible to also have:
- an 'else' keyword
- an 'else' branch (which does not necessarily requires a 'else' keyword)
Known mapping from languages conditional expressions to IfTree:
- Apex: if, ternary (a?b:c)
- Ruby: if, ternary (a?b:c), unless (equivalent to 'if not')
- Scala: if
-
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from interface org.sonarsource.slang.api.Tree
children, descendants, metaData, textRange