[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser
Jean Vittor
jean.vittor at free.fr
Fri Apr 4 08:39:19 UTC 2008
SVN commit 793500 by jvittor:
Remove unused stuffs
M +2 -6 lexer.h
M +0 -16 preprocesslexer.cpp
M +2 -7 preprocesslexer.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/lexer.h #793499:793500
@@ -72,7 +72,6 @@
const QString& str = QString())
{m_preprocessLexer.addSkipWord( word, skipType, str);}
void setSource( const QString& source, PositionFilename const& p_filename);
-
void setRecordComments( bool record );
Position currentPosition() const
{return m_source.get_currentPosition();}
@@ -136,15 +135,12 @@
source.data() + source.length(),
Position( m_filename));
}
- QString substrFrom( CharIterator start) const
- {return QString( &*start, &*m_ptr - &*start);}
/* getters */
Position get_currentPosition() const {return m_ptr.get_position();}
CharIterator get_ptr() const {return m_ptr;}
bool get_startLine() const {return m_startLine;}
/* setters */
void set_startLine( bool p) {m_startLine = p;}
- void set_currentPosition( Position const& p) {m_ptr.set_position( p);}
private:
PositionFilename m_filename;
CharIterator m_ptr;
@@ -162,8 +158,8 @@
return m_recordComments;
}
-inline void Lexer::setRecordComments( bool record )
-{
+inline void Lexer::setRecordComments( bool record) {
+ m_preprocessLexer.setRecordComments( record);
m_recordComments = record;
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp #793499:793500
@@ -343,18 +343,10 @@
}
}
-Position const& PreprocessLexer::getTokenPosition( const Token& token) const
-{
- return token.getStartPosition();
-}
-
void PreprocessLexer::nextToken( Token& tk)
{
m_source.parse( (*gr_whiteSpace)
[boost::bind( &PreprocessLexer::output, this, _1, _2)]);
-
- Position startPosition( currentPosition());
-
QChar ch = m_source.currentChar();
if( ch.isNull() || ch.isSpace() ){
/* skip */
@@ -396,11 +388,7 @@
m_data->beginScope();
- Position svPosition = currentPosition();
-
- // Macro& m = m_driver->macro( ide );
Macro m = m_driver->macro( ide );
- //m_driver->removeMacro( m.name() );
QString ellipsisArg;
@@ -439,8 +427,6 @@
// valid macro
}
} else {
- Position l_newPosition( svPosition);
- l_newPosition.column += (endIde - start);
tk = m_source.createToken( Token_identifier, start, endIde);
m_source.set_startLine( false);
@@ -687,7 +673,6 @@
m_inPreproc = false;
}
-#warning replace by a grammar
bool PreprocessLexer::macroDefined()
{
QString word;
@@ -760,7 +745,6 @@
if( !l_hit)
result = 0;
} else {
-#warning use locals
boost::function<int (int)> l_op = _Identity<int>();
if( m_source.parse( ch_p('+')
| ch_p('-')[var(l_op) = std::negate<int>()]
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.h #793499:793500
@@ -198,10 +198,8 @@
class PreprocessLexer
{
- typedef std::list<Token> TokenList;
public:
typedef rule<scanner<CharIterator, CharPolicies> > CharRule;
- typedef TokenList::const_iterator TokenIterator;
PreprocessLexer( Driver* driver );
~PreprocessLexer();
@@ -209,13 +207,8 @@
void addSkipWord( const QString& word, SkipType skipType = SkipWord,
const QString& str = QString() );
void preprocess();
- QString source() const {return m_source.get_source();}
void setSource( const QString& source, PositionFilename const& p_filename);
-
void setRecordComments( bool record );
- Position currentPosition() const
- {return m_source.get_currentPosition();}
- Position const& getTokenPosition( const Token& token) const;
QString const& preprocessedString() const {return m_preprocessedString;}
private:
static int toInt( const Token& token );
@@ -225,6 +218,8 @@
Dependence( p_wordAndScope.first,
p_wordAndScope.second));
}
+ Position currentPosition() const
+ {return m_source.get_currentPosition();}
void nextToken( Token& token);
void output( CharIterator p_first, CharIterator p_last);
void skip( int l, int r );
More information about the umbrello-devel
mailing list