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
c70b49cd
Commit
c70b49cd
authored
Feb 21, 2016
by
Michael Schwarz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ingore all RR conflicts past a certain treshold
parent
912b6a4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
.../src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
+23
-8
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
View file @
c70b49cd
...
...
@@ -31,6 +31,7 @@ import de.in.tum.www2.cup.Conflict;
import
de.in.tum.www2.cup.ConflictResolutionManager
;
import
de.in.tum.www2.cup.LALRResult
;
import
de.in.tum.www2.cup.Position
;
import
de.in.tum.www2.cup.ReduceReduceConflict
;
import
de.in.tum.www2.cup.ShiftReduceConflict
;
import
de.in.tum.www2.cup.ast.IProductionRightPart
;
import
de.in.tum.www2.cup.ast.ParserResult
;
...
...
@@ -190,17 +191,18 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
}
private
void
updateConflicts
(
ConflictResolutionManager
crm
)
{
List
<
Conflict
>
conflicts
=
crm
.
getAllConflicts
();
List
<
Conflict
>
conflicts
=
new
ArrayList
<>();
terminalsAffectConflicts
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
crm
.
getAllConflicts
().
size
();
i
++)
{
Conflict
c
=
crm
.
getAllConflicts
().
get
(
i
);
if
(!
isIgnored
(
c
)){
conflicts
.
add
(
c
);
addToTerminalSet
(
crm
,
c
);
}
}
int
size
=
conflicts
.
size
();
scrolled
.
setLayoutDeferred
(
true
);
// Do this first, otherwise the affects others is wrong because it operates on a subset of actual terminals
terminalsAffectConflicts
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
Conflict
conflict
=
conflicts
.
get
(
i
);
addToTerminalSet
(
crm
,
conflict
);
}
matchPanelNumber
(
size
);
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
...
...
@@ -519,4 +521,17 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
return
affected
!=
1
;
}
}
private
boolean
isIgnored
(
Conflict
c
){
if
(
c
instanceof
ReduceReduceConflict
){
ReduceReduceConflict
rrc
=
(
ReduceReduceConflict
)
c
;
int
treshold
=
200
;
return
(
rrc
.
getConflictItem1
().
the_production
().
getAstNode
().
getEnd
().
getLine
()
>
treshold
)
&&
(
rrc
.
getConflictItem2
().
the_production
().
getAstNode
().
getEnd
().
getLine
()
>
treshold
);
}
else
{
return
false
;
}
}
}
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