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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
jetbrains-plugin
Commits
62cbe6c6
Commit
62cbe6c6
authored
3 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
more injections
parent
f43460b2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/grammar/Aspect.bnf
+12
-0
12 additions, 0 deletions
src/main/grammar/Aspect.bnf
src/main/java/org/jastadd/tooling/aspect/JavaLanguageInjector.java
+8
-6
8 additions, 6 deletions
...java/org/jastadd/tooling/aspect/JavaLanguageInjector.java
with
20 additions
and
6 deletions
src/main/grammar/Aspect.bnf
+
12
−
0
View file @
62cbe6c6
...
...
@@ -78,6 +78,10 @@ aspect_body_declaration ::= ( aspect_refine_inh_equation
| aspect_cache_declaration )
aspect_class_declaration ::= modifiers class_declaration
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectJavaExtension"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectJavaImplExtension"
}
aspect_interface_declaration ::= modifiers INTERFACE IDENTIFIER type_parameters? (EXTENDS type_name_list)? LBRACE aspect_interface_member_declaration* RBRACE
...
...
@@ -208,6 +212,10 @@ name_name ::= java_identifier (DOT java_identifier)*
name_list ::= name_name (COMMA name_name)*
expression ::= lambda_expression | ( conditional_expression (assignment_operator expression)? )
{
implements="org.jastadd.tooling.aspect.psi.JastAddAspectJavaExtension"
extends="org.jastadd.tooling.aspect.psi.impl.JastAddAspectJavaImplExtension"
}
assignment_operator ::= ASSIGN | STARASSIGN | SLASHASSIGN | REMASSIGN | PLUSASSIGN | MINUSASSIGN | LSHIFTASSIGN | RSIGNEDSHIFTASSIGN | RUNSIGNEDSHIFTASSIGN | ANDASSIGN | XORASSIGN | ORASSIGN
...
...
@@ -305,6 +313,10 @@ annotation ::= ( normal_annotation | single_member_annotation | marker_annotatio
// 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"
}
// at symbol only in these rules
marker_annotation ::= AT_NAME
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/jastadd/tooling/aspect/JavaLanguageInjector.java
+
8
−
6
View file @
62cbe6c6
...
...
@@ -22,14 +22,10 @@ public class JavaLanguageInjector implements LanguageInjector {
@Override
public
void
getLanguagesToInject
(
@NotNull
PsiLanguageInjectionHost
host
,
@NotNull
InjectedLanguagePlaces
injectionPlacesRegistrar
)
{
if
(
host
.
isValidHost
())
{
if
(
host
instanceof
JastAddAspectExpressionInBrackets
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectNormalAnnotation
)
{
if
(
host
instanceof
JastAddAspectNormalAnnotation
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectSingleMemberAnnotation
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectClassDeclaration
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectInterfaceDeclaration
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectEnumDeclaration
)
{
...
...
@@ -37,7 +33,13 @@ public class JavaLanguageInjector implements LanguageInjector {
}
else
if
(
host
instanceof
JastAddAspectAnnotationTypeDeclaration
)
{
// TODO
}
else
if
(
host
instanceof
JastAddAspectBlock
)
{
injectionPlacesRegistrar
.
addPlace
(
JavaLanguage
.
INSTANCE
,
new
TextRange
(
0
,
host
.
getTextLength
()),
"class X { public void m()"
,
"}"
);
injectionPlacesRegistrar
.
addPlace
(
JavaLanguage
.
INSTANCE
,
new
TextRange
(
1
,
host
.
getTextLength
()
-
1
),
"class X { public void m() {"
,
"}}"
);
}
else
if
(
host
instanceof
JastAddAspectExpression
)
{
injectionPlacesRegistrar
.
addPlace
(
JavaLanguage
.
INSTANCE
,
new
TextRange
(
0
,
host
.
getTextLength
()),
"class X { public void m() {Object x = "
,
";}}"
);
}
else
if
(
host
instanceof
JastAddAspectExpressionInBrackets
)
{
injectionPlacesRegistrar
.
addPlace
(
JavaLanguage
.
INSTANCE
,
new
TextRange
(
1
,
host
.
getTextLength
()
-
1
),
"class X { public void m() {Object x = "
,
";}}"
);
}
else
if
(
host
instanceof
JastAddAspectAspectClassDeclaration
)
{
injectionPlacesRegistrar
.
addPlace
(
JavaLanguage
.
INSTANCE
,
new
TextRange
(
0
,
host
.
getTextLength
()),
""
,
""
);
}
}
}
...
...
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