1 /* 2 * Copyright (c) 2025 Shenzhen Kaihong Digital. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package grammar; 17 18 import java.util.List; 19 import java.util.concurrent.CopyOnWriteArrayList; 20 21 /** 22 * <h3>类名:该类用于xxx</h3> 23 * description parse object 24 * 25 * @author Administrator 26 * date 2025-02-28 27 * @version 1.0 28 * @since 2025-02-28 29 */ 30 public class ParseObj extends GBaseObject { 31 private List<EnumObj> enumList; 32 private List<UnionObj> unionList; 33 private List<StructObj> structList; 34 private List<ClassObj> classList; 35 private List<FuncObj> funcList; 36 private List<TypeObj> typeList; 37 private List<InterfaceObject> interfaceList; 38 private List<ParamObj> varList; 39 40 /** 41 * 构造函数 42 */ ParseObj()43 public ParseObj() { 44 enumList = new CopyOnWriteArrayList<>(); 45 unionList = new CopyOnWriteArrayList<>(); 46 structList = new CopyOnWriteArrayList<>(); 47 classList = new CopyOnWriteArrayList<>(); 48 funcList = new CopyOnWriteArrayList<>(); 49 typeList = new CopyOnWriteArrayList<>(); 50 interfaceList = new CopyOnWriteArrayList<>(); 51 varList = new CopyOnWriteArrayList<>(); 52 } 53 54 /** 55 * 设置解析enum对象 56 * 57 * @param res enum对象 58 */ setEnumList(List<EnumObj> res)59 public void setEnumList(List<EnumObj> res) { 60 enumList = res; 61 } 62 63 /** 64 * 设置解析union对象 65 * 66 * @param res union对象 67 */ setUnionList(List<UnionObj> res)68 public void setUnionList(List<UnionObj> res) { 69 unionList = res; 70 } 71 72 /** 73 * 设置解析struct对象 74 * 75 * @param res struct对象 76 */ setStructList(List<StructObj> res)77 public void setStructList(List<StructObj> res) { 78 structList = res; 79 } 80 81 /** 82 * 设置解析对象 83 * 84 * @param res class对象 85 */ setClassList(List<ClassObj> res)86 public void setClassList(List<ClassObj> res) { 87 classList = res; 88 } 89 90 /** 91 * 设置解析func对象 92 * 93 * @param res func对象 94 */ setFuncList(List<FuncObj> res)95 public void setFuncList(List<FuncObj> res) { 96 funcList = res; 97 } 98 99 /** 100 * 设置解析type对象 101 * 102 * @param res type对象 103 */ setTypeList(List<TypeObj> res)104 public void setTypeList(List<TypeObj> res) { 105 typeList = res; 106 } 107 108 /** 109 * 设置var对象 110 * 111 * @param varList 变量对象 112 */ setVarList(List<ParamObj> varList)113 public void setVarList(List<ParamObj> varList) { 114 this.varList = varList; 115 } 116 117 /** 118 * 获取解析enum对象 119 * 120 * @return 解析后enum列表 121 */ getEnumList()122 public List<EnumObj> getEnumList() { 123 return enumList; 124 } 125 126 /** 127 * 获取解析union对象 128 * 129 * @return 解析后union列表 130 */ getUnionList()131 public List<UnionObj> getUnionList() { 132 return unionList; 133 } 134 135 /** 136 * 获取解析struct对象 137 * 138 * @return 解析后struct列表 139 */ getStructList()140 public List<StructObj> getStructList() { 141 return structList; 142 } 143 144 /** 145 * 获取解析对象 146 * 147 * @return 解析后class列表 148 */ getClassList()149 public List<ClassObj> getClassList() { 150 return classList; 151 } 152 153 /** 154 * 获取解析func对象 155 * 156 * @return 解析后func列表 157 */ getFuncList()158 public List<FuncObj> getFuncList() { 159 return funcList; 160 } 161 162 /** 163 * 获取解析type对象 164 * 165 * @return 解析后type列表 166 */ getTypeList()167 public List<TypeObj> getTypeList() { 168 return typeList; 169 } 170 171 /** 172 * 获取变量列表 173 * 174 * @return 变量列表 175 */ getVarList()176 public List<ParamObj> getVarList() { 177 return varList; 178 } 179 180 /** 181 * 获取interface对象 182 * 183 * @return interface对象 184 */ getInterfaceList()185 public List<InterfaceObject> getInterfaceList() { 186 return interfaceList; 187 } 188 189 /** 190 * 设置interface对象 191 * 192 * @param interfaceList interface 对象 193 */ setInterfaceList(List<InterfaceObject> interfaceList)194 public void setInterfaceList(List<InterfaceObject> interfaceList) { 195 this.interfaceList = interfaceList; 196 } 197 } 198