Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CUP Eclipse Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
4d5ce9e8
Commit
4d5ce9e8
authored
Feb 23, 2016
by
Michael Schwarz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
treat insert single prec as special connected res.
Fixed bug that caused assoc to be left if resolving single item
parent
55068302
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
25 deletions
+6
-25
CupPlugin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
...gin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
+3
-3
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
.../src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
+3
-22
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
View file @
4d5ce9e8
...
...
@@ -613,9 +613,9 @@ class ConflictPanel extends Composite {
// These are the cases where nothing is affected
if
(
resolutionOptions
.
getSelectionIndex
()
==
1
)
// Shift
cupConflictsView
.
insertSinglePrecedence
(
srdetails
.
shift
,
Precedence
.
Type
.
Left
);
cupConflictsView
.
insertSinglePrecedence
(
srdetails
.
shift
,
Precedence
.
Type
.
NonAssoc
);
else
if
(
resolutionOptions
.
getSelectionIndex
()
==
2
)
// Reduce
cupConflictsView
.
insertSinglePrecedence
(
srdetails
.
reduce
,
Precedence
.
Type
.
Left
);
cupConflictsView
.
insertSinglePrecedence
(
srdetails
.
reduce
,
Precedence
.
Type
.
NonAssoc
);
}
else
{
...
...
@@ -653,7 +653,7 @@ class ConflictPanel extends Composite {
lr_item_core
item2
=
new
lr_item_core
(
rrc
.
getConflictItem2
().
the_production
(),
rrc
.
getConflictItem2
().
dot_pos
());
if
(!
cupConflictsView
.
settingOrderAffetsOtherConflicts
(
item1
,
item2
)){
ReduceReduceReorder
rrr
=
new
ReduceReduceReorder
(
cupConflictsView
.
getDocument
()
,
cupConflictsView
.
isThresholdPresent
()
);
ReduceReduceReorder
rrr
=
new
ReduceReduceReorder
(
cupConflictsView
.
getDocument
());
if
(
resolutionOptions
.
getSelectionIndex
()
==
1
){
rrr
.
moveItemToVeryEnd
(
rrc
.
getConflictItem1
());
...
...
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
View file @
4d5ce9e8
...
...
@@ -561,28 +561,9 @@ public class CupConflictsView extends FailableView
* the associativity
*/
void
insertSinglePrecedence
(
terminal
terminal
,
Precedence
.
Type
assoc
)
{
try
{
String
toInsert
=
"precedence "
+
assoc
.
toString
().
toLowerCase
()
+
" "
+
terminal
.
name
()
+
"; // Inserted by Eclipse plugin"
;
IDocument
document
=
editor
.
getDocument
();
ParserResult
r
=
Model
.
getInstanceForDocument
(
document
).
getAstModel
();
int
positionForPrec
=
0
;
if
(
r
.
precedences
.
size
()
==
0
)
{
// Precedences are located immediately after the last symbol
// decl
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
(
0
).
getRange
().
getBegin
().
getOffsetFromStart
();
toInsert
=
toInsert
+
"\n"
;
}
document
.
replace
(
positionForPrec
,
0
,
toInsert
);
}
catch
(
BadLocationException
e
)
{
e
.
printStackTrace
();
}
PrecedenceToInsert
pti
=
new
PrecedenceToInsert
();
pti
.
setAssoc
(
terminal
,
assoc
);
pti
.
apply
(
editor
.
getDocument
());
}
boolean
insertingPrecAffectsOtherConflicts
(
terminal
t
)
{
...
...
Write
Preview
Markdown
is supported
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