Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
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
doxverilog
Commits
9af29601
Commit
9af29601
authored
Jun 25, 2013
by
Petr Prikryl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/translator.py -- TranslatorDecoder checks removed
parent
49009182
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
42 deletions
+1
-42
translator.py
doc/translator.py
+1
-42
No files found.
doc/translator.py
View file @
9af29601
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
2010/09/27 - The underscore in
\
latexonly part of the generated language.doc
2010/09/27 - The underscore in
\
latexonly part of the generated language.doc
was prefixed by backslash (was LaTeX related error).
was prefixed by backslash (was LaTeX related error).
2013/02/19 - Better diagnostics when translator_xx.h is too crippled.
2013/02/19 - Better diagnostics when translator_xx.h is too crippled.
2013/06/25 - TranslatorDecoder checks removed after removing the class.
"""
"""
from
__future__
import
generators
from
__future__
import
generators
...
@@ -185,7 +186,6 @@ class Transl:
...
@@ -185,7 +186,6 @@ class Transl:
self
.
missingMethods
=
None
# list of prototypes to be implemented
self
.
missingMethods
=
None
# list of prototypes to be implemented
self
.
implementedMethods
=
None
# list of implemented required methods
self
.
implementedMethods
=
None
# list of implemented required methods
self
.
adaptMinClass
=
None
# The newest adapter class that can be used
self
.
adaptMinClass
=
None
# The newest adapter class that can be used
self
.
isDecodedTranslator
=
None
# Flag related to internal usage of UTF-8
def
__tokenGenerator
(
self
):
def
__tokenGenerator
(
self
):
"""Generator that reads the file and yields tokens as 4-tuples.
"""Generator that reads the file and yields tokens as 4-tuples.
...
@@ -1117,13 +1117,6 @@ class Transl:
...
@@ -1117,13 +1117,6 @@ class Transl:
else
:
else
:
self
.
missingMethods
.
append
(
p
)
self
.
missingMethods
.
append
(
p
)
# Set the least important note first if the translator is decoded.
# If yes, then it means that the implementation should be switched
# to UTF-8 later (suggestion).
self
.
isDecodedTranslator
=
self
.
classId
in
self
.
manager
.
decodedTranslators
if
self
.
isDecodedTranslator
:
self
.
note
=
'Reimplementation using UTF-8 suggested.'
# Check whether adapter must be used or suggest the newest one.
# Check whether adapter must be used or suggest the newest one.
# Change the status and set the note accordingly.
# Change the status and set the note accordingly.
if
self
.
baseClassId
!=
'Translator'
:
if
self
.
baseClassId
!=
'Translator'
:
...
@@ -1307,44 +1300,10 @@ class TrManager:
...
@@ -1307,44 +1300,10 @@ class TrManager:
self
.
numLang
=
None
# excluding coupled En-based
self
.
numLang
=
None
# excluding coupled En-based
self
.
doxVersion
=
None
# Doxygen version
self
.
doxVersion
=
None
# Doxygen version
# Capture the knowledge about translators that are not implemented
# to use UTF-8 internally.
self
.
decodedTranslators
=
self
.
getDecodedTranslators
()
# Build objects where each one is responsible for one translator.
# Build objects where each one is responsible for one translator.
self
.
__build
()
self
.
__build
()
def
getDecodedTranslators
(
self
):
"""Parses language.cpp to find what translators do not use UTF-8 yet"""
decodedTranslators
=
[]
# Regular expression to detect the lines like
# theTranslator=new TranslatorDecoder(new TranslatorSwedish);
rex
=
re
.
compile
(
r'^\s*theTranslator\s*=\s*new\s+.*$'
)
# Regular expression to get the (optional) TranslatorDecoder and TranslatorXXX
rex2
=
re
.
compile
(
r'\bTranslator\w+'
)
# Parse the lines in the specific source code.
f
=
open
(
os
.
path
.
join
(
self
.
src_path
,
'language.cpp'
),
'rU'
)
for
line
in
f
:
if
rex
.
match
(
line
):
lst
=
rex2
.
findall
(
line
)
if
lst
[
0
]
==
'TranslatorDecoder'
:
decodedTranslators
.
append
(
lst
[
1
])
f
.
close
()
# Display warning when all translator implementations were converted
# to UTF-8.
if
len
(
decodedTranslators
)
==
0
:
print
'This script should be updated. All translators do use UTF-8'
print
'internally. The TranslatorDecoder adapter should be removed'
print
'from the code and its usage should not be checked any more.'
return
decodedTranslators
def
__build
(
self
):
def
__build
(
self
):
"""Find the translator files and build the objects for translators."""
"""Find the translator files and build the objects for translators."""
...
...
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