WIP: Add enum support
This commit is contained in:
@@ -18,19 +18,19 @@ public class Helper {
|
||||
|
||||
public static Map<String, FunctionInformation> getFuncs(ParseTree tree) {
|
||||
var functionDefinitions = new HashMap<String, FunctionInformation>();
|
||||
new GetFunctions(functionDefinitions).visit(tree);
|
||||
new GetDefinitions(functionDefinitions, new HashMap<>(), new HashMap<>()).visit(tree);
|
||||
return functionDefinitions;
|
||||
}
|
||||
|
||||
public static Set<String> getStructNames(ParseTree tree) {
|
||||
var structNames = new HashSet<String>();
|
||||
new GetStructNames(structNames).visit(tree);
|
||||
return structNames;
|
||||
}
|
||||
|
||||
public static Map<String, StructDefinition> getStructs(ParseTree tree) {
|
||||
var structs = new HashMap<String, StructDefinition>();
|
||||
new GetStructs(getStructNames(tree), structs).visit(tree);
|
||||
new GetDefinitions(new HashMap<>(), structs, new HashMap<>()).visit(tree);
|
||||
return structs;
|
||||
}
|
||||
|
||||
public static Map<String, EnumDefinition> getEnums(ParseTree tree) {
|
||||
var enums = new HashMap<String, EnumDefinition>();
|
||||
new GetDefinitions(new HashMap<>(), new HashMap<>(), enums).visit(tree);
|
||||
return enums;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user