class KotlinParser
- KotlinParser
- Reference
- Object
Defined in:
miniparsers/kotlin.crConstructors
-
.new(path : String, tokens : Array(Token))
Initialize the parser with the path and tokens
Macro Summary
-
reset_fields
Macro to reset field variables
-
skip_constructor
Macro to skip constructor keyword in tokens
-
skip_modifier_list
Macro to skip modifier list in tokens
-
skip_newline
Macro to skip newlines in tokens
-
skip_primary_constructor
Macro to skip primary constructor in tokens
-
skip_type_parameters
Macro to skip type parameters in tokens
Instance Method Summary
-
#annotation_start?(annotation_name)
Check if a token value indicates the start of an annotation
- #classes : Array(ClassModel)
- #classes=(classes : Array(ClassModel))
- #classes_tokens : Array(Array(Token))
- #classes_tokens=(classes_tokens : Array(Array(Token)))
-
#find_annotation_end(start_index)
Find the end of an annotation
-
#find_annotation_start(end_index)
Find the start of an annotation
-
#find_bracket_partner(param_start_index : Int32)
Find the matching bracket for a given token index
-
#get_class_name(tokens : Array(Token))
Get the class name from a set of tokens
-
#get_package_name(tokens : Array(Token))
Method to extract the package name from the tokens
-
#get_root_source_directory(path : String, package_name : String)
Method to determine the root source directory based on the package name
- #import_statements : Array(String)
- #import_statements=(import_statements : Array(String))
-
#modifier?(token)
Check if a token is a valid modifier
-
#parse
Main parse method to handle import statements and classes
-
#parse_annotations_backwards(backward_index)
Parse annotations backwards from a given index
-
#parse_class_modifiers(class_name_index)
Parse modifiers for a class starting from a given index
-
#parse_class_parameters(class_start_index)
Parse class parameters from the tokens
-
#parse_classes(tokens : Array(Token), index = 0)
Parse class declarations from the tokens
-
#parse_fields_from_class_body(class_start_index, fields : Hash(String, FieldModel), methods : Hash(String, MethodModel))
Parse fields from the class body
-
#parse_formal_parameters(param_start_index : Int32)
Parse the formal parameters of a method or constructor
-
#parse_import_statements(tokens : Array(Token))
Parse import statements from the tokens
-
#parse_methods(class_tokens : Array(Token))
Parse methods from the class tokens
- #path : String
- #path=(path : String)
-
#print_tokens(tokens : Array(Token), id = "default", trace = false)
Print tokens for debugging purposes
- #tokens : Array(Token)
- #tokens=(tokens : Array(Token))
-
#trace
Trace parsed class and method details
Constructor Detail
Initialize the parser with the path and tokens
Macro Detail
Instance Method Detail
Check if a token value indicates the start of an annotation
Find the matching bracket for a given token index
Method to extract the package name from the tokens
Method to determine the root source directory based on the package name
Parse modifiers for a class starting from a given index
Parse class declarations from the tokens
Parse fields from the class body
Parse the formal parameters of a method or constructor
Parse import statements from the tokens
Print tokens for debugging purposes