1009 } 1010 1011 /** 1012 * Checks if this function is split into several smaller fragments. 1013 * 1014 * @return true if this function is split into several smaller fragments. 1015 */ 1016 public boolean isSplit() { 1017 return getFlag(IS_SPLIT); 1018 } 1019 1020 /** 1021 * Get the parameters to this function 1022 * @return a list of IdentNodes which represent the function parameters, in order 1023 */ 1024 public List<IdentNode> getParameters() { 1025 return Collections.unmodifiableList(parameters); 1026 } 1027 1028 /** 1029 * Returns the identifier for a named parameter at the specified position in this function's parameter list. 1030 * @param index the parameter's position. 1031 * @return the identifier for the requested named parameter. 1032 * @throws IndexOutOfBoundsException if the index is invalid. 1033 */ 1034 public IdentNode getParameter(final int index) { 1035 return parameters.get(index); 1036 } 1037 1038 /** 1039 * Reset the compile unit used to compile this function 1040 * @see Compiler 1041 * @param lc lexical context 1042 * @param parameters the compile unit 1043 * @return function node or a new one if state was changed 1044 */ 1045 public FunctionNode setParameters(final LexicalContext lc, final List<IdentNode> parameters) { 1046 if (this.parameters == parameters) { 1047 return this; 1048 } | 1009 } 1010 1011 /** 1012 * Checks if this function is split into several smaller fragments. 1013 * 1014 * @return true if this function is split into several smaller fragments. 1015 */ 1016 public boolean isSplit() { 1017 return getFlag(IS_SPLIT); 1018 } 1019 1020 /** 1021 * Get the parameters to this function 1022 * @return a list of IdentNodes which represent the function parameters, in order 1023 */ 1024 public List<IdentNode> getParameters() { 1025 return Collections.unmodifiableList(parameters); 1026 } 1027 1028 /** 1029 * Return the number of parameters to this function 1030 * @return the number of parameters 1031 */ 1032 public int getNumOfParams() { 1033 return parameters.size(); 1034 } 1035 1036 /** 1037 * Returns the identifier for a named parameter at the specified position in this function's parameter list. 1038 * @param index the parameter's position. 1039 * @return the identifier for the requested named parameter. 1040 * @throws IndexOutOfBoundsException if the index is invalid. 1041 */ 1042 public IdentNode getParameter(final int index) { 1043 return parameters.get(index); 1044 } 1045 1046 /** 1047 * Reset the compile unit used to compile this function 1048 * @see Compiler 1049 * @param lc lexical context 1050 * @param parameters the compile unit 1051 * @return function node or a new one if state was changed 1052 */ 1053 public FunctionNode setParameters(final LexicalContext lc, final List<IdentNode> parameters) { 1054 if (this.parameters == parameters) { 1055 return this; 1056 } |