-
Notifications
You must be signed in to change notification settings - Fork 1
/
java.py
30 lines (24 loc) · 1.48 KB
/
java.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Sub class modeling the Java language, inheritance from Language.
__author__ = "João Correia"
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "João Correia"
__email__ = "jcorreia@inf.puc-rio.inf.br"
__status__ = "Production"
"""
from src.language.language import Language
class Java(Language):
__CODE_FILE_EXTENSION = ['java']
"""Default valid Java file extensions"""
__CODE_ELEMENTS_TO_COLLECT = ['if_statement', 'do_statement', 'for_statement', 'enhanced_for_statement', 'while_statement',
'binary_expression', 'ternary_expression', 'assert_statement', 'switch_expression', 'switch_block_statement_group',
'lambda_expression', 'try_statement', 'catch_clause', 'method_declaration', 'class_declaration', 'interface_declaration',
'enum_declaration']
"""Default Java's code elements that should be collected."""
def __init__(self, code_element_to_collect=__CODE_ELEMENTS_TO_COLLECT, code_file_extension=__CODE_FILE_EXTENSION):
"""
Construct a new Java object, setting the Java's default values for the super class attributes.
:param code_element_to_collect: List of language's code elements (see the tree sitter documentation), that should have its changes collected. Elements out this list will be ignored.
:param code_file_extension: List of valid language file extensions. Files with extension out this list will be ignored.
"""
super().__init__(code_element_to_collect, code_file_extension)