An LHS is a wrapper for an variable, field, or property. It ordinarily holds the "left hand side" of an assignment and may be either resolved to a value or assigned a value. There is one special case here termed METHOD_EVAL where the LHS is used in an intermediate evaluation of a chain
| 43 | <p> |
| 44 | */ |
| 45 | class LHS implements ParserConstants, java.io.Serializable |
| 46 | { |
| 47 | NameSpace nameSpace; |
| 48 | /** The assignment should be to a local variable */ |
| 49 | boolean localVar; |
| 50 | |
| 51 | /** |
| 52 | Identifiers for the various types of LHS. |
| 53 | */ |
| 54 | static final int |
| 55 | VARIABLE = 0, |
| 56 | FIELD = 1, |
| 57 | PROPERTY = 2, |
| 58 | INDEX = 3, |
| 59 | METHOD_EVAL = 4; |
| 60 | |
| 61 | int type; |
| 62 | |
| 63 | String varName; |
| 64 | String propName; |
| 65 | Field field; |
| 66 | Object object; |
| 67 | int index; |
| 68 | |
| 69 | /** |
| 70 | Variable LHS constructor. |
| 71 | */ |
| 72 | LHS( NameSpace nameSpace, String varName ) |
| 73 | { |
| 74 | throw new Error("namespace lhs"); |
| 75 | /* |
| 76 | type = VARIABLE; |
| 77 | this.varName = varName; |
| 78 | this.nameSpace = nameSpace; |
| 79 | */ |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | @param localVar if true the variable is set directly in the This |
| 84 | reference's local scope. If false recursion to look for the variable |
| 85 | definition in parent's scope is allowed. (e.g. the default case for |
| 86 | undefined vars going to global). |
| 87 | */ |
| 88 | LHS( NameSpace nameSpace, String varName, boolean localVar ) |
| 89 | { |
| 90 | type = VARIABLE; |
| 91 | this.localVar = localVar; |
| 92 | this.varName = varName; |
| 93 | this.nameSpace = nameSpace; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | Static field LHS Constructor. |
| 98 | This simply calls Object field constructor with null object. |
| 99 | */ |
| 100 | LHS( Field field ) |
| 101 | { |
| 102 | type = FIELD; |
nothing calls this directly
no outgoing calls
no test coverage detected