Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
5161af32
Commit
5161af32
authored
Jan 26, 2016
by
Michael Schwarz
🤔
Browse files
fixed insert location of precedences
parent
97758e5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
View file @
5161af32
...
...
@@ -823,6 +823,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
resolutionOptions
.
select
(
0
);
changeColors
(
backgroundColorShiftReduce
,
foregroundColorShiftReduce
);
}
partOfCurrentConnected
=
false
;
}
// replace (*) generated by CUP with BULLET U+2022 •
...
...
@@ -950,8 +952,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
}
public
CupConflictsView
(
Composite
realParent
,
Jumper
jumper
,
CupTextEditor
editor
)
{
public
CupConflictsView
(
Composite
realParent
,
Jumper
jumper
,
CupTextEditor
editor
)
{
super
(
realParent
);
Composite
parent
=
getMain
();
...
...
@@ -1167,18 +1168,21 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
positionForPrec
=
r
.
symbols
.
get
(
r
.
symbols
.
size
()
-
1
).
getEnd
().
getOffsetFromStart
();
toInsert
=
"\n\n//Precedences added by Eclipse plugin\n"
+
toInsert
;
}
else
{
positionForPrec
=
r
.
precedences
.
get
(
r
.
precedences
.
size
()
-
1
).
getRange
().
getBegin
()
positionForPrec
=
r
.
precedences
.
get
(
0
).
getRange
().
getBegin
()
.
getOffsetFromStart
();
toInsert
=
toInsert
+
"\n"
;
}
document
.
replace
(
positionForPrec
,
0
,
toInsert
);
abortConnectedResolution
();
}
catch
(
BadLocationException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
finally
{
abortConnectedResolution
();
}
}
private
void
insertPrecedence
(
terminal
terminal
,
Precedence
.
Type
assoc
){
...
...
@@ -1195,7 +1199,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
toInsert
=
"\n\n//Precedences added by Eclipse plugin\n"
+
toInsert
;
}
else
{
positionForPrec
=
r
.
precedences
.
get
(
r
.
precedences
.
size
()-
1
).
getRange
().
getBegin
().
getOffsetFromStart
();
positionForPrec
=
r
.
precedences
.
get
(
0
).
getRange
().
getBegin
().
getOffsetFromStart
();
toInsert
=
toInsert
+
"\n"
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment