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
Michael Schwarz
CUP Eclipse Plugin
Commits
1ec32a0f
Commit
1ec32a0f
authored
Feb 22, 2016
by
Michael Schwarz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update buildfile after each parser run to reflect expected conflicts
parent
b7ac611e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
CupPlugin/src/de/tum/in/www2/cupplugin/views/BuildfileUpdater.java
.../src/de/tum/in/www2/cupplugin/views/BuildfileUpdater.java
+2
-2
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
.../src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
+15
-6
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/views/BuildfileUpdater.java
View file @
1ec32a0f
...
...
@@ -26,7 +26,7 @@ import org.xml.sax.SAXException;
public
class
BuildfileUpdater
{
public
static
void
updateExpectedConflicts
(
IProject
project
,
int
number
)
throws
ParserConfigurationException
,
SAXException
,
IOException
,
CoreException
,
TransformerConfigurationException
,
TransformerException
,
TransformerFactoryConfigurationError
{
public
static
void
updateExpectedConflicts
(
IProject
project
,
int
number
)
throws
ParserConfigurationException
,
SAXException
,
CoreException
,
TransformerConfigurationException
,
TransformerException
,
TransformerFactoryConfigurationError
,
IOException
{
boolean
modified
=
false
;
Path
path
=
new
Path
(
"build.xml"
);
...
...
@@ -37,7 +37,7 @@ public class BuildfileUpdater {
Document
doc
=
db
.
parse
(
file
.
getContents
());
if
(
doc
.
getElementsByTagName
(
"cup"
).
getLength
()
!=
1
){
//TODO: error
throw
new
IOException
();
}
else
{
Node
n
=
doc
.
getElementsByTagName
(
"cup"
).
item
(
0
);
...
...
CupPlugin/src/de/tum/in/www2/cupplugin/views/CupConflictsView.java
View file @
1ec32a0f
...
...
@@ -210,38 +210,47 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
refreshScrolledLayout
();
}
private
void
updateBuildfile
(){
//DEBUG
private
void
updateBuildfile
(
int
number
){
try
{
IFileEditorInput
input
=
(
IFileEditorInput
)
editor
.
getEditorInput
();
IFile
file
=
input
.
getFile
();
IProject
project
=
file
.
getProject
();
BuildfileUpdater
.
updateExpectedConflicts
(
project
,
42
);
BuildfileUpdater
.
updateExpectedConflicts
(
project
,
number
);
}
catch
(
ParserConfigurationException
|
SAXException
|
IOException
|
CoreException
|
TransformerException
|
TransformerFactoryConfigurationError
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
Shell
shell
=
new
Shell
(
Display
.
getCurrent
());
MessageBox
box
=
new
MessageBox
(
shell
,
SWT
.
ICON_WARNING
|
SWT
.
OK
);
box
.
setText
(
"Information"
);
box
.
setMessage
(
"Failed to update the expect label in the buildfile.\nThere was no file named build.xml containing a cup section.\n"
+
"Please update your buildfile and set the expect label to number."
);
box
.
open
();
}
}
private
void
updateConflicts
(
ConflictResolutionManager
crm
)
{
updateBuildfile
();
ignoreRRAfterLine
=
computeIgnoreRRAfter
();
List
<
Conflict
>
conflicts
=
new
ArrayList
<>();
terminalsAffectConflicts
=
new
HashMap
<>();
ordersAffectConflicts
=
new
HashMap
<>();
int
ignored
=
0
;
for
(
int
i
=
0
;
i
<
crm
.
getAllConflicts
().
size
();
i
++)
{
Conflict
c
=
crm
.
getAllConflicts
().
get
(
i
);
if
(!
isIgnored
(
c
)){
conflicts
.
add
(
c
);
addToTerminalSet
(
crm
,
c
);
addToOrderSet
(
c
);
}
else
{
ignored
++;
}
}
int
size
=
conflicts
.
size
();
//TODO:Do this less often
updateBuildfile
(
ignored
);
scrolled
.
setLayoutDeferred
(
true
);
matchPanelNumber
(
size
);
...
...
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