1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 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// Autogenerated file -- DO NOT EDIT! 17// NOLINTBEGIN(readability-identifier-naming) 18 19% Es2pandaLibApi::ast_nodes&.each do |ast_node| 20% if ast_node != "AstNode" && ast_node != "TypeNode" 21 bool (*Is<%= ast_node %>)(es2panda_AstNode *ast); 22% end 23% end 24 25% Es2pandaLibApi::scopes&.each do |scope| 26% if scope != "Scope" 27 bool (*ScopeIs<%= scope %>)(es2panda_Scope *scope); 28% end 29% end 30 31% Es2pandaLibApi::ast_types&.each do |type| 32% if type != "Type" 33 bool (*TypeIs<%= type %>)(es2panda_Type *type); 34% end 35% end 36 37% Es2pandaLibApi::ast_variables&.each do |variable| 38% if variable[1] != "Variable" 39 bool (*VariableIs<%= variable[1] %>)(es2panda_Variable *variable); 40% end 41% end 42 43 char const *(*AstNodeName)(es2panda_AstNode *ast); 44 45% Es2pandaLibApi::classes&.each do |namespaceName, namespaceClasses| 46% namespaceClasses&.each do |className, classData| 47% classData.class_constructors&.each_with_index do |constructor, index| 48 <%= classData.constructor_type().lib_type_to_str() %>(*Create<%= className + constructor["overload"] %>)(es2panda_Context *context<%= 49 constructor["args"]&.map { |arg| if arg.lib_args_to_str.strip() != "" 50 then ", " + arg.lib_args_to_str end}&.join("") %>); 51 52% if classData.updater_allowed() 53 <%= classData.constructor_type().lib_type_to_str() %>(*Update<%= className + constructor["overload"] %>)(es2panda_Context *context, es2panda_AstNode *original<%= 54 constructor["args"]&.map { |arg| if arg.lib_args_to_str.strip() != "" 55 then ", " + arg.lib_args_to_str end}&.join("") %>); 56% end # Updater end 57% end 58 59% classData.class_methods&.each_with_index do |method_info, index| 60 <%= method_info["return_type"].lib_type_to_str %>(*<%= 61 className + method_info["overload_name"] %>)( 62 es2panda_Context *context<%= if classData.call_cast["call_var_str"] 63then ", " + classData.call_cast["call_var_str"] end %><%= 64 method_info["args"]&.map { |arg| if arg.lib_args_to_str.strip() != "" && arg.lib_args_to_str.strip() != "const" 65 then ", " + arg.lib_args_to_str end}&.join("") 66 %><%= method_info["return_arg_to_str"] %>); 67 68% end 69 70% end 71% end 72 73% Es2pandaLibApi::structs&.each do |structName, structData| 74% structData.struct_getters&.each_with_index do |method_info, index| 75 <%= method_info["return_type"].lib_type_to_str %>(*<%= structName + method_info["name"] 76 %>)(es2panda_Context *context<%= if structData.call_cast["call_var_str"] 77 then structData.call_cast["call_var_str"] end %>/*return_args:*/<%= method_info["return_arg_to_str"] %>); 78% end # getters end 79 80% end # structs end 81 82// NOLINTEND(readability-identifier-naming) 83