Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jetbrains-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
jetbrains-plugin
Commits
c2148bb6
Commit
c2148bb6
authored
3 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
add new types for all usages of IDENTIFIER to make its value available
parent
221e6182
Branches
Branches containing commit
No related tags found
1 merge request
!5
Resolve "Structure View Support"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/grammar/Aspect.bnf
+31
-19
31 additions, 19 deletions
src/main/grammar/Aspect.bnf
with
31 additions
and
19 deletions
src/main/grammar/Aspect.bnf
+
31
−
19
View file @
c2148bb6
...
...
@@ -34,7 +34,11 @@ modifiers ::= (PUBLIC | STATIC | PROTECTED | PRIVATE | FINAL | ABSTRACT | SYNCH
type_declaration ::= SEMICOLON | (modifiers ( class_declaration | interface_declaration | unmodified_enum_declaration | annotation_type_declaration | aspect_declaration ) )
aspect_declaration ::= ASPECT IDENTIFIER aspect_body
aspect_declaration ::= ASPECT aspect_name aspect_body
{
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectAspectDeclarationImplExtension"
implements="org.jastadd.tooling.grammar.psi.GrammarNamedElement"
}
aspect_body ::= LBRACE aspect_body_declaration* RBRACE
...
...
@@ -70,7 +74,7 @@ aspect_class_declaration ::= modifiers class_declaration
// aspect_class_body unused
aspect_interface_declaration ::= modifiers INTERFACE
IDENTIFIER
type_parameters? (EXTENDS type_name_list)? LBRACE aspect_interface_member_declaration* RBRACE
aspect_interface_declaration ::= modifiers INTERFACE
simple_type_name
type_parameters? (EXTENDS type_name_list)? LBRACE aspect_interface_member_declaration* RBRACE
aspect_interface_member_declaration ::= ( aspect_nested_class_declaration
| aspect_nested_interface_declaration
...
...
@@ -79,13 +83,13 @@ aspect_interface_member_declaration ::= ( aspect_nested_class_declaration
| aspect_interface_method_declaration
| aspect_interface_field_declaration )
aspect_interface_syn_attribute_declaration ::= annotation* SYN LAZY? FINAL? aspect_type attribute_name LPAREN (type
IDENTIFIER (COMMA type IDENTIFIER
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
aspect_interface_syn_attribute_declaration ::= annotation* SYN LAZY? FINAL? aspect_type attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectSynAttributeImpl"
}
aspect_interface_inh_attribute_declaration ::= annotation* INH LAZY? FINAL? aspect_type attribute_name LPAREN (type
IDENTIFIER (COMMA type IDENTIFIER
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
aspect_interface_inh_attribute_declaration ::= annotation* INH LAZY? FINAL? aspect_type attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectInhAttributeImpl"
...
...
@@ -103,38 +107,38 @@ aspect_nested_class_declaration ::= modifiers class_declaration
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 [
aspect_name
] modifiers type_parameters? aspect_result_type
ast_type_name
DOT method_declarator (THROWS name_list)? (block | SEMICOLON)
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) ast_type_name DOT
IDENTIFIER
formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE
aspect_refine_constructor_declaration ::= REFINE
aspect_name
(PUBLIC | PROTECTED | PRIVATE) ast_type_name DOT
method_name
formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE
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 ast_type_name 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
parameter_name (COMMA type parameter_name
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? ( ASSIGN expression SEMICOLON | block | SEMICOLON )
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectSynAttributeImpl"
}
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
aspect_inh_attribute_declaration ::= annotation* INH NTA? LAZY? FINAL? aspect_type ast_type_name DOT attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)* )? RPAREN (CIRCULAR LBRACKET expression RBRACKET)? SEMICOLON
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectInhAttributeImpl"
}
// FIXME parentheses are not required around the WHEN expression?
aspect_rewrite ::= REWRITE
IDENTIFIER
(ast_type_name DOT
IDENTIFIER
LPAREN RPAREN)? LBRACE ((WHEN LPAREN expression RPAREN)? TO aspect_type ( expression SEMICOLON | block ))+ RBRACE
aspect_rewrite ::= REWRITE
aspect_name
(ast_type_name DOT
method_name
LPAREN RPAREN)? LBRACE ((WHEN LPAREN expression RPAREN)? TO aspect_type ( expression SEMICOLON | block ))+ RBRACE
aspect_syn_equation ::= annotation* EQUATION ast_type_name 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
parameter_name (COMMA type parameter_name
)*)? 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_refine_syn_equation ::= REFINE
aspect_name
EQUATION ast_type_name DOT attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)*)? 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_inh_equation ::= annotation* EQUATION ast_type_name DOT
attribute_name LPAREN (INT parameter_name
)? RPAREN DOT attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)*)? 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)
aspect_refine_inh_equation ::= REFINE
aspect_name
EQUATION ast_type_name DOT
attribute_name LPAREN (INT parameter_name
)? RPAREN DOT attribute_name LPAREN (type
parameter_name (COMMA type parameter_name
)*)? RPAREN (ASSIGN expression SEMICOLON | block)
collection_attribute ::= annotation* COLL aspect_type ast_type_name 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
method_name)? (ROOT ast_type_name
)? SEMICOLON
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectAttribute"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectCollAttributeImpl"
...
...
@@ -146,14 +150,14 @@ aspect_add_interface ::= ast_type_name IMPLEMENTS 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
simple_type_name
type_parameters? (EXTENDS class_or_interface_type)? (implements type_name_list)? class_body
type_name_list ::= class_or_interface_type (COMMA class_or_interface_type)*
unmodified_class_declaration ::= CLASS
IDENTIFIER
type_parameters? (EXTENDS class_or_interface_type)? (IMPLEMENTS type_name_list)? class_body
unmodified_class_declaration ::= CLASS
simple_type_name
type_parameters? (EXTENDS class_or_interface_type)? (IMPLEMENTS type_name_list)? class_body
// TODO check simplification
aspect_enum_declaration ::= modifiers ENUM
IDENTIFIER
(IMPLEMENTS type_name_list)? enum_body
aspect_enum_declaration ::= modifiers ENUM
simple_type_name
(IMPLEMENTS type_name_list)? enum_body
unmodified_enum_declaration ::= ENUM java_identifier (IMPLEMENTS type_name_list)? enum_body
...
...
@@ -173,7 +177,7 @@ class_body_declaration ::= initializer | modifiers ( unmodified_class_declaratio
interface_declaration ::= unmodified_interface_declaration
unmodified_interface_declaration ::= INTERFACE
IDENTIFIER
type_parameters? (EXTENDS type_name_list)? LBRACE interface_member_declaration* RBRACE
unmodified_interface_declaration ::= INTERFACE
simple_type_name
type_parameters? (EXTENDS type_name_list)? LBRACE interface_member_declaration* RBRACE
interface_member_declaration ::= modifiers (unmodified_class_declaration | unmodified_interface_declaration | field_declaration | method_declaration) | SEMICOLON
...
...
@@ -384,7 +388,7 @@ annotation_type_member_declaration ::= ( modifiers (aspect_type java_identifier
default_value ::= DEFAULT member_value
aspect_cache_declaration ::= (CACHE | UNCACHE)
IDENTIFIER
DOT attribute_name LPAREN (type
IDENTIFIER? (COMMA type IDENTIFIER
?)* )? RPAREN SEMICOLON
aspect_cache_declaration ::= (CACHE | UNCACHE)
aspect_name
DOT attribute_name LPAREN (type
parameter_name? (COMMA type parameter_name
?)* )? RPAREN SEMICOLON
java_identifier ::= IDENTIFIER | INH | SYN | LAZY | REWRITE | TO | WHEN | ASPECT | EQUATION | CIRCULAR | REFINE | COLL | CONTRIBUTES | EACH | NTA | CACHE | UNCACHE
...
...
@@ -396,5 +400,13 @@ ast_type_name ::= IDENTIFIER
implements="org.jastadd.tooling.grammar.psi.GrammarNamedElement"
}
aspect_name ::= IDENTIFIER
simple_type_name ::= IDENTIFIER
parameter_name ::= IDENTIFIER
method_name ::= IDENTIFIER
// unused keywords must still appear somewhere
unused_keywords ::= GOTO | CONST ELLIPSIS | PACKAGE
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment