Definition: When talking about the scope of variables, you'll often hear that local variables are scoped lexically. This means the scope is defined by the structure of the program itself. One way to tell if two variables are in the same lexical scope is to examine their indentation level. If they're in the same method and at the same indentation level, they're at the same lexical scope. Though this only works if you maintain good indentation practices.
Another way to think about lexical scope is to imagine the program as a nested tree structure (as it is after the parser is finished with it). If two variables are at the same node in this structure, they are at the same lexical scope.