Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
e72c8dd2
Commit
e72c8dd2
authored
Mar 24, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made python-based parser script for Vivado
parent
06b222bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
10 deletions
+51
-10
parser_ise.py
parsers/parser_ise.py
+10
-10
parser_vivado.py
parsers/parser_vivado.py
+41
-0
No files found.
parsers/parser_ise.py
100644 → 100755
View file @
e72c8dd2
...
...
@@ -5,21 +5,21 @@ tool="EXTERNAL_TOOL"
if
len
(
sys
.
argv
)
>
1
:
tool
=
sys
.
argv
[
1
]
def
isProblem
(
str
):
if
str
.
startswith
(
"ERROR:"
)
or
str
.
startswith
(
"WARNING:"
)
or
str
.
startswith
(
"INFO:"
):
def
isProblem
(
str
ing
):
if
str
ing
.
startswith
(
"ERROR:"
)
or
string
.
startswith
(
"WARNING:"
)
or
string
.
startswith
(
"INFO:"
):
return
True
return
False
def
hasLine
(
str
):
if
'" Line '
in
str
:
def
hasLine
(
str
ing
):
if
'" Line '
in
str
ing
:
return
True
return
False
def
addTool
(
str
,
tool
):
if
hasLine
(
str
):
return
str
def
addTool
(
str
ing
,
tool
):
if
hasLine
(
str
ing
):
return
str
ing
else
:
index
=
str
.
find
(
" - "
)
+
3
return
str
[:
index
]
+
(
"
\"
%
s
\"
Line 0000:"
%
tool
)
+
str
[
index
:]
# return str
[:len(str
)-1]+(" \"%s\" Line 0000:"%tool)+"\n"
index
=
str
ing
.
find
(
" - "
)
+
3
return
str
ing
[:
index
]
+
(
"
\"
%
s
\"
Line 0000:"
%
tool
)
+
string
[
index
:]
# return str
ing[:len(string
)-1]+(" \"%s\" Line 0000:"%tool)+"\n"
pline
=
""
...
...
parsers/parser_vivado.py
0 → 100755
View file @
e72c8dd2
#!/usr/bin/env python
##/usr/bin/python -u
import
sys
import
re
pattern
=
re
.
compile
(
"
\
[[^[:]*:
\
d*]"
)
tool
=
"EXTERNAL_TOOL"
if
len
(
sys
.
argv
)
>
1
:
tool
=
sys
.
argv
[
1
]
def
isProblem
(
string
):
if
string
.
startswith
(
"ERROR:"
)
or
string
.
startswith
(
"WARNING:"
)
or
string
.
startswith
(
"INFO:"
):
return
True
return
False
#def hasLine(string):
# if '" Line ' in string:
# return True
# return False
#Problem string has "[filename:line_number]"
def
hasFileVivado
(
string
):
# [*:*]
if
pattern
.
findall
(
string
):
return
True
return
False
#add [tool_name:0000] if there is no {file:line_no] to generate Eclipse problem marker
def
addTool
(
string
,
tool
):
if
hasFileVivado
(
string
):
return
string
else
:
return
string
[:
len
(
string
)
-
1
]
+
"[
%
s:0000]"
%
tool
+
string
[
len
(
string
)
-
1
]
pline
=
""
for
line
in
iter
(
sys
.
stdin
.
readline
,
''
):
if
isProblem
(
pline
):
if
line
.
startswith
(
" "
)
:
pline
=
pline
[:
len
(
pline
)
-
1
]
+
line
[
2
:]
else
:
sys
.
stdout
.
write
(
addTool
(
pline
,
tool
))
pline
=
line
else
:
pline
=
line
if
isProblem
(
pline
):
sys
.
stdout
.
write
(
addTool
(
pline
,
tool
))
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