A helper class that allows to combine several variable declarations together. It can be thought of as layering several scopes over one another. It will delegate the
getVariable(String)methods to other variable declarations. Each variable declaration combined is checked in sequential order. No checks for conflicts are done. Thus shadowing is possible.
- $Revision: 1000 $
- Benjamin Weber ( benweber at student dot ethz dot ch )
- See Also:
(VariableDeclarations... declarations)Constructs a
VariableDeclarationsCompositorcontaining the provided declarations The order of the declarations will determine the order of checking the declarations for variables.
declarations- the declarations being combined
hasVariablepublic boolean hasVariable
(String name)Whether the variable is contained in one of the combined declarations.
getVariableTries to fetch a variable from one of the combined declarations. The same invariant of
VariableDeclarationsapplies here too.