Skip to content
Snippets Groups Projects

Feature/autoformat

Merged Johannes Mey requested to merge feature/autoformat into develop
36 files
+ 404
142
Compare changes
  • Side-by-side
  • Inline
Files
36
+ 29
49
@@ -26,24 +26,6 @@
@@ -26,24 +26,6 @@
]
]
}
}
//attribute_equation ::= EQ java_block
//
//java_block ::= JAVABLOCK
//{
// implements="org.jastadd.tooling.aspect.psi.JastAddAspectJavaExtension"
// extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectJavaImplExtension"
//}
// aspect_body_declarations_eof ::= aspect_body_declaration* EOF
//jastaddAspectFile ::= ( aspect_declaration | comment )*
//
//comment ::= (MULTI_LINE_COMMENT | DOC_COMMENT | SINGLE_LINE_COMMENT)
compilation_unit ::= import_declaration* type_declaration*
compilation_unit ::= import_declaration* type_declaration*
import_declaration ::= IMPORT STATIC? name_name (DOT STAR)? SEMICOLON
import_declaration ::= IMPORT STATIC? name_name (DOT STAR)? SEMICOLON
@@ -119,50 +101,50 @@ aspect_nested_interface_declaration ::= modifiers interface_declaration
@@ -119,50 +101,50 @@ aspect_nested_interface_declaration ::= modifiers interface_declaration
// TODO check if simplification is okay
// TODO check if simplification is okay
aspect_nested_class_declaration ::= modifiers class_declaration
aspect_nested_class_declaration ::= modifiers class_declaration
aspect_method_declaration ::= modifiers type_parameters? aspect_result_type IDENTIFIER DOT method_declarator (THROWS name_list)? (block | SEMICOLON)
aspect_method_declaration ::= modifiers type_parameters? aspect_result_type ast_type_name DOT method_declarator (THROWS name_list)? (block | SEMICOLON)
aspect_refine_method_declaration ::= REFINE [IDENTIFIER] modifiers type_parameters? aspect_result_type IDENTIFIER DOT method_declarator (THROWS name_list)? (block | SEMICOLON)
aspect_refine_method_declaration ::= REFINE [IDENTIFIER] modifiers type_parameters? aspect_result_type IDENTIFIER DOT method_declarator (THROWS name_list)? (block | SEMICOLON)
aspect_constructor_declaration ::= modifiers IDENTIFIER DOT IDENTIFIER formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE
aspect_constructor_declaration ::= modifiers ast_type_name DOT ast_type_name formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE
aspect_refine_constructor_declaration ::= REFINE IDENTIFIER (PUBLIC | PROTECTED | PRIVATE) IDENTIFIER DOT IDENTIFIER formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE
aspect_refine_constructor_declaration ::= REFINE IDENTIFIER (PUBLIC | PROTECTED | PRIVATE) ast_type_name DOT IDENTIFIER formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE
aspect_field_declaration ::= modifiers aspect_type IDENTIFIER DOT variable_declarator (COMMA variable_declarator)* SEMICOLON
aspect_field_declaration ::= modifiers aspect_type ast_type_name DOT variable_declarator (COMMA variable_declarator)* SEMICOLON
aspect_syn_attribute_declaration ::= annotation* SYN NTA? LAZY? FINAL? aspect_type IDENTIFIER DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? ( ASSIGN expression SEMICOLON | block | SEMICOLON )
aspect_syn_attribute_declaration ::= annotation* SYN NTA? LAZY? FINAL? aspect_type ast_type_name DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? ( ASSIGN expression SEMICOLON | block | SEMICOLON )
{
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectSynAttributeImpl"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectSynAttributeImpl"
}
}
aspect_inh_attribute_declaration ::= annotation* INH NTA? LAZY? FINAL? aspect_type IDENTIFIER DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
aspect_inh_attribute_declaration ::= annotation* INH NTA? LAZY? FINAL? aspect_type ast_type_name DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
{
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectInhAttributeImpl"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectInhAttributeImpl"
}
}
// FIXME parentheses are not required around the WHEN expression?
// FIXME parentheses are not required around the WHEN expression?
aspect_rewrite ::= REWRITE IDENTIFIER (IDENTIFIER DOT IDENTIFIER LPAREN RPAREN)? LBRACE ((WHEN LPAREN expression RPAREN)? TO aspect_type ( expression SEMICOLON | block ))+ RBRACE
aspect_rewrite ::= REWRITE IDENTIFIER (ast_type_name DOT IDENTIFIER LPAREN RPAREN)? LBRACE ((WHEN LPAREN expression RPAREN)? TO aspect_type ( expression SEMICOLON | block ))+ RBRACE
aspect_syn_equation ::= annotation* EQUATION IDENTIFIER DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN ( ASSIGN expression SEMICOLON | block )
aspect_syn_equation ::= annotation* EQUATION ast_type_name DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN ( ASSIGN expression SEMICOLON | block )
aspect_refine_syn_equation ::= REFINE IDENTIFIER EQUATION IDENTIFIER DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
aspect_refine_syn_equation ::= REFINE IDENTIFIER EQUATION ast_type_name DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
aspect_inh_equation ::= annotation* EQUATION IDENTIFIER DOT IDENTIFIER LPAREN (INT IDENTIFIER)? RPAREN DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
aspect_inh_equation ::= annotation* EQUATION ast_type_name DOT IDENTIFIER LPAREN (INT IDENTIFIER)? RPAREN DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
aspect_refine_inh_equation ::= REFINE IDENTIFIER EQUATION IDENTIFIER DOT IDENTIFIER LPAREN (INT IDENTIFIER)? RPAREN DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
aspect_refine_inh_equation ::= REFINE IDENTIFIER EQUATION ast_type_name DOT IDENTIFIER LPAREN (INT IDENTIFIER)? RPAREN DOT attribute_name LPAREN (type IDENTIFIER (COMMA type IDENTIFIER)*)? RPAREN (ASSIGN expression SEMICOLON | block)
collection_attribute ::= annotation* COLL aspect_type IDENTIFIER DOT attribute_name LPAREN RPAREN CIRCULAR? (LBRACKET expression RBRACKET)? (WITH IDENTIFIER)? (ROOT IDENTIFIER)? SEMICOLON
collection_attribute ::= annotation* COLL aspect_type ast_type_name DOT attribute_name LPAREN RPAREN CIRCULAR? (LBRACKET expression RBRACKET)? (WITH IDENTIFIER)? (ROOT IDENTIFIER)? SEMICOLON
{
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectCollAttributeImpl"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectCollAttributeImpl"
}
}
collection_contribution ::= annotation* IDENTIFIER CONTRIBUTES ( NTA expression TO IDENTIFIER DOT attribute_name LPAREN RPAREN | EACH? expression (WHEN expression)? TO IDENTIFIER DOT attribute_name LPAREN RPAREN (FOR EACH? expression)? | block TO IDENTIFIER DOT attribute_name LPAREN RPAREN ) SEMICOLON
collection_contribution ::= annotation* ast_type_name CONTRIBUTES ( NTA expression TO ast_type_name DOT attribute_name LPAREN RPAREN | EACH? expression (WHEN expression)? TO ast_type_name DOT attribute_name LPAREN RPAREN (FOR EACH? expression)? | block TO ast_type_name DOT attribute_name LPAREN RPAREN ) SEMICOLON
aspect_add_interface ::= IDENTIFIER IMPLEMENTS type_name_list SEMICOLON
aspect_add_interface ::= ast_type_name IMPLEMENTS type_name_list SEMICOLON
aspect_extend_interface ::= IDENTIFIER EXTENDS type_name_list SEMICOLON
aspect_extend_interface ::= ast_type_name EXTENDS type_name_list SEMICOLON
class_declaration ::= CLASS IDENTIFIER type_parameters? (EXTENDS class_or_interface_type)? (implements type_name_list)? class_body
class_declaration ::= CLASS IDENTIFIER type_parameters? (EXTENDS class_or_interface_type)? (implements type_name_list)? class_body
@@ -179,11 +161,11 @@ enum_body ::= LBRACE enum_constant (COMMA enum_constant)* (SEMICOLON class_body_
@@ -179,11 +161,11 @@ enum_body ::= LBRACE enum_constant (COMMA enum_constant)* (SEMICOLON class_body_
enum_constant ::= java_identifier arguments? class_body?
enum_constant ::= java_identifier arguments? class_body?
type_parameters ::= LT type_parameter (COMMA type_parameter)* GT
type_parameters ::= LT type_parameter (COMMA type_parameter)* GT
type_parameter ::= java_identifier type_bound?
type_parameter ::= java_identifier type_bound?
type_bound ::= EXTENDS class_or_interface_type (AMPERSAND class_or_interface_type)*
type_bound ::= EXTENDS class_or_interface_type (AMPERSAND class_or_interface_type)*
class_body ::= LBRACE class_body_declaration* RBRACE
class_body ::= LBRACE class_body_declaration* RBRACE
@@ -226,13 +208,17 @@ aspect_result_type ::= VOID | aspect_type
@@ -226,13 +208,17 @@ aspect_result_type ::= VOID | aspect_type
aspect_reference_type ::= aspect_class_or_interface_type (LBRACKET RBRACKET)*
aspect_reference_type ::= aspect_class_or_interface_type (LBRACKET RBRACKET)*
aspect_class_or_interface_type ::= IDENTIFIER type_arguments? (DOT java_identifier type_arguments? )*
aspect_class_or_interface_type ::= ast_type_name type_arguments? (DOT java_identifier type_arguments? )*
type ::= reference_type | primitive_type
type ::= reference_type | primitive_type
reference_type ::= ( primitive_type (LBRACKET RBRACKET)+ ) | ( class_or_interface_type (LBRACKET RBRACKET)* )
reference_type ::= ( primitive_type (LBRACKET RBRACKET)+ ) | ( class_or_interface_type (LBRACKET RBRACKET)* )
class_or_interface_type ::= java_identifier type_arguments? (DOT java_identifier type_arguments? )*
class_or_interface_type ::= java_identifier type_arguments? (DOT java_identifier type_arguments? )*
 
{
 
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectClassOrInterfaceTypeImplExtension"
 
implements="org.jastadd.tooling.grammar.psi.GrammarNamedElement"
 
}
type_arguments ::= LT (type_argument (COMMA type_argument)* )? GT
type_arguments ::= LT (type_argument (COMMA type_argument)* )? GT
@@ -404,17 +390,11 @@ java_identifier ::= IDENTIFIER | INH | SYN | LAZY | REWRITE | TO | WHEN | ASPECT
@@ -404,17 +390,11 @@ java_identifier ::= IDENTIFIER | INH | SYN | LAZY | REWRITE | TO | WHEN | ASPECT
attribute_name ::= IDENTIFIER
attribute_name ::= IDENTIFIER
// EOF
ast_type_name ::= IDENTIFIER
{
// unused keywords
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectAstTypeNameImplExtension"
 
implements="org.jastadd.tooling.grammar.psi.GrammarNamedElement"
 
}
 
// unused keywords must still appear somewhere
unused_keywords ::= GOTO | CONST ELLIPSIS | PACKAGE
unused_keywords ::= GOTO | CONST ELLIPSIS | PACKAGE
// island things
//// should be parsed after circular and in collection attributes
//expression_in_brackets ::= LBRACKET_ANYTHING_RBRACKET // LBRACKET expression RBRACKET
//{
// implements="org.jastadd.tooling.aspect.psi.JastAddAspectJavaExtension"
// extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectJavaImplExtension"
//}
Loading