• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
39     /**
40      * 构造函数
41      */
ParseObj()42     public ParseObj() {
43         enumList = new CopyOnWriteArrayList<>();
44         unionList = new CopyOnWriteArrayList<>();
45         structList = new CopyOnWriteArrayList<>();
46         classList = new CopyOnWriteArrayList<>();
47         funcList = new CopyOnWriteArrayList<>();
48         typeList = new CopyOnWriteArrayList<>();
49         interfaceList = new CopyOnWriteArrayList<>();
50     }
51 
52     /**
53      * 设置解析enum对象
54      *
55      * @param res enum对象
56      */
setEnumList(List<EnumObj> res)57     public void setEnumList(List<EnumObj> res) {
58         enumList = res;
59     }
60 
61     /**
62      * 设置解析union对象
63      *
64      * @param res union对象
65      */
setUnionList(List<UnionObj> res)66     public void setUnionList(List<UnionObj> res) {
67         unionList = res;
68     }
69 
70     /**
71      * 设置解析struct对象
72      *
73      * @param res struct对象
74      */
setStructList(List<StructObj> res)75     public void setStructList(List<StructObj> res) {
76         structList = res;
77     }
78 
79     /**
80      * 设置解析对象
81      *
82      * @param res class对象
83      */
setClassList(List<ClassObj> res)84     public void setClassList(List<ClassObj> res) {
85         classList = res;
86     }
87 
88     /**
89      * 设置解析func对象
90      *
91      * @param res func对象
92      */
setFuncList(List<FuncObj> res)93     public void setFuncList(List<FuncObj> res) {
94         funcList = res;
95     }
96 
97     /**
98      * 设置解析type对象
99      *
100      * @param res type对象
101      */
setTypeList(List<TypeObj> res)102     public void setTypeList(List<TypeObj> res) {
103         typeList = res;
104     }
105 
106     /**
107      * 获取解析enum对象
108      *
109      * @return 解析后enum列表
110      */
getEnumList()111     public List<EnumObj> getEnumList() {
112         return enumList;
113     }
114 
115     /**
116      * 获取解析union对象
117      *
118      * @return 解析后union列表
119      */
getUnionList()120     public List<UnionObj> getUnionList() {
121         return unionList;
122     }
123 
124     /**
125      * 获取解析struct对象
126      *
127      * @return 解析后struct列表
128      */
getStructList()129     public List<StructObj> getStructList() {
130         return structList;
131     }
132 
133     /**
134      * 获取解析对象
135      *
136      * @return 解析后class列表
137      */
getClassList()138     public List<ClassObj> getClassList() {
139         return classList;
140     }
141 
142     /**
143      * 获取解析func对象
144      *
145      * @return 解析后func列表
146      */
getFuncList()147     public List<FuncObj> getFuncList() {
148         return funcList;
149     }
150 
151     /**
152      * 获取解析type对象
153      *
154      * @return 解析后type列表
155      */
getTypeList()156     public List<TypeObj> getTypeList() {
157         return typeList;
158     }
159 
160     /**
161      * 获取interface对象
162      *
163      * @return interface对象
164      */
getInterfaceList()165     public List<InterfaceObject> getInterfaceList() {
166         return interfaceList;
167     }
168 
169     /**
170      * 设置interface对象
171      *
172      * @param interfaceList interface 对象
173      */
setInterfaceList(List<InterfaceObject> interfaceList)174     public void setInterfaceList(List<InterfaceObject> interfaceList) {
175         this.interfaceList = interfaceList;
176     }
177 }
178